summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2011-03-29 11:04:58 (GMT)
committerDavid Boddie <david.boddie@nokia.com>2011-03-29 11:04:58 (GMT)
commit9ee276e8a582679d50803b5c5a5f12f1b9aa9df5 (patch)
tree1577dd3a842d058a3a3a13350c3f15ad53b31180
parentdef7250ed1a3169a9a39a064402868e9928584f9 (diff)
parentd38664f2ca736560a129a8ff09b293ecb83efac2 (diff)
downloadQt-9ee276e8a582679d50803b5c5a5f12f1b9aa9df5.zip
Qt-9ee276e8a582679d50803b5c5a5f12f1b9aa9df5.tar.gz
Qt-9ee276e8a582679d50803b5c5a5f12f1b9aa9df5.tar.bz2
Merge branch '4.7' of /home/dboddie/git/qt-doc-team into 4.7
-rwxr-xr-xbin/elf2e32_qtwrapper148
-rw-r--r--bin/elf2e32_qtwrapper.bat3
-rwxr-xr-xbin/elf2e32_qtwrapper.pl265
-rw-r--r--config.tests/unix/endian/endiantest.cpp8
-rwxr-xr-xconfigure163
-rw-r--r--demos/demos.pro12
-rw-r--r--demos/mobile/guitartuner/guitartuner.pro89
-rw-r--r--demos/mobile/guitartuner/guitartuner.qrc43
-rw-r--r--demos/mobile/guitartuner/images/guitartab.svg174
-rw-r--r--demos/mobile/guitartuner/images/guitartuner_icon.svg247
-rw-r--r--demos/mobile/guitartuner/images/inputMode.svg161
-rw-r--r--demos/mobile/guitartuner/images/note.svg101
-rw-r--r--demos/mobile/guitartuner/images/noteNo.svg105
-rw-r--r--demos/mobile/guitartuner/src/application.qml328
-rw-r--r--demos/mobile/guitartuner/src/constants.h54
-rw-r--r--demos/mobile/guitartuner/src/fastfouriertransformer.cpp184
-rw-r--r--demos/mobile/guitartuner/src/fastfouriertransformer.h67
-rw-r--r--demos/mobile/guitartuner/src/fftpack.c1406
-rw-r--r--demos/mobile/guitartuner/src/guitartuner.cpp359
-rw-r--r--demos/mobile/guitartuner/src/guitartuner.h95
-rw-r--r--demos/mobile/guitartuner/src/guitartuner.rc23
-rw-r--r--demos/mobile/guitartuner/src/guitartuner.ui178
-rw-r--r--demos/mobile/guitartuner/src/guitartunerui.cpp341
-rw-r--r--demos/mobile/guitartuner/src/guitartunerui.h111
-rw-r--r--demos/mobile/guitartuner/src/guitartunerui.ui178
-rw-r--r--demos/mobile/guitartuner/src/main.cpp60
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/Adjuster.qml131
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/Meter.qml112
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/NoteButtonView.qml84
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/NotesModel.qml105
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/ToggleButton.qml110
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/adjustbars.js89
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/big_a.pngbin0 -> 575 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/big_b.pngbin0 -> 599 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/big_d.pngbin0 -> 465 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/big_e.pngbin0 -> 327 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/big_g.pngbin0 -> 610 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/glowing_a.pngbin0 -> 2978 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/glowing_b.pngbin0 -> 3084 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/glowing_d.pngbin0 -> 2940 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/glowing_e.pngbin0 -> 2696 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/glowing_g.pngbin0 -> 3046 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/guitartuner_malli.pngbin0 -> 143243 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/guitartuner_skin.pngbin0 -> 129068 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/lcdFrame.pngbin0 -> 176107 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/meterBG.pngbin0 -> 8378 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/mute.pngbin0 -> 3630 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/pointer.pngbin0 -> 965 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/pointerShadow.pngbin0 -> 1694 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/power.pngbin0 -> 3190 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/quit.pngbin0 -> 1363 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/sensitivity.pngbin0 -> 835 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_a.pngbin0 -> 3233 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_a_on.pngbin0 -> 3068 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_auto.pngbin0 -> 3619 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_auto_on.pngbin0 -> 3281 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_b.pngbin0 -> 3324 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_b_on.pngbin0 -> 3132 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_d.pngbin0 -> 3266 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_d_on.pngbin0 -> 3009 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_e.pngbin0 -> 3171 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_e_on.pngbin0 -> 2955 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_g.pngbin0 -> 3292 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_g_on.pngbin0 -> 3089 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/voicemode_off.pngbin0 -> 3775 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/voicemode_on.pngbin0 -> 3484 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/volume.pngbin0 -> 351 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/volume_off.pngbin0 -> 2235 bytes
-rw-r--r--demos/mobile/guitartuner/src/voiceanalyzer.cpp295
-rw-r--r--demos/mobile/guitartuner/src/voiceanalyzer.h93
-rw-r--r--demos/mobile/guitartuner/src/voicegenerator.cpp246
-rw-r--r--demos/mobile/guitartuner/src/voicegenerator.h86
-rwxr-xr-xdemos/mobile/qcamera/businesscardhandling.cpp148
-rwxr-xr-xdemos/mobile/qcamera/businesscardhandling.h83
-rwxr-xr-xdemos/mobile/qcamera/button.cpp110
-rwxr-xr-xdemos/mobile/qcamera/button.h72
-rwxr-xr-xdemos/mobile/qcamera/cameraexample.cpp517
-rwxr-xr-xdemos/mobile/qcamera/cameraexample.h157
-rwxr-xr-xdemos/mobile/qcamera/contactsdlg.cpp159
-rwxr-xr-xdemos/mobile/qcamera/contactsdlg.h83
-rwxr-xr-xdemos/mobile/qcamera/icons/camera.pngbin0 -> 15868 bytes
-rwxr-xr-xdemos/mobile/qcamera/icons/cameramms_icon.svg255
-rwxr-xr-xdemos/mobile/qcamera/icons/exit.pngbin0 -> 14026 bytes
-rwxr-xr-xdemos/mobile/qcamera/icons/mms.pngbin0 -> 12281 bytes
-rwxr-xr-xdemos/mobile/qcamera/main.cpp127
-rwxr-xr-xdemos/mobile/qcamera/messagehandling.cpp183
-rwxr-xr-xdemos/mobile/qcamera/messagehandling.h92
-rwxr-xr-xdemos/mobile/qcamera/qcamera.pro62
-rw-r--r--demos/mobile/qcamera/qcamera.pro.user582
-rwxr-xr-xdemos/mobile/qcamera/resources.qrc7
-rw-r--r--demos/mobile/qtbubblelevel/accelerometerfilter.cpp85
-rw-r--r--demos/mobile/qtbubblelevel/accelerometerfilter.h69
-rw-r--r--demos/mobile/qtbubblelevel/debian/changelog19
-rw-r--r--demos/mobile/qtbubblelevel/debian/compat1
-rw-r--r--demos/mobile/qtbubblelevel/debian/control12
-rw-r--r--demos/mobile/qtbubblelevel/debian/copyright36
-rw-r--r--demos/mobile/qtbubblelevel/debian/dirs2
-rw-r--r--demos/mobile/qtbubblelevel/debian/files1
-rw-r--r--demos/mobile/qtbubblelevel/debian/postinst5
-rw-r--r--demos/mobile/qtbubblelevel/debian/rules91
-rw-r--r--demos/mobile/qtbubblelevel/icons/26x26/qtbubblelevel.pngbin0 -> 1113 bytes
-rw-r--r--demos/mobile/qtbubblelevel/icons/40x40/qtbubblelevel.pngbin0 -> 2048 bytes
-rw-r--r--demos/mobile/qtbubblelevel/icons/64x64/qtbubblelevel.pngbin0 -> 4154 bytes
-rw-r--r--demos/mobile/qtbubblelevel/icons/bubblelevel.svg264
-rw-r--r--demos/mobile/qtbubblelevel/icons/qtbl_icon.pngbin0 -> 11181 bytes
-rw-r--r--demos/mobile/qtbubblelevel/icons/xpm/qtbubblelevel.xpm1783
-rw-r--r--demos/mobile/qtbubblelevel/main.cpp135
-rw-r--r--demos/mobile/qtbubblelevel/qml/BubbleLevel.qml225
-rw-r--r--demos/mobile/qtbubblelevel/qml/Button.qml71
-rw-r--r--demos/mobile/qtbubblelevel/qml/Tube.qml86
-rw-r--r--demos/mobile/qtbubblelevel/qml/images/board.pngbin0 -> 520721 bytes
-rw-r--r--demos/mobile/qtbubblelevel/qml/images/bubble.pngbin0 -> 4951 bytes
-rw-r--r--demos/mobile/qtbubblelevel/qml/images/calibbutton.pngbin0 -> 4881 bytes
-rw-r--r--demos/mobile/qtbubblelevel/qml/images/exit.pngbin0 -> 2308 bytes
-rw-r--r--demos/mobile/qtbubblelevel/qml/images/reflection.pngbin0 -> 1306 bytes
-rw-r--r--demos/mobile/qtbubblelevel/qml/images/scale.pngbin0 -> 271 bytes
-rw-r--r--demos/mobile/qtbubblelevel/qml/images/signblank.pngbin0 -> 41230 bytes
-rw-r--r--demos/mobile/qtbubblelevel/qml/images/signwithtext.pngbin0 -> 47648 bytes
-rw-r--r--demos/mobile/qtbubblelevel/qml/images/taskswitcher.pngbin0 -> 767 bytes
-rw-r--r--demos/mobile/qtbubblelevel/qtbubblelevel.pro61
-rw-r--r--demos/mobile/qtbubblelevel/resources.qrc16
-rw-r--r--demos/mobile/qtbubblelevel/settings.h66
-rw-r--r--demos/mobile/qtbubblelevel/taskswitcher.cpp61
-rw-r--r--demos/mobile/qtbubblelevel/taskswitcher.h54
-rw-r--r--demos/mobile/quickhit/Button.qml86
-rw-r--r--demos/mobile/quickhit/Game.js180
-rw-r--r--demos/mobile/quickhit/Game.qml439
-rw-r--r--demos/mobile/quickhit/InvSounds.cpp189
-rw-r--r--demos/mobile/quickhit/InvSounds.h91
-rw-r--r--demos/mobile/quickhit/Menu.qml163
-rw-r--r--demos/mobile/quickhit/MenuItem.qml103
-rw-r--r--demos/mobile/quickhit/Message.qml147
-rw-r--r--demos/mobile/quickhit/Missile.qml143
-rw-r--r--demos/mobile/quickhit/MyShip.qml184
-rw-r--r--demos/mobile/quickhit/debian/changelog11
-rw-r--r--demos/mobile/quickhit/debian/compat1
-rw-r--r--demos/mobile/quickhit/debian/control11
-rw-r--r--demos/mobile/quickhit/debian/copyright8
-rw-r--r--demos/mobile/quickhit/debian/dirs2
-rw-r--r--demos/mobile/quickhit/debian/postinst5
-rw-r--r--demos/mobile/quickhit/debian/rules91
-rw-r--r--demos/mobile/quickhit/freesound.org.licence.txt24
-rw-r--r--demos/mobile/quickhit/ga_src/GEAudioBuffer.cpp391
-rw-r--r--demos/mobile/quickhit/ga_src/GEAudioBuffer.h137
-rw-r--r--demos/mobile/quickhit/ga_src/GEAudioOut.cpp144
-rw-r--r--demos/mobile/quickhit/ga_src/GEAudioOut.h89
-rw-r--r--demos/mobile/quickhit/ga_src/GEInterfaces.cpp177
-rw-r--r--demos/mobile/quickhit/ga_src/GEInterfaces.h88
-rw-r--r--demos/mobile/quickhit/gameengine.cpp592
-rw-r--r--demos/mobile/quickhit/gameengine.h148
-rw-r--r--demos/mobile/quickhit/gfx/back.pngbin0 -> 2234 bytes
-rw-r--r--demos/mobile/quickhit/gfx/background2.pngbin0 -> 113110 bytes
-rw-r--r--demos/mobile/quickhit/gfx/bigship.pngbin0 -> 98253 bytes
-rw-r--r--demos/mobile/quickhit/gfx/exit.pngbin0 -> 2810 bytes
-rw-r--r--demos/mobile/quickhit/gfx/pause.pngbin0 -> 1986 bytes
-rw-r--r--demos/mobile/quickhit/gfx/quickhit_logo.pngbin0 -> 8974 bytes
-rw-r--r--demos/mobile/quickhit/gfx/soundOff.pngbin0 -> 3122 bytes
-rw-r--r--demos/mobile/quickhit/gfx/soundOn.pngbin0 -> 2420 bytes
-rw-r--r--demos/mobile/quickhit/icon.svg305
-rw-r--r--demos/mobile/quickhit/main.cpp101
-rw-r--r--demos/mobile/quickhit/mainwindow.cpp248
-rw-r--r--demos/mobile/quickhit/mainwindow.h85
-rw-r--r--demos/mobile/quickhit/myeventfilter.cpp67
-rw-r--r--demos/mobile/quickhit/myeventfilter.h63
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/Level.qml214
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/debian/changelog11
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/debian/compat1
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/debian/control11
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/debian/copyright8
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/debian/dirs2
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/debian/postinst5
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/debian/rules91
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/gfx/background3.pngbin0 -> 113110 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/gfx/enemy1.pngbin0 -> 4508 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/gfx/enemy2.pngbin0 -> 4344 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/gfx/enemy_missile2.pngbin0 -> 452 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/gfx/fire.pngbin0 -> 1036 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/gfx/fire2.pngbin0 -> 2558 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/gfx/missile2.pngbin0 -> 392 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/gfx/red_fire.pngbin0 -> 4737 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/gfx/ship.pngbin0 -> 5408 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/gfx/star3.pngbin0 -> 409 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/gfx/transparent.pngbin0 -> 1000 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/levelone.cpp120
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/levelone.h91
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/levelone.pro100
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/sound/crash.wavbin0 -> 963020 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/sound/levelonestart.wavbin0 -> 500528 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/sound/rocket.wavbin0 -> 41336 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/sound/rocket_explosion.wavbin0 -> 289420 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/debian/changelog11
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/debian/compat1
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/debian/control11
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/debian/copyright8
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/debian/dirs2
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/debian/levelone.tarlist41
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/debian/postinst5
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/debian/rules91
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/gfx/blue_fire.pngbin0 -> 38263 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy1.pngbin0 -> 4508 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy2.pngbin0 -> 4344 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy_missile2.pngbin0 -> 452 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/gfx/missile2.pngbin0 -> 392 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/gfx/ship.pngbin0 -> 5408 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/gfx/transparent.pngbin0 -> 1000 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.cpp126
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.h95
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro103
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/qml/Enemy.qml61
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/qml/Level.js42
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/qml/Level.qml103
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/sound/crash.wavbin0 -> 963020 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/sound/enableship.wavbin0 -> 78380 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/sound/enemy_explosion.wavbin0 -> 219642 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/sound/laser.wavbin0 -> 46764 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/sound/level2.wavbin0 -> 84034 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/sound/myship_explosion.wavbin0 -> 120474 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/sound/rocket.wavbin0 -> 41336 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/sound/rocket_explosion.wavbin0 -> 289420 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/debian/changelog11
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/debian/compat1
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/debian/control11
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/debian/copyright8
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/debian/dirs2
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/debian/levelone.tarlist41
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/debian/postinst5
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/debian/rules91
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/background2.pngbin0 -> 149307 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/background_loop.pngbin0 -> 163319 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/blue_fire.pngbin0 -> 38263 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/enemy1.pngbin0 -> 4508 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/enemy_missile2.pngbin0 -> 370 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/fire.pngbin0 -> 1036 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/fire2.pngbin0 -> 2558 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/missile.pngbin0 -> 289 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/missile2.pngbin0 -> 392 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/ship.pngbin0 -> 5408 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/star3.pngbin0 -> 1288 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/transparent.pngbin0 -> 1000 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/leveltwo.cpp122
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/leveltwo.h91
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro108
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/qml/Enemy.qml84
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/qml/Level.js42
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/qml/Level.qml228
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/sound/crash.wavbin0 -> 963020 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/sound/enableship.wavbin0 -> 78380 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/sound/enemy_explosion.wavbin0 -> 219642 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/sound/laser.wavbin0 -> 46764 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/sound/level2.wavbin0 -> 84034 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/sound/myship_explosion.wavbin0 -> 120474 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/sound/rocket.wavbin0 -> 41336 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/sound/rocket_explosion.wavbin0 -> 289420 bytes
-rw-r--r--demos/mobile/quickhit/plugins/levelplugininterface.h86
-rw-r--r--demos/mobile/quickhit/quickhit.pngbin0 -> 4511 bytes
-rw-r--r--demos/mobile/quickhit/quickhit.pro91
-rw-r--r--demos/mobile/quickhit/resources.qrc25
-rw-r--r--demos/mobile/quickhit/sound/gameover.wavbin0 -> 46868 bytes
-rw-r--r--demos/mobile/quickhit/sound/gamestart.wavbin0 -> 573486 bytes
-rw-r--r--demos/mobile/quickhit/sound/menu1.wavbin0 -> 22444 bytes
-rw-r--r--demos/mobile/quickhit/sound/menu2.wavbin0 -> 25644 bytes
-rw-r--r--demos/mobile/quickhit/sound/youwin.wavbin0 -> 458554 bytes
-rw-r--r--dist/changes-4.7.30
-rw-r--r--dist/changes-4.7.431
-rw-r--r--doc/doc.pri4
-rw-r--r--doc/src/declarative/declarativeui.qdoc2
-rw-r--r--doc/src/declarative/dynamicobjects.qdoc14
-rw-r--r--doc/src/declarative/elements.qdoc1
-rw-r--r--doc/src/declarative/examples.qdoc12
-rw-r--r--doc/src/declarative/pics/layoutmirroring.pngbin0 -> 2542 bytes
-rw-r--r--doc/src/declarative/qdeclarativeperformance.qdoc11
-rw-r--r--doc/src/declarative/qmlinuse.qdoc2
-rw-r--r--doc/src/declarative/righttoleft.qdoc195
-rw-r--r--doc/src/declarative/whatsnew.qdoc99
-rw-r--r--doc/src/demos/guitartuner.qdoc44
-rw-r--r--doc/src/demos/mobiledemos.qdoc39
-rw-r--r--doc/src/demos/qcamera.qdoc68
-rw-r--r--doc/src/demos/qml-qtbubblelevel.qdoc107
-rw-r--r--doc/src/development/qmake-manual.qdoc3
-rw-r--r--doc/src/examples/qml-examples.qdoc54
-rw-r--r--doc/src/frameworks-technologies/accessible.qdoc57
-rw-r--r--doc/src/getting-started/demos.qdoc25
-rw-r--r--doc/src/howtos/developmentsteps.qdoc6
-rw-r--r--doc/src/images/qcameraexample.pngbin0 -> 27135 bytes
-rw-r--r--doc/src/images/qml-guitartuner-example.pngbin0 -> 46135 bytes
-rw-r--r--doc/src/images/qml-qtbubblelevel-demo.pngbin0 -> 72591 bytes
-rw-r--r--doc/src/images/qml-righttoleft-layoutdirection-example.pngbin0 -> 23327 bytes
-rw-r--r--doc/src/images/qml-righttoleft-layoutmirroring-example.pngbin0 -> 38982 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_arcTo.pngbin0 -> 8917 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_arcTo2.pngbin0 -> 6532 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_clip-complex.pngbin0 -> 70000 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_clip.pngbin0 -> 27933 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_clip_aqu.pngbin0 -> 114102 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_closepath.gifbin0 -> 1786 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_composite.pngbin0 -> 41457 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_context.gifbin0 -> 4473 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_lineStrokeTo.gifbin0 -> 1400 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_linecap.pngbin0 -> 1601 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_math.pngbin0 -> 1961 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_math_rotate.pngbin0 -> 3206 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_pattern.pngbin0 -> 6896 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_rectangles.gifbin0 -> 3496 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_rotate.pngbin0 -> 8238 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_scale.pngbin0 -> 4988 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_scalex.pngbin0 -> 1023 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_scaley.pngbin0 -> 1080 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_skewx.pngbin0 -> 1857 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_skewy.pngbin0 -> 2654 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_startAngle.pngbin0 -> 10254 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_text.pngbin0 -> 8095 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_translate.pngbin0 -> 1269 bytes
-rw-r--r--doc/src/images/webkit-guide/canvas_translatey.pngbin0 -> 1666 bytes
-rw-r--r--doc/src/images/webkit-guide/mask0.pngbin0 -> 5842 bytes
-rw-r--r--doc/src/images/webkit-guide/mask1.pngbin0 -> 76460 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_anim_accord.pngbin0 -> 26980 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_anim_demo-rotate.pngbin0 -> 16357 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_anim_demo-scale.pngbin0 -> 2686 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_anim_demo-skew.pngbin0 -> 11635 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_anim_gallery.pngbin0 -> 51798 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_anim_panel.pngbin0 -> 5640 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_anim_pulse.pngbin0 -> 11887 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_anim_skew.pngbin0 -> 29181 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_anim_slide1.pngbin0 -> 11965 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_anim_tabbedSkew.pngbin0 -> 11722 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_css3_backgrounds.pngbin0 -> 9719 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_css3_border-img.pngbin0 -> 31413 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_css3_grad-radial.pngbin0 -> 12008 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_css3_gradientBack.pngbin0 -> 12192 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_css3_gradientBackStop.pngbin0 -> 9078 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_css3_gradientButton.pngbin0 -> 10291 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_css3_mask-grad.pngbin0 -> 94781 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_css3_mask-img.pngbin0 -> 60911 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_css3_multicol.pngbin0 -> 10574 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_css3_reflect.pngbin0 -> 100120 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_css3_scroll.pngbin0 -> 20209 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_css3_sel-nth.pngbin0 -> 25509 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_css3_text-overflow.pngbin0 -> 14994 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_css3_text-shadow.pngbin0 -> 17357 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_css3_text-stroke.pngbin0 -> 13330 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_form_tapper.pngbin0 -> 13604 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_form_toggler.pngbin0 -> 10095 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_layout_link-fmt.pngbin0 -> 20323 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_layout_tbl-keyhole.pngbin0 -> 14996 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_mob_condjs.pngbin0 -> 11465 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_mob_layout.pngbin0 -> 6679 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_mob_mediaquery.pngbin0 -> 7448 bytes
-rw-r--r--doc/src/images/webkit-guide/scr_storage.pngbin0 -> 6673 bytes
-rw-r--r--doc/src/index.qdoc91
-rw-r--r--doc/src/mainpage.qdoc52
-rw-r--r--doc/src/qt-webpages.qdoc143
-rw-r--r--doc/src/snippets/accessibilityfactorysnippet.cpp5
-rw-r--r--doc/src/snippets/accessibilitypluginsnippet.cpp6
-rw-r--r--doc/src/snippets/code/doc_src_installation.qdoc4
-rw-r--r--doc/src/snippets/declarative/arrow.pngbin0 -> 454 bytes
-rw-r--r--doc/src/snippets/declarative/componentCreation.js7
-rw-r--r--doc/src/snippets/declarative/layoutmirroring.qml71
-rw-r--r--doc/src/snippets/declarative/righttoleft.qml149
-rw-r--r--doc/src/snippets/declarative/righttoleft/Child.qml51
-rw-r--r--doc/src/snippets/declarative/states/statechangescript.qml1
-rw-r--r--doc/src/webkit/guide/chapter_cache.qdoc511
-rw-r--r--doc/src/webkit/guide/chapter_canvas.qdoc1016
-rw-r--r--doc/src/webkit/guide/chapter_css.qdoc1519
-rw-r--r--doc/src/webkit/guide/guidelinks.qdoc488
-rw-r--r--doc/src/webkit/webkit.qdoc103
-rw-r--r--examples/declarative/positioners/Button.qml (renamed from examples/declarative/positioners/addandremove/Button.qml)0
-rw-r--r--examples/declarative/positioners/add.png (renamed from examples/declarative/positioners/addandremove/add.png)bin810 -> 810 bytes
-rw-r--r--examples/declarative/positioners/del.png (renamed from examples/declarative/positioners/addandremove/del.png)bin488 -> 488 bytes
-rw-r--r--examples/declarative/positioners/layoutdirection/layoutdirection.qml151
-rw-r--r--examples/declarative/positioners/positioners.qml (renamed from examples/declarative/positioners/addandremove/addandremove.qml)0
-rw-r--r--examples/declarative/positioners/positioners.qmlproject (renamed from examples/declarative/positioners/layoutdirection/layoutdirection.qmlproject)0
-rw-r--r--examples/declarative/righttoleft/layoutdirection/layoutdirection.qml246
-rw-r--r--examples/declarative/righttoleft/layoutdirection/layoutdirection.qmlproject (renamed from examples/declarative/positioners/addandremove/addandremove.qmlproject)0
-rw-r--r--examples/declarative/righttoleft/layoutmirroring/layoutmirroring.qml313
-rw-r--r--examples/declarative/righttoleft/layoutmirroring/layoutmirroring.qmlproject18
-rw-r--r--examples/declarative/righttoleft/textalignment/textalignment.qml426
-rw-r--r--examples/declarative/righttoleft/textalignment/textalignment.qmlproject18
-rw-r--r--examples/declarative/touchinteraction/pincharea/flickresize.qml11
-rw-r--r--examples/phonon/phonon.pro3
-rw-r--r--examples/webkit/webkit-guide/_copyright.txt40
-rw-r--r--examples/webkit/webkit-guide/_image_assets.htm331
-rw-r--r--examples/webkit/webkit-guide/_index.html322
-rw-r--r--examples/webkit/webkit-guide/anim_accord.htm122
-rw-r--r--examples/webkit/webkit-guide/anim_demo-rotate.htm63
-rw-r--r--examples/webkit/webkit-guide/anim_demo-scale.htm67
-rw-r--r--examples/webkit/webkit-guide/anim_demo-skew.htm62
-rw-r--r--examples/webkit/webkit-guide/anim_gallery.htm114
-rw-r--r--examples/webkit/webkit-guide/anim_panel.htm63
-rw-r--r--examples/webkit/webkit-guide/anim_pulse.htm71
-rw-r--r--examples/webkit/webkit-guide/anim_skew.htm80
-rw-r--r--examples/webkit/webkit-guide/anim_slide1.htm61
-rw-r--r--examples/webkit/webkit-guide/anim_slide2.htm62
-rw-r--r--examples/webkit/webkit-guide/anim_slide3.htm65
-rw-r--r--examples/webkit/webkit-guide/anim_tabbedSkew.htm88
-rwxr-xr-xexamples/webkit/webkit-guide/css/anim_accord.css246
-rwxr-xr-xexamples/webkit/webkit-guide/css/anim_demo-rotate.css95
-rwxr-xr-xexamples/webkit/webkit-guide/css/anim_demo-scale.css112
-rwxr-xr-xexamples/webkit/webkit-guide/css/anim_demo-skew.css98
-rwxr-xr-xexamples/webkit/webkit-guide/css/anim_gallery.css110
-rwxr-xr-xexamples/webkit/webkit-guide/css/anim_panel.css116
-rwxr-xr-xexamples/webkit/webkit-guide/css/anim_pulse.css100
-rwxr-xr-xexamples/webkit/webkit-guide/css/anim_skew.css186
-rwxr-xr-xexamples/webkit/webkit-guide/css/anim_slide.css148
-rwxr-xr-xexamples/webkit/webkit-guide/css/anim_tabbedSkew.css113
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_backgrounds.css105
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_border-img.css70
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_grad-radial.css66
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_gradientBack.css77
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_gradientBackStop.css77
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_gradientButton.css88
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_mask-grad.css60
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_mask-img.css58
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_multicol.css110
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_reflect.css127
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_scroll.css93
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_sel-nth.css63
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_shadow.css145
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_shadowBlur.css145
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_text-overflow.css119
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_text-shadow.css67
-rwxr-xr-xexamples/webkit/webkit-guide/css/css3_text-stroke.css75
-rwxr-xr-xexamples/webkit/webkit-guide/css/form_tapper.css108
-rwxr-xr-xexamples/webkit/webkit-guide/css/form_toggler.css200
-rwxr-xr-xexamples/webkit/webkit-guide/css/layout_link-fmt.css137
-rwxr-xr-xexamples/webkit/webkit-guide/css/layout_tbl-keyhole.css147
-rwxr-xr-xexamples/webkit/webkit-guide/css/mob_condjs.css55
-rwxr-xr-xexamples/webkit/webkit-guide/css/mob_mediaquery.css49
-rwxr-xr-xexamples/webkit/webkit-guide/css/mobile.css82
-rwxr-xr-xexamples/webkit/webkit-guide/css/mq_desktop.css70
-rwxr-xr-xexamples/webkit/webkit-guide/css/mq_mobile.css69
-rwxr-xr-xexamples/webkit/webkit-guide/css/mq_touch.css69
-rwxr-xr-xexamples/webkit/webkit-guide/css/mqlayout_desktop.css92
-rwxr-xr-xexamples/webkit/webkit-guide/css/mqlayout_mobile.css82
-rwxr-xr-xexamples/webkit/webkit-guide/css/mqlayout_touch.css86
-rwxr-xr-xexamples/webkit/webkit-guide/css/storage.css156
-rw-r--r--examples/webkit/webkit-guide/css3_backgrounds.htm87
-rw-r--r--examples/webkit/webkit-guide/css3_border-img.htm78
-rw-r--r--examples/webkit/webkit-guide/css3_grad-radial.htm61
-rw-r--r--examples/webkit/webkit-guide/css3_gradientBack.htm79
-rw-r--r--examples/webkit/webkit-guide/css3_gradientBackStop.htm92
-rw-r--r--examples/webkit/webkit-guide/css3_gradientButton.htm66
-rw-r--r--examples/webkit/webkit-guide/css3_mask-grad.htm66
-rw-r--r--examples/webkit/webkit-guide/css3_mask-img.htm56
-rw-r--r--examples/webkit/webkit-guide/css3_multicol.htm91
-rw-r--r--examples/webkit/webkit-guide/css3_reflect.htm100
-rw-r--r--examples/webkit/webkit-guide/css3_scroll.htm94
-rw-r--r--examples/webkit/webkit-guide/css3_sel-nth.htm80
-rw-r--r--examples/webkit/webkit-guide/css3_shadow.htm78
-rw-r--r--examples/webkit/webkit-guide/css3_text-overflow.htm117
-rw-r--r--examples/webkit/webkit-guide/css3_text-shadow.htm74
-rw-r--r--examples/webkit/webkit-guide/css3_text-stroke.htm74
-rw-r--r--examples/webkit/webkit-guide/form_tapper.htm74
-rw-r--r--examples/webkit/webkit-guide/form_toggler.htm140
-rwxr-xr-xexamples/webkit/webkit-guide/img/border-frame.pngbin0 -> 5534 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal1.jpgbin0 -> 44584 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal2.jpgbin0 -> 45495 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal3.jpgbin0 -> 51291 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal4.jpgbin0 -> 57195 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal5.jpgbin0 -> 31293 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal6.jpgbin0 -> 30854 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal7.jpgbin0 -> 35211 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal8.jpgbin0 -> 35269 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/gradient.jpgbin0 -> 710 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/gray_icon_close.pngbin0 -> 658 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ag_016.pngbin0 -> 598 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ag_032.pngbin0 -> 1275 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ag_036.pngbin0 -> 1803 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ag_048.pngbin0 -> 1885 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_al_016.pngbin0 -> 625 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_al_032.pngbin0 -> 1259 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_al_036.pngbin0 -> 1755 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_al_048.pngbin0 -> 1795 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ar_016.pngbin0 -> 608 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ar_032.pngbin0 -> 1233 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ar_036.pngbin0 -> 1777 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ar_048.pngbin0 -> 1828 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_b_016.pngbin0 -> 580 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_b_032.pngbin0 -> 1166 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_b_036.pngbin0 -> 1668 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_b_048.pngbin0 -> 1623 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_be_016.pngbin0 -> 614 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_be_032.pngbin0 -> 1322 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_be_036.pngbin0 -> 1811 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_be_048.pngbin0 -> 1824 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_c_016.pngbin0 -> 545 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_c_032.pngbin0 -> 1102 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_c_036.pngbin0 -> 1595 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_c_048.pngbin0 -> 1622 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ca_016.pngbin0 -> 606 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ca_032.pngbin0 -> 1229 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ca_036.pngbin0 -> 1771 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ca_048.pngbin0 -> 1820 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_cl_016.pngbin0 -> 602 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_cl_032.pngbin0 -> 1197 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_cl_036.pngbin0 -> 1731 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_cl_048.pngbin0 -> 1816 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_cu_016.pngbin0 -> 580 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_cu_032.pngbin0 -> 1183 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_cu_036.pngbin0 -> 1742 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_cu_048.pngbin0 -> 1729 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_f_016.pngbin0 -> 539 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_f_032.pngbin0 -> 1047 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_f_036.pngbin0 -> 1487 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_f_048.pngbin0 -> 1488 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_fe_016.pngbin0 -> 591 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_fe_032.pngbin0 -> 1171 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_fe_036.pngbin0 -> 1726 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_fe_048.pngbin0 -> 1745 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_h_016.pngbin0 -> 583 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_h_032.pngbin0 -> 1135 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_h_036.pngbin0 -> 1600 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_h_048.pngbin0 -> 1644 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_he_016.pngbin0 -> 606 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_he_032.pngbin0 -> 1179 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_he_036.pngbin0 -> 1746 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_he_048.pngbin0 -> 1675 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_k_016.pngbin0 -> 600 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_k_032.pngbin0 -> 1189 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_k_036.pngbin0 -> 1657 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_k_048.pngbin0 -> 1706 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_li_016.pngbin0 -> 584 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_li_032.pngbin0 -> 1125 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_li_036.pngbin0 -> 1596 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_li_048.pngbin0 -> 1691 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_mg_016.pngbin0 -> 628 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_mg_032.pngbin0 -> 1286 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_mg_036.pngbin0 -> 1832 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_mg_048.pngbin0 -> 1908 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_n_016.pngbin0 -> 605 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_n_032.pngbin0 -> 1203 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_n_036.pngbin0 -> 1728 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_n_048.pngbin0 -> 1718 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_na_016.pngbin0 -> 609 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_na_032.pngbin0 -> 1302 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_na_036.pngbin0 -> 1811 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_na_048.pngbin0 -> 1879 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ne_016.pngbin0 -> 619 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ne_032.pngbin0 -> 1278 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ne_036.pngbin0 -> 1798 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ne_048.pngbin0 -> 1811 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ni_016.pngbin0 -> 627 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ni_032.pngbin0 -> 1248 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ni_036.pngbin0 -> 1805 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_ni_048.pngbin0 -> 1837 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_o_016.pngbin0 -> 580 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_o_032.pngbin0 -> 1182 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_o_036.pngbin0 -> 1668 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_o_048.pngbin0 -> 1752 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_pt_016.pngbin0 -> 600 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_pt_032.pngbin0 -> 1212 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_pt_036.pngbin0 -> 1728 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_pt_048.pngbin0 -> 1675 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_si_016.pngbin0 -> 588 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_si_032.pngbin0 -> 1198 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_si_036.pngbin0 -> 1761 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_si_048.pngbin0 -> 1820 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_zn_016.pngbin0 -> 572 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_zn_032.pngbin0 -> 1164 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_zn_036.pngbin0 -> 1689 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/ic_zn_048.pngbin0 -> 1721 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_check.pngbin0 -> 678 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_check_x24green.pngbin0 -> 776 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_dismiss.pngbin0 -> 613 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_dismiss_x22.pngbin0 -> 539 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_drill-down.pngbin0 -> 605 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_drill-down_x32.pngbin0 -> 3593 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_drill-up.pngbin0 -> 592 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_drill-up_x32.pngbin0 -> 3685 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_expand-nav.pngbin0 -> 675 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_head-collapsed.pngbin0 -> 285 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_head-collapsed_x13.pngbin0 -> 201 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_head-expanded.pngbin0 -> 295 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_head-expanded_x13.pngbin0 -> 3017 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_info.pngbin0 -> 512 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_info_x24.pngbin0 -> 652 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_link-doc.pngbin0 -> 610 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_link-email.pngbin0 -> 542 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_link-external.pngbin0 -> 1106 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_link-pdf.pngbin0 -> 637 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_link-ppt.pngbin0 -> 536 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_link-rss.pngbin0 -> 684 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_link-sms.pngbin0 -> 1086 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_link-tel.pngbin0 -> 1205 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_link-xls.pngbin0 -> 603 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_list-all.pngbin0 -> 545 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_list-all_circ.pngbin0 -> 665 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_nav-start.pngbin0 -> 594 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_nav-top.pngbin0 -> 634 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_nav-up.pngbin0 -> 551 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_nav_end.pngbin0 -> 643 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_question.pngbin0 -> 802 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_scroll-left.pngbin0 -> 660 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_scroll-right.pngbin0 -> 682 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/icon_trash.pngbin0 -> 717 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land1.jpgbin0 -> 40695 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land2.jpgbin0 -> 38387 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land3.jpgbin0 -> 27180 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land4.jpgbin0 -> 45132 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land5.jpgbin0 -> 85110 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land6.jpgbin0 -> 38369 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land7.jpgbin0 -> 38923 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land8.jpgbin0 -> 54475 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/img/mask.pngbin0 -> 5842 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal1.jpgbin0 -> 44584 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal2.jpgbin0 -> 45495 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal3.jpgbin0 -> 51291 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal4.jpgbin0 -> 57195 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal5.jpgbin0 -> 31293 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal6.jpgbin0 -> 30854 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal7.jpgbin0 -> 35211 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal8.jpgbin0 -> 35269 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land1.jpgbin0 -> 40695 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land2.jpgbin0 -> 38387 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land3.jpgbin0 -> 27180 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land4.jpgbin0 -> 45132 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land5.jpgbin0 -> 85110 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land6.jpgbin0 -> 38369 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land7.jpgbin0 -> 38923 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land8.jpgbin0 -> 54475 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal1.pngbin0 -> 16437 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal2.pngbin0 -> 14736 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal3.pngbin0 -> 15882 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal4.pngbin0 -> 18863 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal5.pngbin0 -> 15854 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal6.pngbin0 -> 17339 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal7.pngbin0 -> 17102 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal8.pngbin0 -> 17933 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/js/anim_accord.js78
-rwxr-xr-xexamples/webkit/webkit-guide/js/anim_gallery.js79
-rwxr-xr-xexamples/webkit/webkit-guide/js/anim_panel.js53
-rwxr-xr-xexamples/webkit/webkit-guide/js/anim_skew.js97
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_backgrounds.js49
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_border-img.js44
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_grad-radial.js75
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_mask-grad.js44
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_mask-img.js44
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_text-overflow.js54
-rwxr-xr-xexamples/webkit/webkit-guide/js/form_tapper.js57
-rwxr-xr-xexamples/webkit/webkit-guide/js/mob_condjs.js79
-rwxr-xr-xexamples/webkit/webkit-guide/js/mobile.js50
-rwxr-xr-xexamples/webkit/webkit-guide/js/storage.js94
-rw-r--r--examples/webkit/webkit-guide/layout_link-fmt.htm81
-rw-r--r--examples/webkit/webkit-guide/layout_tbl-keyhole.htm141
-rw-r--r--examples/webkit/webkit-guide/mob_condjs.htm65
-rw-r--r--examples/webkit/webkit-guide/mob_layout.htm59
-rw-r--r--examples/webkit/webkit-guide/mob_mediaquery.htm59
-rw-r--r--examples/webkit/webkit-guide/storage.htm71
-rw-r--r--examples/webkit/webkit-guide/webkit-guide.pro257
-rw-r--r--examples/webkit/webkit.pro2
-rw-r--r--mkspecs/common/armcc.conf1
-rw-r--r--mkspecs/common/symbian/symbian-makefile.conf20
-rw-r--r--mkspecs/common/symbian/symbian.conf40
-rw-r--r--mkspecs/common/symbian/symbianincludes.h58
-rw-r--r--mkspecs/features/symbian/def_files.prf18
-rw-r--r--mkspecs/features/symbian/default_post.prf32
-rw-r--r--mkspecs/features/symbian/do_not_build_as_thumb.prf2
-rw-r--r--mkspecs/features/symbian/localize_deployment.prf9
-rw-r--r--mkspecs/features/symbian/prepend_includepath.prf14
-rw-r--r--mkspecs/features/symbian/qt.prf47
-rw-r--r--mkspecs/features/symbian/qt_config.prf2
-rw-r--r--mkspecs/features/symbian/symbian_building.prf190
-rw-r--r--mkspecs/symbian-armcc/features/default_post.prf (renamed from mkspecs/symbian/linux-gcce/features/default_post.prf)0
-rw-r--r--mkspecs/symbian-armcc/qmake.conf (renamed from mkspecs/symbian/linux-armcc/qmake.conf)11
-rw-r--r--mkspecs/symbian-armcc/qplatformdefs.h (renamed from mkspecs/symbian/linux-armcc/qplatformdefs.h)2
-rw-r--r--mkspecs/symbian-gcce/features/default_post.prf (renamed from mkspecs/symbian/linux-armcc/features/default_post.prf)0
-rw-r--r--mkspecs/symbian-gcce/qmake.conf (renamed from mkspecs/symbian/linux-gcce/qmake.conf)42
-rw-r--r--mkspecs/symbian-gcce/qplatformdefs.h (renamed from mkspecs/symbian/linux-gcce/qplatformdefs.h)2
-rw-r--r--mkspecs/symbian-sbsv2/flm/qt/qmake_clean.flm2
-rw-r--r--mkspecs/win32-g++/qmake.conf2
-rw-r--r--qmake/generators/metamakefile.cpp4
-rw-r--r--qmake/generators/symbian/symbiancommon.cpp3
-rw-r--r--qmake/generators/symbian/symmake_sbsv2.cpp5
-rw-r--r--qmake/generators/win32/mingw_make.cpp80
-rw-r--r--qmake/generators/win32/mingw_make.h4
-rw-r--r--qmake/generators/win32/winmakefile.cpp44
-rw-r--r--qmake/project.cpp1
-rw-r--r--src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri4
-rw-r--r--src/corelib/global/global.pri2
-rw-r--r--src/corelib/global/qglobal.cpp2
-rw-r--r--src/corelib/global/qglobal.h9
-rw-r--r--src/corelib/global/qnamespace.h3
-rw-r--r--src/corelib/global/qnamespace.qdoc4
-rw-r--r--src/corelib/thread/qthread_unix.cpp27
-rw-r--r--src/declarative/debugger/qdeclarativedebugservice_p.h2
-rw-r--r--src/declarative/declarative.pro2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanchors.cpp97
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanchors_p.h5
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanchors_p_p.h1
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp25
-rw-r--r--src/declarative/graphicsitems/qdeclarativeborderimage.cpp23
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp96
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable_p_p.h7
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp605
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview_p.h15
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage.cpp17
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimagebase.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp209
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem_p.h54
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp1
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp516
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview_p.h14
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativepincharea.cpp17
-rw-r--r--src/declarative/graphicsitems/qdeclarativepincharea_p_p.h5
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners.cpp142
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners_p.h15
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners_p_p.h30
-rw-r--r--src/declarative/graphicsitems/qdeclarativerectangle.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp280
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext_p.h6
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext_p_p.h10
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp173
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit_p.h11
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit_p_p.h9
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp259
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p.h18
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p_p.h26
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextlayout.cpp11
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp26
-rw-r--r--src/declarative/qml/qdeclarativescriptparser.cpp7
-rw-r--r--src/declarative/qml/qdeclarativetypenamescriptclass.cpp2
-rw-r--r--src/declarative/qml/qdeclarativevme.cpp63
-rw-r--r--src/declarative/qml/qdeclarativeworkerscript.cpp2
-rw-r--r--src/declarative/util/qdeclarativeopenmetaobject.cpp14
-rw-r--r--src/declarative/util/qdeclarativepropertymap.cpp15
-rw-r--r--src/declarative/util/qdeclarativeview.cpp7
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp12
-rw-r--r--src/gui/graphicsview/qgraphicsitem.h3
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h6
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp28
-rw-r--r--src/gui/graphicsview/qgraphicsscene_p.h1
-rw-r--r--src/gui/image/image.pri15
-rw-r--r--src/gui/image/qimagereader.cpp3
-rw-r--r--src/gui/image/qimagewriter.cpp3
-rw-r--r--src/gui/image/qnativeimagehandleprovider_p.h69
-rw-r--r--src/gui/image/qpixmap.cpp2
-rw-r--r--src/gui/image/qpixmap_raster.cpp3
-rw-r--r--src/gui/image/qpixmap_s60.cpp31
-rw-r--r--src/gui/image/qpixmapdata_p.h4
-rw-r--r--src/gui/image/qvolatileimage.cpp318
-rw-r--r--src/gui/image/qvolatileimage_p.h101
-rw-r--r--src/gui/image/qvolatileimagedata.cpp113
-rw-r--r--src/gui/image/qvolatileimagedata_p.h97
-rw-r--r--src/gui/image/qvolatileimagedata_symbian.cpp474
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_p.h11
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp251
-rw-r--r--src/gui/kernel/qapplication_p.h2
-rw-r--r--src/gui/kernel/qapplication_s60.cpp124
-rw-r--r--src/gui/kernel/qclipboard_win.cpp15
-rw-r--r--src/gui/kernel/qdesktopwidget_s60.cpp164
-rw-r--r--src/gui/kernel/qt_s60_p.h89
-rw-r--r--src/gui/kernel/qwidget.cpp11
-rw-r--r--src/gui/kernel/qwidget_p.h6
-rw-r--r--src/gui/kernel/qwidget_s60.cpp57
-rw-r--r--src/gui/math3d/qvector2d.cpp5
-rw-r--r--src/gui/math3d/qvector3d.cpp5
-rw-r--r--src/gui/math3d/qvector4d.cpp5
-rw-r--r--src/gui/painting/qbackingstore.cpp5
-rw-r--r--src/gui/painting/qgraphicssystem.cpp5
-rw-r--r--src/gui/painting/qgraphicssystem_p.h2
-rw-r--r--src/gui/painting/qgraphicssystem_runtime.cpp5
-rw-r--r--src/gui/painting/qpaintengine_s60.cpp21
-rw-r--r--src/gui/painting/qpainterpath.cpp8
-rw-r--r--src/gui/painting/qwindowsurface_s60.cpp28
-rw-r--r--src/gui/styles/qs60style.cpp58
-rw-r--r--src/gui/styles/qs60style_p.h12
-rw-r--r--src/gui/styles/qs60style_s60.cpp62
-rw-r--r--src/gui/styles/qs60style_simulated.cpp2
-rw-r--r--src/gui/text/qfontengine_mac.mm15
-rw-r--r--src/gui/text/qtextcontrol.cpp19
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp2
-rw-r--r--src/gui/text/qtextengine_mac.cpp5
-rw-r--r--src/gui/text/qtextlayout.cpp47
-rw-r--r--src/gui/text/qtextobject.cpp2
-rw-r--r--src/gui/widgets/qlinecontrol.cpp8
-rw-r--r--src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp2
-rw-r--r--src/imports/gestures/qdeclarativegesturearea.cpp4
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp15
-rw-r--r--src/network/access/qnetworkaccesshttpbackend.cpp5
-rw-r--r--src/network/access/qnetworkcookie.cpp21
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp7
-rw-r--r--src/network/bearer/qsharednetworksession.cpp2
-rw-r--r--src/network/kernel/qnetworkinterface_symbian.cpp2
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp13
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp28
-rw-r--r--src/opengl/opengl.pro9
-rw-r--r--src/opengl/qgl.cpp19
-rw-r--r--src/opengl/qgl.h1
-rw-r--r--src/opengl/qgl_egl.cpp27
-rw-r--r--src/opengl/qgl_symbian.cpp141
-rw-r--r--src/opengl/qgltexturepool.cpp241
-rw-r--r--src/opengl/qgltexturepool_p.h147
-rw-r--r--src/opengl/qgraphicssystem_gl.cpp23
-rw-r--r--src/opengl/qgraphicssystem_gl_p.h4
-rw-r--r--src/opengl/qpixmapdata_gl_p.h51
-rw-r--r--src/opengl/qpixmapdata_poolgl.cpp921
-rw-r--r--src/opengl/qwindowsurface_gl.cpp81
-rw-r--r--src/openvg/qpaintengine_vg.cpp26
-rw-r--r--src/openvg/qpaintengine_vg_p.h2
-rw-r--r--src/openvg/qpixmapdata_vg.cpp177
-rw-r--r--src/openvg/qpixmapdata_vg_p.h26
-rw-r--r--src/openvg/qvg_symbian.cpp180
-rw-r--r--src/openvg/qvgfontglyphcache_p.h2
-rw-r--r--src/openvg/qvgimagepool.cpp15
-rw-r--r--src/openvg/qwindowsurface_vgegl.cpp5
-rw-r--r--src/plugins/bearer/symbian/symbianengine.cpp12
-rw-r--r--src/plugins/graphicssystems/meego/qmeegographicssystem.cpp223
-rw-r--r--src/plugins/graphicssystems/meego/qmeegographicssystem.h23
-rw-r--r--src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp23
-rw-r--r--src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h7
-rw-r--r--src/plugins/graphicssystems/openvg/qgraphicssystem_vg.cpp18
-rw-r--r--src/plugins/graphicssystems/openvg/qgraphicssystem_vg_p.h2
-rw-r--r--src/plugins/qpluginbase.pri2
-rw-r--r--src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri16
-rw-r--r--src/qbase.pri2
-rw-r--r--src/s60installs/bwins/QtDeclarativeu.def53
-rw-r--r--src/s60installs/bwins/QtGuiu.def29
-rw-r--r--src/s60installs/bwins/QtOpenGLu.def8
-rw-r--r--src/s60installs/bwins/QtOpenVGu.def7
-rw-r--r--src/s60installs/eabi/QtDeclarativeu.def47
-rw-r--r--src/s60installs/eabi/QtGuiu.def35
-rw-r--r--src/s60installs/eabi/QtOpenGLu.def7
-rw-r--r--src/s60installs/eabi/QtOpenVGu.def7
-rw-r--r--src/s60installs/s60installs.pro2
-rw-r--r--src/s60main/s60main.pro2
-rw-r--r--src/src.pro2
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/data/fill.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/data/margins.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp211
-rw-r--r--tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp49
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/writeAttachedProperty.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp30
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/data/disabledcontent.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp43
-rw-r--r--tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp34
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml4
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/gridview1.qml5
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/mirroring.qml43
-rw-r--r--tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp430
-rw-r--r--tests/auto/declarative/qdeclarativeimage/data/qtbug_16389.qml30
-rw-r--r--tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp24
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/layoutmirroring.qml54
-rw-r--r--tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp267
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType2.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/inlineAssignmentsOverrideBindings.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp12
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/headerfooter.qml26
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml3
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/rightToLeft.qml42
-rw-r--r--tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp281
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/dragpath.qml2
-rw-r--r--tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp40
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/grid-righttoleft.qml41
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml6
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml1
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp78
-rw-r--r--tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp34
-rw-r--r--tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp122
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/qtbug_14734.qml10
-rw-r--r--tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp124
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_words.qml7
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_words.qml7
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/navigation.qml1
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/positionAt.qml9
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp346
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp445
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/Global.js1
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/script_include.js5
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/worker_include.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp19
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.0.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.1.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.10.pngbin0 -> 647 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.11.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.12.pngbin0 -> 636 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.2.pngbin0 -> 636 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.3.pngbin0 -> 647 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.4.pngbin0 -> 641 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.5.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.6.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.7.pngbin0 -> 636 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.8.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.9.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.qml1499
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/reanchor.qml69
-rw-r--r--tests/auto/gui.pro1
-rw-r--r--tests/auto/mediaobject/dummy/dummy.pro2
-rw-r--r--tests/auto/nativeimagehandleprovider/nativeimagehandleprovider.pro6
-rw-r--r--tests/auto/nativeimagehandleprovider/tst_nativeimagehandleprovider.cpp237
-rw-r--r--tests/auto/other.pro3
-rw-r--r--tests/auto/qdesktopwidget/tst_qdesktopwidget.cpp5
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp69
-rw-r--r--tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp31
-rw-r--r--tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp14
-rw-r--r--tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp24
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp191
-rw-r--r--tests/auto/qpainterpath/tst_qpainterpath.cpp5
-rw-r--r--tests/auto/qpixmap/qpixmap.pro1
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp121
-rw-r--r--tests/auto/qtextblock/tst_qtextblock.cpp7
-rw-r--r--tests/auto/qtextlayout/tst_qtextlayout.cpp29
-rw-r--r--tests/auto/qvolatileimage/qvolatileimage.pro7
-rw-r--r--tests/auto/qvolatileimage/tst_qvolatileimage.cpp403
-rw-r--r--tests/auto/selftests/expected_cmptest.txt2
-rw-r--r--tests/auto/selftests/expected_crashes_3.txt2
-rw-r--r--tests/auto/selftests/expected_longstring.txt2
-rw-r--r--tests/auto/selftests/expected_maxwarnings.txt2
-rw-r--r--tests/auto/selftests/expected_skip.txt2
-rw-r--r--tools/assistant/tools/assistant/doc/assistant.qdocconf4
-rw-r--r--tools/designer/src/components/formeditor/qdesigner_resource.cpp2
-rw-r--r--tools/designer/src/lib/shared/widgetfactory.cpp6
-rw-r--r--tools/qdoc3/codemarker.cpp4
-rw-r--r--tools/qdoc3/codemarker.h2
-rw-r--r--tools/qdoc3/cppcodeparser.cpp22
-rw-r--r--tools/qdoc3/declarativeparser/parser.pri21
-rw-r--r--tools/qdoc3/declarativeparser/qdeclarativejs.g3149
-rw-r--r--tools/qdoc3/declarativeparser/qdeclarativejsast.cpp956
-rw-r--r--tools/qdoc3/declarativeparser/qdeclarativejsast_p.h2546
-rw-r--r--tools/qdoc3/declarativeparser/qdeclarativejsastfwd_p.h189
-rw-r--r--tools/qdoc3/declarativeparser/qdeclarativejsastvisitor.cpp58
-rw-r--r--tools/qdoc3/declarativeparser/qdeclarativejsastvisitor_p.h335
-rw-r--r--tools/qdoc3/declarativeparser/qdeclarativejsengine_p.cpp212
-rw-r--r--tools/qdoc3/declarativeparser/qdeclarativejsengine_p.h173
-rw-r--r--tools/qdoc3/declarativeparser/qdeclarativejsglobal_p.h64
-rw-r--r--tools/qdoc3/declarativeparser/qdeclarativejsgrammar.cpp989
-rw-r--r--tools/qdoc3/declarativeparser/qdeclarativejsgrammar_p.h210
-rw-r--r--tools/qdoc3/declarativeparser/qdeclarativejslexer.cpp1258
-rw-r--r--tools/qdoc3/declarativeparser/qdeclarativejslexer_p.h249
-rw-r--r--tools/qdoc3/declarativeparser/qdeclarativejsmemorypool_p.h133
-rw-r--r--tools/qdoc3/declarativeparser/qdeclarativejsnodepool_p.h139
-rw-r--r--tools/qdoc3/declarativeparser/qdeclarativejsparser.cpp1904
-rw-r--r--tools/qdoc3/declarativeparser/qdeclarativejsparser_p.h246
-rw-r--r--tools/qdoc3/ditaxmlgenerator.cpp222
-rw-r--r--tools/qdoc3/ditaxmlgenerator.h4
-rw-r--r--tools/qdoc3/doc.cpp2
-rw-r--r--tools/qdoc3/doc/files/qt.qdocconf8
-rw-r--r--tools/qdoc3/helpprojectwriter.cpp5
-rw-r--r--tools/qdoc3/htmlgenerator.cpp118
-rw-r--r--tools/qdoc3/node.cpp39
-rw-r--r--tools/qdoc3/node.h13
-rw-r--r--tools/qdoc3/qdoc3.pro2
-rw-r--r--tools/qdoc3/test/assistant.qdocconf4
-rw-r--r--tools/qdoc3/test/designer.qdocconf4
-rw-r--r--tools/qdoc3/test/linguist.qdocconf4
-rw-r--r--tools/qdoc3/test/macros.qdocconf1
-rw-r--r--tools/qdoc3/test/qdeclarative.qdocconf8
-rw-r--r--tools/qdoc3/test/qmake.qdocconf4
-rw-r--r--tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf10
-rw-r--r--tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf10
-rw-r--r--tools/qdoc3/test/qt-html-templates.qdocconf256
-rw-r--r--tools/qdoc3/test/qt-project.qdocconf12
-rw-r--r--tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp47
-rw-r--r--tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h36
-rw-r--r--tools/qmeegographicssystemhelper/qmeegoruntime.cpp70
-rw-r--r--tools/qmeegographicssystemhelper/qmeegoruntime.h8
-rw-r--r--tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp2
-rw-r--r--tools/qml/qml.pri2
957 files changed, 59705 insertions, 2463 deletions
diff --git a/bin/elf2e32_qtwrapper b/bin/elf2e32_qtwrapper
index 694d54a..a3a4065 100755
--- a/bin/elf2e32_qtwrapper
+++ b/bin/elf2e32_qtwrapper
@@ -1,145 +1,3 @@
-#!/usr/bin/perl -w
-
-# A script to get around some shortcomings in elf2e32, namely:
-# - Returning 0 even when there are errors.
-# - Excluding symbols from the dso file even when they are present in the ELF file.
-# - Including symbols in the the dso file even when they are not present in the ELF file.
-# - Overwriting the old dso file even when there are no changes (increases build time).
-
-use File::Copy;
-
-my @args = ();
-my @definput;
-my @defoutput;
-my @dso;
-my @tmpdso;
-foreach (@ARGV) {
- if (/^--definput/o) {
- @definput = split('=', $_);
- } elsif (/^--defoutput/o) {
- @defoutput = split('=', $_);
- } elsif (/^--dso/o) {
- @dso = split('=', $_);
- } elsif (/^--tmpdso/o) {
- @tmpdso = split('=', $_);
- $tmpdso[0] = "--dso";
- } else {
- push(@args, $_);
- }
-}
-
-@definput = () if (!@definput || ! -e $definput[1]);
-
-if (@dso && !@tmpdso || !@dso && @tmpdso) {
- print("--dso and --tmpdso must be used together.\n");
- exit 1;
-}
-
-my $buildingLibrary = (@defoutput && @dso) ? 1 : 0;
-
-my $fixupFile = "";
-my $runCount = 0;
-my $returnCode = 0;
-
-while (1) {
- if (++$runCount > 2) {
- print("Internal error in $0, link succeeded, but exports may be wrong.\n");
- last;
- }
-
- my $elf2e32Pipe;
- my $elf2e32Cmd = "elf2e32 @args"
- . " " . join("=", @definput)
- . " " . join("=", @defoutput)
- . " " . join("=", @tmpdso);
- open($elf2e32Pipe, "$elf2e32Cmd 2>&1 |") or die ("Could not run elf2e32");
-
- my %fixupSymbols;
- my $foundBrokenSymbols = 0;
- my $errors = 0;
- while (<$elf2e32Pipe>) {
- print;
- if (/Error:/io) {
- $errors = 1;
- } elsif (/symbol ([a-z0-9_]+) absent in the DEF file, but present in the ELF file/io) {
- $fixupSymbols{$1} = 1;
- $foundBrokenSymbols = 1;
- } elsif (/[0-9]+ Frozen Export\(s\) missing from the ELF file/io) {
- $foundBrokenSymbols = 1;
- }
- }
- close($elf2e32Pipe);
-
- if ($errors) {
- $returnCode = 1;
- last;
- }
-
- if ($buildingLibrary) {
- my $tmpDefFile;
- my $defFile;
- open($defFile, "< $defoutput[1]") or die("Could not open $defoutput[1]");
- open($tmpDefFile, "> $defoutput[1].tmp") or die("Could not open $defoutput[1].tmp");
- $fixupFile = "$defoutput[1].tmp";
- while (<$defFile>) {
- s/\r//;
- s/\n//;
- next if (/; NEW:/);
- if (/([a-z0-9_]+) @/i) {
- if (exists($fixupSymbols{$1})) {
- s/ ABSENT//;
- } elsif (s/; MISSING://) {
- s/$/ ABSENT/;
- }
- }
- print($tmpDefFile "$_\n");
- }
- close($defFile);
- close($tmpDefFile);
-
- $definput[1] = "$defoutput[1].tmp";
-
- if (!$foundBrokenSymbols || $errors) {
- last;
- }
-
- print("Rerunning elf2e32 due to DEF file / ELF file mismatch\n");
- } else {
- last;
- }
-};
-
-if ($fixupFile) {
- unlink($defoutput[1]);
- move($fixupFile, $defoutput[1]);
-}
-
-exit $returnCode if ($returnCode != 0);
-
-if ($buildingLibrary) {
- my $differenceFound = 0;
-
- if (-e $dso[1]) {
- my $dsoFile;
- my $tmpdsoFile;
- my $dsoBuf;
- my $tmpdsoBuf;
- open($dsoFile, "< $dso[1]") or die("Could not open $dso[1]");
- open($tmpdsoFile, "< $tmpdso[1]") or die("Could not open $tmpdso[1]");
- binmode($dsoFile);
- binmode($tmpdsoFile);
- while(read($dsoFile, $dsoBuf, 4096) && read($tmpdsoFile, $tmpdsoBuf, 4096)) {
- if ($dsoBuf ne $tmpdsoBuf) {
- $differenceFound = 1;
- }
- }
- close($tmpdsoFile);
- close($dsoFile);
- } else {
- $differenceFound = 1;
- }
-
- if ($differenceFound) {
- copy($tmpdso[1], $dso[1]);
- }
-}
+#!/bin/sh
+scriptpath=`dirname $0`
+perl $scriptpath/elf2e32_qtwrapper.pl "$@"
diff --git a/bin/elf2e32_qtwrapper.bat b/bin/elf2e32_qtwrapper.bat
new file mode 100644
index 0000000..52910df
--- /dev/null
+++ b/bin/elf2e32_qtwrapper.bat
@@ -0,0 +1,3 @@
+@echo off
+set scriptpath=%~dp0
+perl %scriptpath%elf2e32_qtwrapper.pl %*
diff --git a/bin/elf2e32_qtwrapper.pl b/bin/elf2e32_qtwrapper.pl
new file mode 100755
index 0000000..a2aff75
--- /dev/null
+++ b/bin/elf2e32_qtwrapper.pl
@@ -0,0 +1,265 @@
+#!/usr/bin/perl -w
+#############################################################################
+##
+## Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+## All rights reserved.
+## Contact: Nokia Corporation (qt-info@nokia.com)
+##
+## This file is part of the S60 port 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$
+##
+#############################################################################
+
+# A script to get around some shortcomings in elf2e32, namely:
+# - Returning 0 even when there are errors.
+# - Excluding symbols from the dso file even when they are present in the ELF file.
+# - Including symbols in the the dso file even when they are not present in the ELF file.
+# - Overwriting the old dso file even when there are no changes (increases build time).
+
+use File::Copy;
+
+my @args = ();
+my @definput;
+my @defoutput;
+my @dso;
+my @tmpdso;
+foreach (@ARGV) {
+ if (/^--definput/o) {
+ @definput = split('=', $_);
+ } elsif (/^--defoutput/o) {
+ @defoutput = split('=', $_);
+ } elsif (/^--dso/o) {
+ @dso = split('=', $_);
+ } elsif (/^--tmpdso/o) {
+ @tmpdso = split('=', $_);
+ $tmpdso[0] = "--dso";
+ } else {
+ push(@args, $_);
+ }
+}
+
+@definput = () if (!@definput || ! -e $definput[1]);
+
+if (@dso && !@tmpdso || !@dso && @tmpdso) {
+ print("--dso and --tmpdso must be used together.\n");
+ exit 1;
+}
+
+my $buildingLibrary = (@defoutput && @dso) ? 1 : 0;
+
+my $fixupFile = "";
+my $runCount = 0;
+my $returnCode = 0;
+
+while (1) {
+ if (++$runCount > 2) {
+ print("Internal error in $0, link succeeded, but exports may be wrong.\n");
+ last;
+ }
+
+ my $elf2e32Pipe;
+ my $elf2e32Cmd = "elf2e32 @args"
+ . " " . join("=", @definput)
+ . " " . join("=", @defoutput)
+ . " " . join("=", @tmpdso);
+ open($elf2e32Pipe, "$elf2e32Cmd 2>&1 |") or die ("Could not run elf2e32");
+
+ my %fixupSymbols;
+ my $foundBrokenSymbols = 0;
+ my $errors = 0;
+ while (<$elf2e32Pipe>) {
+ print;
+ if (/Error:/io) {
+ $errors = 1;
+ } elsif (/symbol ([a-z0-9_]+) absent in the DEF file, but present in the ELF file/io) {
+ $fixupSymbols{$1} = 1;
+ $foundBrokenSymbols = 1;
+ } elsif (/[0-9]+ Frozen Export\(s\) missing from the ELF file/io) {
+ $foundBrokenSymbols = 1;
+ }
+ }
+ close($elf2e32Pipe);
+
+ if ($errors) {
+ $returnCode = 1;
+ last;
+ }
+
+ if ($buildingLibrary && $runCount == 1) {
+ my $tmpDefFile;
+ my $newDefFile;
+ my $origDefFile;
+ my $savedNewDefFileLine = "";
+ if ($definput[1]) {
+ open($origDefFile, "< $definput[1]") or die("Could not open $definput[1]");
+ }
+ open($newDefFile, "< $defoutput[1]") or die("Could not open $defoutput[1]");
+ open($tmpDefFile, "> $defoutput[1].tmp") or die("Could not open $defoutput[1].tmp");
+ print($tmpDefFile "EXPORTS\n");
+ $fixupFile = "$defoutput[1].tmp";
+ while (1) {
+ my $origDefLine;
+ my $origSym;
+ my $origOrdinal;
+ my $origExtraData;
+ my $newDefLine;
+ my $newSym;
+ my $newOrdinal;
+ my $newExtraData;
+ my $defLine;
+ my $sym;
+ my $ordinal;
+ my $extraData;
+ if ($definput[1]) {
+ # Read from original def file, and skip non-symbol lines
+ while (1) {
+ $origDefLine = <$origDefFile>;
+ if (defined($origDefLine)) {
+ $origDefLine =~ s/[\n\r]//;
+ if ($origDefLine =~ /([a-z0-9_]+) +\@ *([0-9]+) (.*)/i) {
+ $origSym = $1;
+ $origOrdinal = $2;
+ $origExtraData = $3;
+ last;
+ }
+ } else {
+ last;
+ }
+ }
+ }
+
+ if ($savedNewDefFileLine) {
+ # This happens if the new def file was missing an entry.
+ $newDefLine = $savedNewDefFileLine;
+ $newDefLine =~ /([a-z0-9_]+) +\@ *([0-9]+) (.*)/i or die("$0: Shouldn't happen");
+ $newSym = $1;
+ $newOrdinal = $2;
+ $newExtraData = $3;
+ } else {
+ # Read from new def file, and skip non-symbol lines
+ while (1) {
+ $newDefLine = <$newDefFile>;
+ if (defined($newDefLine)) {
+ $newDefLine =~ s/[\n\r]//;
+ if ($newDefLine =~ /([a-z0-9_]+) +\@ *([0-9]+) (.*)/i) {
+ $newSym = $1;
+ $newOrdinal = $2;
+ $newExtraData = $3;
+ last;
+ }
+ } else {
+ last;
+ }
+ }
+ }
+ $savedNewDefFileLine = "";
+ last if (!defined($origDefLine) && !defined($newDefLine));
+
+ if (defined($origOrdinal) && (!defined($newOrdinal) || $origOrdinal != $newOrdinal)) {
+ # If the symbol is missing from the new def file, use the original symbol.
+ $savedNewDefFileLine = $newDefLine;
+ $defLine = $origDefLine;
+ $sym = $origSym;
+ $ordinal = $origOrdinal;
+ $extraData = $origExtraData;
+ } else {
+ $defLine = $newDefLine;
+ $sym = $newSym;
+ $ordinal = $newOrdinal;
+ if ($newExtraData =~ /ABSENT/) {
+ # Special case to keep "DATA [0-9]+" data in absent entries.
+ $extraData = $origExtraData;
+ } else {
+ $extraData = $newExtraData;
+ }
+ }
+ if (exists($fixupSymbols{$sym})) {
+ # Fix symbols that have returned after first being marked ABSENT.
+ $extraData =~ s/ ABSENT//;
+ } elsif ($defLine =~ s/; MISSING://) {
+ # Auto-absent symbols.
+ $extraData .= " ABSENT";
+ }
+ print($tmpDefFile "\t$sym \@ $ordinal $extraData\n");
+ }
+ print($tmpDefFile "\n");
+ close($origDefFile) if ($definput[1]);
+ close($newDefFile);
+ close($tmpDefFile);
+
+ $definput[1] = "$defoutput[1].tmp";
+
+ if (!$foundBrokenSymbols || $errors) {
+ last;
+ }
+
+ print("Rerunning elf2e32 due to DEF file / ELF file mismatch\n");
+ } else {
+ last;
+ }
+};
+
+if ($fixupFile) {
+ unlink($defoutput[1]);
+ move($fixupFile, $defoutput[1]);
+}
+
+exit $returnCode if ($returnCode != 0);
+
+if ($buildingLibrary) {
+ my $differenceFound = 0;
+
+ if (-e $dso[1]) {
+ my $dsoFile;
+ my $tmpdsoFile;
+ my $dsoBuf;
+ my $tmpdsoBuf;
+ open($dsoFile, "< $dso[1]") or die("Could not open $dso[1]");
+ open($tmpdsoFile, "< $tmpdso[1]") or die("Could not open $tmpdso[1]");
+ binmode($dsoFile);
+ binmode($tmpdsoFile);
+ while(read($dsoFile, $dsoBuf, 4096) && read($tmpdsoFile, $tmpdsoBuf, 4096)) {
+ if ($dsoBuf ne $tmpdsoBuf) {
+ $differenceFound = 1;
+ }
+ }
+ close($tmpdsoFile);
+ close($dsoFile);
+ } else {
+ $differenceFound = 1;
+ }
+
+ if ($differenceFound) {
+ copy($tmpdso[1], $dso[1]);
+ }
+}
diff --git a/config.tests/unix/endian/endiantest.cpp b/config.tests/unix/endian/endiantest.cpp
index 296f890..40b2c38 100644
--- a/config.tests/unix/endian/endiantest.cpp
+++ b/config.tests/unix/endian/endiantest.cpp
@@ -48,9 +48,9 @@ short lsb_littleendian[] = { 0x0000, 0x654c, 0x7361, 0x5374, 0x6769, 0x696e, 0x6
int main(int, char **)
{
// make sure the linker doesn't throw away the arrays
- char *msb_bigendian_string = (char *) msb_bigendian;
- char *lsb_littleendian_string = (char *) lsb_littleendian;
- (void) msb_bigendian_string;
- (void) lsb_littleendian_string;
+ void (*msb_bigendian_string)() = (void (*)())msb_bigendian;
+ void (*lsb_littleendian_string)() = (void (*)())lsb_littleendian;
+ (void)msb_bigendian_string();
+ (void)lsb_littleendian_string();
return msb_bigendian[1] == lsb_littleendian[1];
}
diff --git a/configure b/configure
index 5e8ef17..d1cd0a62c 100755
--- a/configure
+++ b/configure
@@ -761,8 +761,10 @@ L_FLAGS=
RPATH_FLAGS=
l_FLAGS=
QCONFIG_FLAGS=
-XPLATFORM= # This seems to be the QMAKESPEC, like "linux-g++" or "symbian/linux-gcce"
+XPLATFORM= # This seems to be the QMAKESPEC, like "linux-g++" or "symbian-gcce"
XPLATFORM_MINGW=no # Whether target platform is MinGW (win32-g++*)
+XPLATFORM_SYMBIAN=no # Whether target platform is SYMBIAN (*symbian*)
+XPLATFORM_SYMBIAN_SBSV2=no # Whether target platform is SYMBIAN_SBSV2 (symbian-sbsv2)
PLATFORM=$QMAKESPEC
QT_CROSS_COMPILE=no
OPT_CONFIRM_LICENSE=no
@@ -1458,6 +1460,8 @@ while [ "$#" -gt 0 ]; do
xplatform)
XPLATFORM="$VAL"
case `basename "$XPLATFORM"` in win32-g++*) XPLATFORM_MINGW=yes;; esac
+ case "$XPLATFORM" in *symbian*) XPLATFORM_SYMBIAN=yes;; esac
+ case "$XPLATFORM" in symbian-sbsv2) XPLATFORM_SYMBIAN_SBSV2=yes;; esac
;;
debug-and-release)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
@@ -2735,6 +2739,8 @@ fi
[ -z "$XPLATFORM" ] && XPLATFORM="$PLATFORM"
case `basename "$XPLATFORM"` in win32-g++*) XPLATFORM_MINGW=yes;; esac
+case "$XPLATFORM" in *symbian*) XPLATFORM_SYMBIAN=yes;; esac
+case "$XPLATFORM" in symbian-sbsv2) XPLATFORM_SYMBIAN_SBSV2=yes;; esac
if [ -d "$PLATFORM" ]; then
QMAKESPEC="$PLATFORM"
@@ -3010,7 +3016,7 @@ if [ "$PLATFORM" != "$XPLATFORM" -a "$CFG_EMBEDDED" != "no" ]; then
esac
elif [ "$XPLATFORM_MINGW" = "yes" ]; then
[ -z "$CFG_ARCH" ] && CFG_ARCH="windows"
-elif echo "$XPLATFORM" | grep symbian > /dev/null; then
+elif [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
CFG_ARCH=symbian
elif [ "$PLATFORM_MAC" = "yes" ] || [ -z "$CFG_ARCH" ]; then
CFG_ARCH=$CFG_HOST_ARCH
@@ -3138,7 +3144,7 @@ QMAKE_CONF_COMPILER=`getQMakeConf "$XQMAKESPEC" | grep "^QMAKE_CXX[^_A-Z0-9]" |
TEST_COMPILER="$CXX"
[ -z "$TEST_COMPILER" ] && TEST_COMPILER=$QMAKE_CONF_COMPILER
-if [ "$XPLATFORM" != "symbian-sbsv2" ]; then
+if [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" ]; then
#for Symbian we don't need this checking
if [ -z "$TEST_COMPILER" ]; then
echo "ERROR: Cannot set the compiler for the configuration tests"
@@ -3305,16 +3311,18 @@ if [ -z "$QT_INSTALL_PREFIX" ]; then
if [ "$PLATFORM" != "$XPLATFORM" ]; then
QT_INSTALL_PREFIX="${QT_INSTALL_PREFIX}-${CFG_ARCH}"
fi
- elif [ -d "$EPOCROOT" ] && echo $XPLATFORM | grep symbian > /dev/null; then
- QT_INSTALL_PREFIX="$EPOCROOT/epoc32/"
- QT_INSTALL_LIBS="$EPOCROOT/epoc32/release/armv5/lib/"
+ elif [ -d "$EPOCROOT" ]; then
+ if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
+ QT_INSTALL_PREFIX="$EPOCROOT/epoc32/"
+ QT_INSTALL_LIBS="$EPOCROOT/epoc32/release/armv5/lib/"
+ fi
else
QT_INSTALL_PREFIX="/usr/local/Trolltech/Qt-${QT_VERSION}" # the default install prefix is /usr/local/Trolltech/Qt-$QT_VERSION
fi
fi
QT_INSTALL_PREFIX=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_PREFIX"`
-if echo $XPLATFORM | grep symbian > /dev/null; then
+if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
[ -z "$QT_HOST_PREFIX" ] && QT_HOST_PREFIX="$QT_INSTALL_PREFIX"
[ -z "$QT_INSTALL_DOCS" ] && QT_INSTALL_DOCS=
[ -z "$QT_INSTALL_HEADERS" ] && QT_INSTALL_HEADERS=
@@ -4172,7 +4180,7 @@ if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_X11" = "yes" ]; then
EOF
fi
-case "$XPLATFORM" in *symbian*)
+if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
cat << EOF
Qt for Symbian only:
@@ -4184,9 +4192,7 @@ Qt for Symbian only:
-no-usedeffiles .... Disable the usage of DEF files.
* -usedeffiles ....... Enable the usage of DEF files.
EOF
-;;
-esac
-
+fi
[ "x$ERROR" = "xyes" ] && exit 1
exit 0
fi # Help
@@ -4198,10 +4204,10 @@ fi # Help
if [ "$PLATFORM_QWS" = "yes" ]; then
Platform="Qt for Embedded Linux"
+elif [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
+ Platform="Qt for Symbian"
elif [ "$PLATFORM_MAC" = "yes" ]; then
Platform="Qt for Mac OS X"
-elif echo "$XPLATFORM" | grep "symbian" > /dev/null ; then
- Platform="Qt for Symbian"
elif [ "$XPLATFORM_MINGW" = "yes" ]; then
Platform="Qt for Windows"
elif [ '!' -z "`getQMakeConf \"$XQMAKESPEC\" | grep QMAKE_LIBS_X11 | awk '{print $3;}'`" ]; then
@@ -4586,7 +4592,7 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
#mkspecs/default is used as a (gasp!) default mkspec so QMAKESPEC needn't be set once configured
rm -rf mkspecs/default
- if echo "$XPLATFORM" | grep "symbian-sbsv2" > /dev/null ; then
+ if [ "$XPLATFORM_SYMBIAN_SBSV2" = "yes" ]; then
#Link is not supported for Symbian build system
cp -a mkspecs/`echo $XQMAKESPEC | sed "s,^${relpath}/mkspecs/,,"` mkspecs/default
else
@@ -4838,33 +4844,12 @@ if ( [ "$CFG_ARCH" = "arm" ] || [ "$CFG_ARCH" = "armv6" ] ) && [ "${CFG_NEON}" =
fi
fi
-# detect zlib
-if [ "$CFG_ZLIB" = "no" ]; then
- # Note: Qt no longer support builds without zlib
- # So we force a "no" to be "auto" here.
- # If you REALLY really need no zlib support, you can still disable
- # it by doing the following:
- # add "no-zlib" to mkspecs/qconfig.pri
- # #define QT_NO_COMPRESS (probably by adding to src/corelib/global/qconfig.h)
- #
- # There's no guarantee that Qt will build under those conditions
-
- CFG_ZLIB=auto
- ZLIB_FORCED=yes
-fi
-if [ "$CFG_ZLIB" = "auto" ]; then
- if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/zlib "zlib" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
- CFG_ZLIB=system
- else
- CFG_ZLIB=yes
- fi
-fi
-
[ "$XPLATFORM_MINGW" = "yes" ] && QMakeVar add styles "windowsxp windowsvista"
-case "$XPLATFORM" in *symbian*)
+if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
QMakeVar set styles "windows s60" #overwrite previous default
CFG_LIBFREETYPE=no
+ CFG_ZLIB=yes
if [ "$CFG_LARGEFILE" = auto ]; then
CFG_LARGEFILE=no
@@ -4882,7 +4867,7 @@ case "$XPLATFORM" in *symbian*)
exit 1
fi
- if ! echo $XPLATFORM | grep symbian-sbsv2 > /dev/null; then
+ if [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" ]; then
# Raptor does not support configure tests.
# the main commands needed to compile;
@@ -4906,8 +4891,29 @@ case "$XPLATFORM" in *symbian*)
exit 1;
fi
fi
- ;;
-esac
+fi
+
+# detect zlib
+if [ "$CFG_ZLIB" = "no" ]; then
+ # Note: Qt no longer support builds without zlib
+ # So we force a "no" to be "auto" here.
+ # If you REALLY really need no zlib support, you can still disable
+ # it by doing the following:
+ # add "no-zlib" to mkspecs/qconfig.pri
+ # #define QT_NO_COMPRESS (probably by adding to src/corelib/global/qconfig.h)
+ #
+ # There's no guarantee that Qt will build under those conditions
+
+ CFG_ZLIB=auto
+ ZLIB_FORCED=yes
+fi
+if [ "$CFG_ZLIB" = "auto" ]; then
+ if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/zlib "zlib" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
+ CFG_ZLIB=system
+ else
+ CFG_ZLIB=yes
+ fi
+fi
if [ "$CFG_LARGEFILE" = "auto" ]; then
#Large files should be enabled for all Linux systems
@@ -4916,7 +4922,7 @@ fi
if [ "$CFG_S60" = "auto" ]; then
- if echo "$XPLATFORM" | grep symbian > /dev/null; then
+ if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
CFG_S60=yes
else
CFG_S60=no
@@ -4924,7 +4930,7 @@ if [ "$CFG_S60" = "auto" ]; then
fi
if [ "$CFG_QS60STYLE" = "auto" ]; then
- if echo "$XPLATFORM" | grep symbian > /dev/null; then
+ if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
CFG_QS60STYLE=qt
else
CFG_QS60STYLE=no
@@ -4932,7 +4938,7 @@ if [ "$CFG_QS60STYLE" = "auto" ]; then
fi
if [ "$CFG_SYMBIAN_DEFFILES" = "auto" ]; then
- if echo "$XPLATFORM" | grep symbian > /dev/null && [ "$CFG_DEV" = "no" ]; then
+ if [ "$XPLATFORM_SYMBIAN" = "yes" ] && [ "$CFG_DEV" = "no" ]; then
CFG_SYMBIAN_DEFFILES=yes
else
CFG_SYMBIAN_DEFFILES=no
@@ -5011,14 +5017,12 @@ fi
# detect accessibility
if [ "$CFG_ACCESSIBILITY" = "auto" ]; then
- case "$XPLATFORM" in
- symbian*)
+ if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
# accessibility is currently unsupported
CFG_ACCESSIBILITY=no
- ;;
- *)
+ else
CFG_ACCESSIBILITY=yes
- esac
+ fi
fi
# auto-detect SQL-modules support
@@ -5230,15 +5234,13 @@ for _SQLDR in $CFG_SQL_AVAILABLE; do
;;
sqlite)
if [ "$CFG_SQL_sqlite" = "auto" ]; then # the default
- case "$XPLATFORM" in
- symbian*)
+ if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
# sqlite on symbian is typically not build in Qt but deployed as a pre-existing sis file and should be marked as driver.
# Configuration parameters should be set
CFG_SQL_sqlite=qt
QT_LFLAGS_SQLITE=-lsqlite3
QMAKE_CONFIG="$QMAKE_CONFIG system-sqlite"
- ;;
- esac
+ fi
fi
if [ "$CFG_SQL_sqlite" != "no" ]; then
SQLITE_AUTODETECT_FAILED="no"
@@ -6112,10 +6114,10 @@ fi
if [ "$CFG_ENDIAN" = "auto" ]; then
if [ "$XPLATFORM_MINGW" = "yes" ]; then
CFG_ENDIAN="Q_LITTLE_ENDIAN"
- elif [ "$PLATFORM_MAC" = "yes" ]; then
- true #leave as auto
- elif [ "$XPLATFORM" = "symbian-sbsv2" ]; then
+ elif [ "$XPLATFORM_SYMBIAN_SBSV2" = "yes" ]; then
CFG_ENDIAN="Q_LITTLE_ENDIAN"
+ elif [ "$PLATFORM_MAC" = "yes" ] && [ "$XPLATFORM_SYMBIAN" = "no" ]; then
+ true #leave as auto
else
"$unixtests/endian.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
F="$?"
@@ -6201,7 +6203,7 @@ if [ "$CFG_DOUBLEFORMAT" = "auto" ]; then
fi
HAVE_STL=no
-if echo "$XPLATFORM" | grep symbian > /dev/null || "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/stl "STL" $L_FLAGS $I_FLAGS $l_FLAGS; then
+if [ "$XPLATFORM_SYMBIAN" = "yes" ] || "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/stl "STL" $L_FLAGS $I_FLAGS $l_FLAGS; then
HAVE_STL=yes
fi
@@ -6228,7 +6230,7 @@ if [ "$CFG_IPV6" != "no" ]; then
# Therefore for 4.7.1 and following we disable it until OpenC either supports it or we have the native Qt
# symbian socket engine.
#
- if echo "$XPLATFORM" | grep symbian > /dev/null; then
+ if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
CFG_IPV6=no
elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/ipv6 "IPv6" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
CFG_IPV6=yes
@@ -6343,7 +6345,7 @@ if [ "$CFG_GETIFADDRS" != "no" ]; then
fi
# detect OpenSSL
-if [ "$CFG_OPENSSL" != "no" ] && [ "$XPLATFORM" != "symbian-sbsv2" ]; then
+if [ "$CFG_OPENSSL" != "no" ] && [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" ]; then
if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/openssl "OpenSSL" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
if [ "$CFG_OPENSSL" = "auto" ]; then
CFG_OPENSSL=yes
@@ -6360,14 +6362,14 @@ if [ "$CFG_OPENSSL" != "no" ] && [ "$XPLATFORM" != "symbian-sbsv2" ]; then
fi
fi
else
- if [ "$CFG_OPENSSL" = "auto" ] && [ "$XPLATFORM" = "symbian-sbsv2" ]; then
+ if [ "$CFG_OPENSSL" = "auto" ] && [ "$XPLATFORM_SYMBIAN_SBSV2" = "yes" ]; then
#OpenSSl should be enabled for Symbian release
CFG_OPENSSL=yes
fi
fi
# detect OpenVG support
-if [ "$CFG_OPENVG" != "no" ] && [ "$XPLATFORM" != "symbian-sbsv2" ]; then
+if [ "$CFG_OPENVG" != "no" ] && [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" ]; then
if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/unix/openvg" "OpenVG" $L_FLAGS $I_FLAGS $l_FLAGS $CONFIG_ARG; then
if [ "$CFG_OPENVG" = "auto" ]; then
CFG_OPENVG=yes
@@ -6424,13 +6426,13 @@ if [ "$CFG_PTMALLOC" != "no" ]; then
QMakeVar add QMAKE_LFLAGS "$outpath/lib/libptmalloc3.a"
fi
-if [ "$CFG_ALSA" = "auto" ] && [ "$XPLATFORM" != "symbian-sbsv2" ]; then
+if [ "$CFG_ALSA" = "auto" ] && [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" ]; then
if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/alsa "alsa" $L_FLAGS $I_FLAGS $l_FLAGS; then
CFG_ALSA=yes
else
CFG_ALSA=no
fi
-elif [ "$XPLATFORM" = "symbian-sbsv2" ]; then
+elif [ "$XPLATFORM_SYMBIAN_SBSV2" = "yes" ]; then
# Disabled for Symbian release
CFG_ALSA=no
fi
@@ -6441,6 +6443,8 @@ if [ "$CFG_JAVASCRIPTCORE_JIT" = "yes" ] || [ "$CFG_JAVASCRIPTCORE_JIT" = "auto"
if [ $? != "0" ]; then
CFG_JAVASCRIPTCORE_JIT=no
fi
+ elif [ "$XPLATFORM" = "symbian-gcce" ]; then
+ CFG_JAVASCRIPTCORE_JIT=no
fi
fi
@@ -6451,7 +6455,7 @@ elif [ "$CFG_JAVASCRIPTCORE_JIT" = "no" ]; then
fi
if [ "$CFG_AUDIO_BACKEND" = "auto" ]; then
- if echo "$XPLATFORM" | grep symbian > /dev/null 2>&1; then
+ if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
if "$symbiantests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/symbian/audio "audio" $L_FLAGS $I_FLAGS $l_FLAGS ; then
CFG_AUDIO_BACKEND=yes
fi
@@ -6463,7 +6467,7 @@ fi
if [ "$CFG_LARGEFILE" != "yes" ] && [ "$XPLATFORM_MINGW" = "yes" ]; then
echo "Warning: largefile support cannot be disabled for win32."
CFG_LARGEFILE="yes"
-elif [ "$CFG_LARGEFILE" != "no" ] && echo "$XPLATFORM" | grep "symbian" > /dev/null; then
+elif [ "$CFG_LARGEFILE" != "no" ] && [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
echo "Warning: largefile support cannot be enabled for symbian."
CFG_LARGEFILE="no"
fi
@@ -6570,8 +6574,9 @@ if [ "$PLATFORM_MAC" = "yes" ]; then
fi
fi
-# but disable Cocoa if cross-building for mingw
+# but disable Cocoa if cross-building for mingw and symbian
[ "$XPLATFORM_MINGW" = "yes" ] && CFG_MAC_COCOA="no"
+[ "$XPLATFORM_SYMBIAN" = "yes" ] && CFG_MAC_COCOA="no"
# set the global Mac deployment target. This is overridden on an arch-by-arch basis
# in some cases, see code further down
@@ -6649,13 +6654,11 @@ else
fi
# Just check if OpenGL is not set by command argumets for Symbian.
-case "$XPLATFORM" in
- symbian*)
+if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
if [ "$CFG_OPENGL" = "auto" ]; then
CFG_OPENGL="no"
fi
- ;;
-esac
+fi
# enable opengl
if [ "$CFG_OPENGL" = "no" ]; then
@@ -6839,7 +6842,7 @@ else
fi
-if [ "x$PLATFORM_MAC" = "xyes" ] && [ "$XPLATFORM_MINGW" != "yes" ]; then
+if [ "x$PLATFORM_MAC" = "xyes" ] && [ "$XPLATFORM_MINGW" != "yes" ] && [ "$XPLATFORM_SYMBIAN" != "yes" ]; then
#On Mac we implicitly link against libz, so we
#never use the 3rdparty stuff.
[ "$CFG_ZLIB" = "yes" ] && CFG_ZLIB="system"
@@ -7121,11 +7124,11 @@ EOF
canBuildWebKit="no"
canBuildQtConcurrent="no"
;;
- symbian/*-gcce)
+ symbian-gcce)
canBuildWebKit="no"
canBuildQtConcurrent="no"
;;
- symbian/*-armcc)
+ symbian-armcc)
canBuildQtConcurrent="no"
;;
esac
@@ -7478,14 +7481,11 @@ rm -f .options
BUILD_OPTIONS="$BUILD_CONFIG $BUILD_OPTIONS"
# extract the operating system from the XPLATFORM
TARGET_OPERATING_SYSTEM=`echo $XPLATFORM | cut -f 2- -d/ | cut -f -1 -d-`
-case "$XPLATFORM" in
-symbian*)
+if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
QT_BUILD_KEY_SYSTEM_PART="Symbian"
- ;;
-*)
+else
QT_BUILD_KEY_SYSTEM_PART="$CFG_ARCH $TARGET_OPERATING_SYSTEM $COMPILER"
- ;;
-esac
+fi
# when cross-compiling, don't include build-host information (build key is target specific)
QT_BUILD_KEY="$CFG_USER_BUILD_KEY $QT_BUILD_KEY_SYSTEM_PART $BUILD_OPTIONS"
@@ -7817,8 +7817,7 @@ fi
[ '!' -z "$AWK" ] && QCONFIG_FLAGS=`echo $QCONFIG_FLAGS | $AWK '{ gsub(" ", "\n"); print }' | sort | uniq`
QCONFIG_FLAGS=`echo $QCONFIG_FLAGS`
-if echo $XPLATFORM | grep symbian >/dev/null
-then
+if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
# Enable Symbian DLLs and export rules.
# We cannot use Linux's default export rules since they export everything.
QCONFIG_FLAGS="$QCONFIG_FLAGS QT_DLL"
@@ -7898,7 +7897,7 @@ else
mv "$outpath/src/corelib/global/qconfig.h.new" "$outpath/src/corelib/global/qconfig.h"
chmod -w "$outpath/src/corelib/global/qconfig.h"
for conf in "$outpath/include/QtCore/qconfig.h" "$outpath/include/Qt/qconfig.h"; do
- if echo "$XPLATFORM" | grep "symbian-sbsv2" > /dev/null 2>&1 ; then
+ if [ "$XPLATFORM_SYMBIAN_SBSV2" = "yes" ]; then
[ -e "$conf" ] && rm -rf "$conf"
cp -a "$outpath/src/corelib/global/qconfig.h" "$conf"
elif [ '!' -f "$conf" ]; then
@@ -8577,7 +8576,7 @@ for file in .projects .projects.3; do
fi
SPEC=$XQMAKESPEC ;;
*s60main/s60main.pro)
- if [ "$CFG_NOPROCESS" = "yes" ] || ! echo "$XPLATFORM" | grep "symbian" >/dev/null; then
+ if [ "$CFG_NOPROCESS" = "yes" ] || [ "$XPLATFORM_SYMBIAN" != "yes" ]; then
continue
fi;;
*examples/activeqt/*) continue ;;
diff --git a/demos/demos.pro b/demos/demos.pro
index fdc1e4c..7f85499 100644
--- a/demos/demos.pro
+++ b/demos/demos.pro
@@ -21,7 +21,11 @@ SUBDIRS = \
symbian: SUBDIRS = \
demos_shared \
demos_deform \
- demos_pathstroke
+ demos_pathstroke \
+ demos_guitartuner \
+ demos_qcamera \
+ demos_qtbubblelevel \
+ demos_quickhit
wince*: SUBDIRS = \
demos_shared \
@@ -91,6 +95,12 @@ demos_qtdemo.subdir = qtdemo
demos_mediaplayer.subdir = qmediaplayer
demos_declarative.subdir = declarative
+#mobile demos
+demos_guitartuner = mobile/guitartuner
+demos_qcamera = mobile/qcamera
+demos_qtbubblelevel = mobile/qtbubblelevel
+demos_quickhit = mobile/quickhit
+
demos_browser.subdir = browser
demos_boxes.subdir = boxes
diff --git a/demos/mobile/guitartuner/guitartuner.pro b/demos/mobile/guitartuner/guitartuner.pro
new file mode 100644
index 0000000..6283530
--- /dev/null
+++ b/demos/mobile/guitartuner/guitartuner.pro
@@ -0,0 +1,89 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2010-10-22T14:28:56
+#
+#-------------------------------------------------
+
+QT += core gui
+
+TARGET = guitartuner
+TEMPLATE = app
+
+ICON = images/guitartuner_icon.svg
+
+SOURCES += src/main.cpp\
+ src/guitartuner.cpp \
+ src/voicegenerator.cpp \
+ src/voiceanalyzer.cpp \
+ src/guitartunerui.cpp \
+ src/fastfouriertransformer.cpp
+
+HEADERS += src/guitartuner.h \
+ src/voicegenerator.h \
+ src/voiceanalyzer.h \
+ src/constants.h \
+ src/guitartunerui.h \
+ src/fastfouriertransformer.h
+
+FORMS += src/guitartunerui.ui
+
+VERSION = 1.2.0
+
+symbian {
+ INCLUDEPATH += /epoc32/include/mmf/common
+ INCLUDEPATH += /epoc32/include/mmf/server
+ LIBS += -lmmfdevsound
+ TARGET.UID3 = 0xEC46D2C8
+ # TARGET.CAPABILITY +=
+ # TARGET.EPOCSTACKSIZE = 0x14000
+ # TARGET.EPOCHEAPSIZE = 0x020000 0x1000000
+}
+
+RESOURCES += \
+ guitartuner.qrc
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+symbian {
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -leiksrv -lcone
+}
+
+
+# Add mobility into Qt's CONFIG, and add multimedia into MOBILITY.
+
+win32 {
+ QT += multimedia
+ RC_FILE = src/guitartuner.rc
+}
+else {
+ CONFIG += mobility
+ MOBILITY += multimedia
+}
+
+symbian {
+ TARGET.CAPABILITY = UserEnvironment
+}
+
+# Add declarative module
+QT += declarative
+
+OTHER_FILES += \
+ src/application.qml \
+ src/mycomponents/Adjuster.qml \
+ src/mycomponents/adjustbars.js \
+ src/mycomponents/ToggleButton.qml
+
+OTHER_FILES += \
+ src/mycomponents/NotesModel.qml \
+ src/mycomponents/NoteButtonView.qml \
+ src/mycomponents/Meter.qml
+
+unix:!symbian {
+ maemo5 {
+ target.path = /opt/usr/bin
+ } else {
+ target.path = /usr/local/bin
+ }
+ INSTALLS += target
+}
diff --git a/demos/mobile/guitartuner/guitartuner.qrc b/demos/mobile/guitartuner/guitartuner.qrc
new file mode 100644
index 0000000..d8ba019
--- /dev/null
+++ b/demos/mobile/guitartuner/guitartuner.qrc
@@ -0,0 +1,43 @@
+<RCC>
+ <qresource prefix="/">
+ <file>src/application.qml</file>
+ <file>src/mycomponents/adjustbars.js</file>
+ <file>src/mycomponents/Adjuster.qml</file>
+ <file>src/mycomponents/Meter.qml</file>
+ <file>src/mycomponents/NoteButtonView.qml</file>
+ <file>src/mycomponents/NotesModel.qml</file>
+ <file>src/mycomponents/ToggleButton.qml</file>
+ <file>src/mycomponents/images/meterBG.png</file>
+ <file>src/mycomponents/images/pointerShadow.png</file>
+ <file>src/mycomponents/images/sensitivity.png</file>
+ <file>src/mycomponents/images/tuner_a.png</file>
+ <file>src/mycomponents/images/tuner_a_on.png</file>
+ <file>src/mycomponents/images/tuner_b.png</file>
+ <file>src/mycomponents/images/tuner_b_on.png</file>
+ <file>src/mycomponents/images/tuner_d.png</file>
+ <file>src/mycomponents/images/tuner_d_on.png</file>
+ <file>src/mycomponents/images/tuner_e.png</file>
+ <file>src/mycomponents/images/tuner_e_on.png</file>
+ <file>src/mycomponents/images/tuner_g.png</file>
+ <file>src/mycomponents/images/tuner_g_on.png</file>
+ <file>src/mycomponents/images/voicemode_off.png</file>
+ <file>src/mycomponents/images/voicemode_on.png</file>
+ <file>src/mycomponents/images/volume.png</file>
+ <file>src/mycomponents/images/volume_off.png</file>
+ <file>src/mycomponents/images/guitartuner_skin.png</file>
+ <file>src/mycomponents/images/power.png</file>
+ <file>src/mycomponents/images/tuner_auto.png</file>
+ <file>src/mycomponents/images/tuner_auto_on.png</file>
+ <file>src/mycomponents/images/big_a.png</file>
+ <file>src/mycomponents/images/big_b.png</file>
+ <file>src/mycomponents/images/big_d.png</file>
+ <file>src/mycomponents/images/big_e.png</file>
+ <file>src/mycomponents/images/big_g.png</file>
+ <file>src/mycomponents/images/glowing_a.png</file>
+ <file>src/mycomponents/images/glowing_b.png</file>
+ <file>src/mycomponents/images/glowing_d.png</file>
+ <file>src/mycomponents/images/glowing_e.png</file>
+ <file>src/mycomponents/images/glowing_g.png</file>
+ <file>src/mycomponents/images/pointer.png</file>
+ </qresource>
+</RCC>
diff --git a/demos/mobile/guitartuner/images/guitartab.svg b/demos/mobile/guitartuner/images/guitartab.svg
new file mode 100644
index 0000000..9d88d5d
--- /dev/null
+++ b/demos/mobile/guitartuner/images/guitartab.svg
@@ -0,0 +1,174 @@
+<?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="70.661781"
+ height="55.997791"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="guitartab.svg">
+ <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="perspective3604"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3632"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3632-4"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3632-9"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3632-8"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3632-2"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3690"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3712"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.98994949"
+ inkscape:cx="343.43632"
+ inkscape:cy="198.00574"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1280"
+ inkscape:window-height="888"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ showguides="true"
+ inkscape:guide-bbox="true"
+ borderlayer="true" />
+ <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" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-45.793001,-702.07386)">
+ <rect
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.96666431;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="rect3728"
+ width="68.695114"
+ height="54.031128"
+ x="46.776333"
+ y="703.05719" />
+ <g
+ id="g3732"
+ transform="matrix(0.11166616,0,0,0.11166616,41.003771,673.42071)">
+ <path
+ sodipodi:nodetypes="cc"
+ id="path2816"
+ d="m 133.63811,570.46864 0,-225.36571"
+ style="fill:none;stroke:#000000;stroke-width:17.61199951;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cc"
+ id="path2816-7"
+ d="m 223.89631,570.46864 0,-225.36571"
+ style="fill:none;stroke:#000000;stroke-width:17.61199951;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cc"
+ id="path2816-0"
+ d="m 314.15451,570.46864 0,-225.36571"
+ style="fill:none;stroke:#000000;stroke-width:17.61199951;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cc"
+ id="path2816-4"
+ d="m 404.4127,570.46864 0,-225.36571"
+ style="fill:none;stroke:#000000;stroke-width:17.61199951;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cc"
+ id="path2816-8"
+ d="m 494.6709,570.46864 0,-225.36571"
+ style="fill:none;stroke:#000000;stroke-width:17.61199951;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cc"
+ id="path2816-45"
+ d="m 584.92911,570.46864 0,-225.36571"
+ style="fill:none;stroke:#000000;stroke-width:17.61199951;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cc"
+ id="path2816-5"
+ d="m 124.89988,344.21478 468.77277,0"
+ style="fill:none;stroke:#000000;stroke-width:19.51578331;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cc"
+ id="path2816-5-1"
+ d="m 125.76355,400.6818 467.80305,0"
+ style="fill:none;stroke:#000000;stroke-width:19.4955883;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ </g>
+</svg>
diff --git a/demos/mobile/guitartuner/images/guitartuner_icon.svg b/demos/mobile/guitartuner/images/guitartuner_icon.svg
new file mode 100644
index 0000000..de7ebe0
--- /dev/null
+++ b/demos/mobile/guitartuner/images/guitartuner_icon.svg
@@ -0,0 +1,247 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 15.0.2, SVG Export Plug-In -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+ <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
+]>
+<svg version="1.1"
+ xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+ x="0px" y="0px" width="128px" height="128px" viewBox="0 0 128 128" overflow="visible" enable-background="new 0 0 128 128"
+ xml:space="preserve">
+<defs>
+</defs>
+<rect x="0" display="none" fill="#1A171B" width="128" height="128"/>
+<circle fill="#13235B" cx="64" cy="64" r="47"/>
+<g>
+ <g>
+ <path fill="#F29400" d="M14.352,113.699c0,0-13.927-13.928-3.122-24.732c7.203-7.205,11.706-2.701,15.308-6.305
+ c3.602-3.601,1.417-6.729,5.28-10.84c7.547-8.035,15.842,3.149,15.842,3.149l4.765,4.765l-7.204,7.204
+ c0,0,5.134,7.943,12.338,0.74c-3.827,10.578-9.411,9.39-13.014,12.99c-3.602,3.603,0.854,8.058-6.303,15.31
+ C27.508,126.855,14.352,113.699,14.352,113.699z"/>
+ </g>
+ <defs>
+ <filter id="Adobe_OpacityMaskFilter" filterUnits="userSpaceOnUse" x="7.122" y="68.918" width="50.437" height="51.368">
+
+ <feColorMatrix type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" color-interpolation-filters="sRGB" result="source"/>
+ </filter>
+ </defs>
+ <mask maskUnits="userSpaceOnUse" x="7.122" y="68.918" width="50.437" height="51.368" id="SVGID_1_">
+ <g filter="url(#Adobe_OpacityMaskFilter)">
+
+ <image overflow="visible" width="55" height="57" xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEASABIAAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMA
+EAMCAwYAAAG8AAACPgAAAr//2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoX
+Hh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoa
+JjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEIADkANwMBIgACEQEDEQH/
+xAB9AAABBQEBAAAAAAAAAAAAAAAAAgQFBgcBAwEBAAAAAAAAAAAAAAAAAAAAABAAAgMAAgICAwAA
+AAAAAAAAAgMBBAUABhBAMBEhEiMRAAICAQMFAQAAAAAAAAAAAAECABEhEEESIDFRIgMwEgEAAAAA
+AAAAAAAAAAAAAABA/9oADAMBAAIRAxEAAADPwAc+F5Kkx0alEcAdmuaSVq5PFkFles5qQR0J/T8X
+0IuyGbQrdAm4IAAcNwsnjAgpIAAf/9oACAECAAEFAPQ//9oACAEDAAEFAPQ//9oACAEBAAEFAPNa
+k2xx+W5UTExPlYSw8bI/jezBFerWBTeCJGVDrjrEZPT1qZUzgSvZT+qtc2zc516mL25WcuABIBHN
+loQvbZXln3+eruEG5bRJfGnAB27WJKzYbC5TslWfh7YECtNZDoagQvst6LDfNW8+qVbtBCN3sRtF
+jDYfw//aAAgBAgIGPwAH/9oACAEDAgY/AAf/2gAIAQEBBj8A1tRichkSj36FRcljUW12hsQlcHQK
+osnsIC952EH0ZbPkwCo1DaOrigD66cmF5gxMDRrMY4Jl7Tie9wVoTGCnJwIWc2Tov0U43i+0u4aM
+4A3m+i0bHiU5IMKoSSYXc2T+X//Z" transform="matrix(1 0 0 1 5.0005 66)">
+ </image>
+ </g>
+ </mask>
+ <g mask="url(#SVGID_1_)">
+ <path fill="#B20000" d="M14.352,113.699c0,0-13.927-13.928-3.122-24.732c7.203-7.205,11.706-2.701,15.308-6.305
+ c3.602-3.601,1.417-6.729,5.28-10.84c7.547-8.035,15.842,3.149,15.842,3.149l4.765,4.765l-7.204,7.204
+ c0,0,5.134,7.943,12.338,0.74c-3.827,10.578-9.411,9.39-13.014,12.99c-3.602,3.603,0.854,8.058-6.303,15.31
+ C27.508,126.855,14.352,113.699,14.352,113.699z"/>
+ </g>
+</g>
+<g>
+ <path fill="#FFEDB8" d="M37.791,69.168c5.189,0,9.624,5.894,9.692,5.98l4.588,4.588l-7.027,7.027l-0.143,0.143l0.11,0.17
+ c0.102,0.158,2.55,3.875,6.503,3.875c1.808,0,3.63-0.791,5.427-2.352c-2.541,6.327-5.777,7.936-8.649,9.362
+ c-1.422,0.707-2.765,1.374-3.924,2.532c-1.562,1.562-1.672,3.261-1.8,5.227c-0.171,2.633-0.384,5.909-4.504,10.084
+ c-2.771,2.808-5.958,4.231-9.472,4.231c-7.46,0-14-6.448-14.064-6.514c-0.137-0.138-13.625-13.877-3.122-24.379
+ c4.152-4.153,7.301-4.348,10.078-4.519c1.97-0.122,3.67-0.227,5.229-1.786c1.829-1.829,2.218-3.585,2.595-5.284
+ c0.384-1.735,0.782-3.529,2.69-5.562C33.761,70.118,35.709,69.168,37.791,69.168 M37.791,68.918c-1.932,0-3.979,0.781-5.974,2.904
+ c-3.862,4.11-1.678,7.239-5.28,10.84c-3.602,3.604-8.104-0.9-15.308,6.305c-10.805,10.805,3.122,24.732,3.122,24.732
+ s6.586,6.587,14.241,6.587c3.164,0,6.51-1.126,9.649-4.306c7.157-7.252,2.701-11.707,6.303-15.31
+ c3.603-3.601,9.187-2.412,13.014-12.99c-2.248,2.247-4.293,3.021-6.044,3.021c-3.862,0-6.293-3.761-6.293-3.761l7.204-7.204
+ l-4.765-4.765C47.66,74.972,43.17,68.918,37.791,68.918L37.791,68.918z"/>
+</g>
+<rect x="35.983" y="67.296" transform="matrix(-0.7071 0.7071 -0.7071 -0.7071 146.0415 81.7395)" fill="#41281B" width="40.217" height="7.64"/>
+<rect x="35.697" y="84.509" transform="matrix(-0.7073 0.707 -0.707 -0.7073 128.185 124.851)" fill="#ECEDED" width="5.092" height="8.913"/>
+<rect x="27.593" y="92.612" transform="matrix(-0.7072 0.7071 -0.7071 -0.7072 120.0864 144.402)" fill="#ECEDED" width="5.092" height="8.914"/>
+<rect x="24.55" y="96.293" transform="matrix(-0.7071 0.7071 -0.7071 -0.7071 115.1376 156.3543)" fill="#F6F6F6" width="1.273" height="11.46"/>
+<rect x="26.351" y="94.491" transform="matrix(-0.7071 0.7071 -0.7071 -0.7071 116.9377 152.0052)" fill="#F6F6F6" width="1.273" height="11.461"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="23.499" y1="99.433" x2="66.495" y2="56.438"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="28" y1="103.934" x2="70.997" y2="60.941"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="27.101" y1="103.034" x2="70.096" y2="60.04"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="26.2" y1="102.134" x2="69.196" y2="59.139"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="25.3" y1="101.233" x2="68.295" y2="58.239"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="24.4" y1="100.333" x2="67.395" y2="57.339"/>
+<circle fill="#1A171B" cx="26.908" cy="113.596" r="1.761"/>
+<path fill="#1A171B" d="M33.138,107.366c0.688,0.687,0.688,1.804,0,2.493c-0.688,0.686-1.804,0.686-2.492,0
+ c-0.688-0.689-0.688-1.807,0-2.493C31.334,106.678,32.45,106.678,33.138,107.366z"/>
+<circle fill="#FFEDB8" cx="36.848" cy="75.131" r="1.762"/>
+<circle fill="#1A171B" cx="32.31" cy="115.397" r="1.762"/>
+<path fill="#1A171B" d="M38.54,109.167c0.689,0.687,0.689,1.804,0,2.493c-0.688,0.686-1.804,0.686-2.492,0
+ c-0.688-0.689-0.688-1.807,0-2.493C36.736,108.479,37.852,108.479,38.54,109.167z"/>
+<g>
+ <g>
+ <path fill="#ECEDED" d="M105.895,10.52l2.704,2.702L70.764,51.056c0,0-2.702,2.702,0,5.404c2.704,2.702,5.405,0,5.405,0
+ l37.833-37.833l2.704,2.702c0,0-35.132,35.131-37.835,37.833c-2.702,2.702-8.107,2.702-10.81,0s-2.702-8.106,0-10.809
+ C70.765,45.649,105.895,10.52,105.895,10.52z"/>
+ </g>
+ <defs>
+ <filter id="Adobe_OpacityMaskFilter_1_" filterUnits="userSpaceOnUse" x="66.036" y="10.52" width="50.671" height="50.669">
+
+ <feColorMatrix type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" color-interpolation-filters="sRGB" result="source"/>
+ </filter>
+ </defs>
+ <mask maskUnits="userSpaceOnUse" x="66.036" y="10.52" width="50.671" height="50.669" id="SVGID_2_">
+ <g filter="url(#Adobe_OpacityMaskFilter_1_)">
+
+ <image overflow="visible" width="55" height="56" xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEASABIAAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMA
+EAMCAwYAAAGyAAACNwAAA9T/2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoX
+Hh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoa
+JjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEIADgANwMBIgACEQEDEQH/
+xACCAAEBAQADAAAAAAAAAAAAAAAABgQDBQcBAQAAAAAAAAAAAAAAAAAAAAAQAQEBAAIDAQEAAAAA
+AAAAAAUEBhADACBAAQIRAAIBAgQEBgIDAQAAAAAAAAECAxEEACFREjHBQgUQIGEyUhNBFZEiIwYS
+AQAAAAAAAAAAAAAAAAAAAED/2gAMAwEAAhEDEQAAAPPwDcOwp4w61WCTNwt0YL95scjGN1vxSIv3
+mwzgBUdyENnAAD//2gAIAQIAAQUA+D//2gAIAQMAAQUA+D//2gAIAQEAAQUA9Bx7GLNSHCL3+g49
+jFiKJuMNONS0CLmRkOQ4HHsYsRRNxhppqWgSqqJwxPatd3JeDj2MWIom4w001LQJVVE4Ym66pCrw
+cexixFE3GGmmpaBKqonDE3XVIVcZ+r9JwppqWgSqqJwxN11SFXOV1/8ABHR3bgAvouuqQq9P/9oA
+CAECAgY/AAf/2gAIAQMCBj8AB//aAAgBAQEGPwDyLaWi1Jzdz7UXU4ht7e4+2bb/ALJxofl6eVbS
+0WpObufai6nH6ztlJO4yCskhzNT1vyGPrjrJNId00zZhQepuQx22xhudz3kkcMgNNw3sF3j+fFbS
+0WpObufai6nH6ztlJO4yCskhzNT1vyGPrjrJNId00zZhQepuQwLe3AlvpRkOt3+TaAYXuksm+6SR
+ZVY8AUO5QBoPBbS0WpObufai6nH6ztlJO4yCskhzNT1vyGPrjrJNId00zZhQepuQwLe3AlvpRkOt
+3+TaAYe7u3Mk0hqSeAGg9PBbS0WpObufai6nH6ztlJO4yCskhzNT1vyGPrjrJNId00zZhQepuQwL
+e3AlvpRkOt3+TaAYe7u3Mk0hqSeAGg9PGfuVrFW6ZnBYCpru2Bm9Fx9cdZJpDummbMKD1NyGBb24
+Et9KMh1u/wAm0Aw93duZJpDUk8ANB6eRu33sJnspGJyoSm7j/X8j84ZP+fsgJJM2IT6lB9cqnD3d
+25kmkNSTwA0Hp5f/2Q==" transform="matrix(1 0 0 1 64.0005 8)">
+ </image>
+ </g>
+ </mask>
+ <g opacity="0.77" mask="url(#SVGID_2_)">
+ <path fill="#1C1B1B" d="M105.895,10.52l2.704,2.702L70.764,51.056c0,0-2.702,2.702,0,5.404c2.704,2.702,5.405,0,5.405,0
+ l37.833-37.833l2.704,2.702c0,0-35.132,35.131-37.835,37.833c-2.702,2.702-8.107,2.702-10.81,0s-2.702-8.106,0-10.809
+ C70.765,45.649,105.895,10.52,105.895,10.52z"/>
+ </g>
+</g>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="40.044" y1="81.762" x2="45.447" y2="87.166"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="40.966" y1="80.84" x2="46.37" y2="86.241"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="41.96" y1="79.846" x2="47.363" y2="85.248"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="43.168" y1="78.639" x2="48.57" y2="84.042"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="44.587" y1="77.219" x2="49.99" y2="82.623"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="46.006" y1="75.801" x2="51.41" y2="81.203"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="47.285" y1="74.522" x2="52.688" y2="79.925"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="48.847" y1="72.961" x2="54.249" y2="78.362"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="50.621" y1="71.185" x2="56.023" y2="76.589"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="52.489" y1="69.329" x2="57.891" y2="74.731"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="54.405" y1="67.4" x2="59.709" y2="72.704"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="56.517" y1="65.392" x2="61.821" y2="70.696"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="59.166" y1="62.744" x2="64.469" y2="68.047"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="61.883" y1="60.026" x2="67.187" y2="65.329"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="64.902" y1="57.007" x2="70.206" y2="62.31"/>
+<g display="none">
+ <g display="inline">
+ <path fill="#F29400" d="M0,24.468C0,24.468,0,9,12,9c8,0,8,5,12,5s4.525-2.95,8.952-3.088C41.605,10.642,40,21.458,40,21.458
+ v5.291h-8c0,0-1.56,7.262,6.44,7.262C30.44,37.762,28,34,24,34c-4,0-4,4.948-12,5C0,39.078,0,24.468,0,24.468z"/>
+ </g>
+ <defs>
+ <filter id="Adobe_OpacityMaskFilter_2_" filterUnits="userSpaceOnUse" x="0" y="9" width="40.118" height="30">
+
+ <feColorMatrix type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" color-interpolation-filters="sRGB" result="source"/>
+ </filter>
+ </defs>
+ <mask maskUnits="userSpaceOnUse" x="0" y="9" width="40.118" height="30" id="SVGID_3_" display="inline">
+ <g filter="url(#Adobe_OpacityMaskFilter_2_)">
+
+ <image overflow="visible" width="46" height="35" xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEASABIAAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMA
+EAMCAwYAAAGrAAACBgAAAl3/2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoX
+Hh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoa
+JjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEIACMALgMBIgACEQEDEQH/
+xAB+AAABBQEBAAAAAAAAAAAAAAAAAgMFBgcEAQEBAAAAAAAAAAAAAAAAAAAAABAAAgMAAgIDAQAA
+AAAAAAAAAgMBBAUREzAGECAxFBEAAgEEAQMFAAAAAAAAAAAAAAERIUECElEQMYEgIkIDExIBAAAA
+AAAAAAAAAAAAAAAAMP/aAAwDAQACEQMRAAAAoEknQjPuDXogztq4Vo7NJyW2mgQdegRyGUyCwPEg
+AB//2gAIAQIAAQUA8P8A/9oACAEDAAEFAPD/AP/aAAgBAQABBQARkpr4r3DYxLKR6W8zUfA8TzjV
+4dZzMwJB2Mshs4aQm9VWsZAf7vXigbGW4IBllcDp3VwOtrlL+0u2nYmu6jvgIXPZxALHsLnTYdDi
++A/D+n//2gAIAQICBj8AH//aAAgBAwIGPwAf/9oACAEBAQY/AFjipbJdzZLY10c8QbPEi5WsCoVx
+G9UNJGONmxzyI7jhmX1pU5P1uLNdri9w4yHRwbX6/LwX8+j/2Q==" transform="matrix(1 0 0 1 -2.9995 6)">
+ </image>
+ </g>
+ </mask>
+ <g display="inline" mask="url(#SVGID_3_)">
+ <path fill="#B20000" d="M0,24.468C0,24.468,0,9,12,9c8,0,8,5,12,5s4.525-2.95,8.952-3.088C41.605,10.642,40,21.458,40,21.458
+ v5.291h-8c0,0-1.56,7.262,6.44,7.262C30.44,37.762,28,34,24,34c-4,0-4,4.948-12,5C0,39.078,0,24.468,0,24.468z"/>
+ </g>
+</g>
+<g display="none">
+ <path display="inline" fill="#FFEDB8" d="M12,9.25c4.592,0,6.439,1.633,8.07,3.075c1.169,1.033,2.179,1.926,3.93,1.926
+ c2.047,0,3.246-0.764,4.405-1.502c1.171-0.746,2.382-1.518,4.555-1.585c0.104-0.003,0.207-0.005,0.308-0.005
+ c2.021,0,3.606,0.649,4.712,1.931c2.537,2.939,1.782,8.28,1.771,8.37V26.5H32h-0.202l-0.042,0.197
+ c-0.028,0.13-0.663,3.21,1.127,5.426c0.979,1.211,2.483,1.913,4.481,2.093c-1.956,0.813-3.706,1.21-5.323,1.21
+ c-1.76,0-3.121-0.458-4.438-0.9C26.416,34.126,25.295,33.75,24,33.75c-1.755,0-2.766,0.888-3.937,1.916
+ c-1.631,1.432-3.479,3.054-8.064,3.084l-0.095,0C0.388,38.75,0.25,24.61,0.25,24.468C0.25,24.315,0.391,9.25,12,9.25 M12,9
+ C0,9,0,24.468,0,24.468S-0.002,39,11.904,39c0.031,0,0.064,0,0.096,0c8-0.052,8-5,12-5c2.67,0,4.644,1.675,8.041,1.675
+ c1.692,0,3.739-0.416,6.4-1.664c-8,0-6.44-7.262-6.44-7.262h8v-5.291c0,0,1.566-10.551-6.733-10.551
+ c-0.104,0-0.209,0.001-0.316,0.005C28.525,11.05,28,14,24,14S20,9,12,9L12,9z"/>
+</g>
+<rect x="31.032" y="21" display="none" fill="#41281B" width="32.967" height="6"/>
+<rect x="25" y="20.5" display="none" fill="#ECEDED" width="3.999" height="7"/>
+<rect x="16.001" y="20.5" display="none" fill="#ECEDED" width="3.999" height="7"/>
+<rect x="12" y="19.5" display="none" fill="#F6F6F6" width="1" height="9"/>
+<rect x="14" y="19.5" display="none" fill="#F6F6F6" width="1" height="9"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="13" y1="21.625" x2="60.75" y2="21.625"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="13" y1="26.625" x2="60.75" y2="26.625"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="13" y1="25.625" x2="60.75" y2="25.625"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="13" y1="24.625" x2="60.75" y2="24.625"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="13" y1="23.625" x2="60.75" y2="23.625"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="13" y1="22.625" x2="60.75" y2="22.625"/>
+<circle display="none" fill="#1A171B" cx="7.029" cy="31.382" r="1.384"/>
+<circle display="none" fill="#1A171B" cx="12.564" cy="31.382" r="1.384"/>
+<circle display="none" fill="#FFEDB8" cx="33.908" cy="15.543" r="1.384"/>
+<circle display="none" fill="#1A171B" cx="9.029" cy="35.382" r="1.384"/>
+<circle display="none" fill="#1A171B" cx="14.564" cy="35.382" r="1.384"/>
+<g display="none">
+ <g display="inline">
+ <path fill="#ECEDED" d="M124,16v4H68c0,0-4,0-4,4s4,4,4,4h56v4c0,0-52,0-56,0s-8-4-8-8s4-8,8-8C72.001,16,124,16,124,16z"/>
+ </g>
+ <defs>
+ <filter id="Adobe_OpacityMaskFilter_3_" filterUnits="userSpaceOnUse" x="60" y="16" width="64" height="16">
+
+ <feColorMatrix type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" color-interpolation-filters="sRGB" result="source"/>
+ </filter>
+ </defs>
+ <mask maskUnits="userSpaceOnUse" x="60" y="16" width="64" height="16" id="SVGID_4_" display="inline">
+ <g filter="url(#Adobe_OpacityMaskFilter_3_)">
+
+ <image overflow="visible" width="68" height="20" xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEASABIAAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMA
+EAMCAwYAAAGtAAACAQAAAsf/2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoX
+Hh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoa
+JjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEIABQARAMBIgACEQEDEQH/
+xACMAAEAAQUAAAAAAAAAAAAAAAAABQECAwQGAQEAAAAAAAAAAAAAAAAAAAAAEAABAgQGAwEAAAAA
+AAAAAAAABicCAwQWMBIUBRUlAREXBxEAAAQCBwcEAwAAAAAAAAAAAAERAhIDITGR0hOjREFxBBQ0
+BRVRYUIzIqKDEgEAAAAAAAAAAAAAAAAAAAAw/9oADAMBAAIRAxEAAACH3tvnSTQwmUMJm2IoarAM
+vTgoAC0OdB//2gAIAQIAAQUAwv/aAAgBAwABBQDC/9oACAEBAAEFAEmk4N2gnSvzWTMbUbUbUbUb
+Uj+c5eq5VKwU28pKpQ6lp5lnqUs9SlnqUs9SlnqUiSKjh8aKq1e08nrXL9OUOUOUOUOUR/R8va8r
+/9oACAECAgY/AC//2gAIAQMCBj8AL//aAAgBAQEGPwB3cO4Pwu3S1KtDeZV07CIHLN815trcw5jm
+nucVA1GaNRmjUZo1GaNRmg4Mddn2j5eNi94oUtrHEdjZOKXxZG80UyP8jiadCKXqIC4TGJFjlOI2
+/tCOgmWtvDoJlrbw6CZa28OgmWtvDoJlrbwV3ATCLe28OSwz5lYcOhVRQzxUfN0w4dabV2JvGoT+
+Q1GUNRlDUZQ1GUNRlA48dNv1D5eSi9ooksqH/9k=" transform="matrix(1 0 0 1 58.0005 14)">
+ </image>
+ </g>
+ </mask>
+ <g display="inline" opacity="0.75" mask="url(#SVGID_4_)">
+ <path fill="#1C1B1B" d="M124,16v4H68c0,0-4,0-4,4s4,4,4,4h56v4c0,0-52,0-56,0s-8-4-8-8s4-8,8-8C72.001,16,124,16,124,16z"/>
+ </g>
+</g>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="32" y1="21" x2="32" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="33.025" y1="21" x2="33.025" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="34.129" y1="21" x2="34.129" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="35.469" y1="21" x2="35.469" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="37.046" y1="21" x2="37.046" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="38.623" y1="21" x2="38.623" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="40.042" y1="21" x2="40.042" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="41.776" y1="21" x2="41.776" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="43.747" y1="21" x2="43.747" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="46.033" y1="21" x2="46.033" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="48.635" y1="21" x2="48.635" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="51.315" y1="21" x2="51.315" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="54.311" y1="21" x2="54.311" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="57.385" y1="21" x2="57.385" y2="27"/>
+</svg>
diff --git a/demos/mobile/guitartuner/images/inputMode.svg b/demos/mobile/guitartuner/images/inputMode.svg
new file mode 100644
index 0000000..f95991a
--- /dev/null
+++ b/demos/mobile/guitartuner/images/inputMode.svg
@@ -0,0 +1,161 @@
+<?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="690.84283"
+ height="597.90881"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="inputMode.svg">
+ <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="perspective3604"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3622"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3622-7"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3653"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3653-4"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3653-8"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.7"
+ inkscape:cx="220.15692"
+ inkscape:cy="262.65754"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1280"
+ inkscape:window-height="888"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ showguides="true"
+ inkscape:guide-bbox="true" />
+ <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" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-9.1421334,-233.17919)">
+ <path
+ sodipodi:type="arc"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:10;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="path3620"
+ sodipodi:cx="64.649765"
+ sodipodi:cy="472.53461"
+ sodipodi:rx="117.1777"
+ sodipodi:ry="268.70059"
+ d="m 181.82746,472.53461 c 0,148.39924 -52.46224,268.70059 -117.177695,268.70059 -64.71545463,0 -117.177696,-120.30135 -117.177696,-268.70059 0,-148.39924 52.46224137,-268.7006 117.177696,-268.7006 64.715455,0 117.177695,120.30136 117.177695,268.7006 z"
+ transform="matrix(2.8726899,0,0,1.0798196,168.84482,21.881457)" />
+ <g
+ id="g3694"
+ transform="translate(14.702487,2.8571428)">
+ <path
+ sodipodi:nodetypes="cccc"
+ id="path2830"
+ d="m 261.68027,406.82393 36.36549,359.61431 82.97781,0 38.24049,-359.61431"
+ style="fill:none;stroke:#000000;stroke-width:14.10000038;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ transform="translate(-11.060917,113.98119)"
+ d="m 442.4468,276.6803 c 0,49.09448 -41.15572,88.89342 -91.92388,88.89342 -50.76816,0 -91.92388,-39.79894 -91.92388,-88.89342 0,-49.09449 41.15572,-88.89343 91.92388,-88.89343 50.76816,0 91.92388,39.79894 91.92388,88.89343 z"
+ sodipodi:ry="88.893425"
+ sodipodi:rx="91.923882"
+ sodipodi:cy="276.6803"
+ sodipodi:cx="350.52292"
+ id="path2826"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:17.61199951;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ sodipodi:type="arc" />
+ <path
+ id="path3610"
+ d="M 417.09557,336.26145 265.86811,447.10263"
+ style="fill:none;stroke:#000000;stroke-width:8.15200043;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ id="path3610-1"
+ d="M 370.02409,308.17608 244.86468,399.91085"
+ style="fill:none;stroke:#000000;stroke-width:8.15200043;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ id="path3610-4"
+ d="M 266.87874,335.24091 418.10619,446.08209"
+ style="fill:none;stroke:#000000;stroke-width:8.15200043;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ id="path3610-4-9"
+ d="M 306.03234,300.77574 436.914,396.7046"
+ style="fill:none;stroke:#000000;stroke-width:8.15200043;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ id="path3610-4-8"
+ d="m 246.61065,376.5921 132.66972,97.23942"
+ style="fill:none;stroke:#000000;stroke-width:8.15200043;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ id="path3610-4-2"
+ d="M 433.44049,380.0107 304.57747,474.46002"
+ style="fill:none;stroke:#000000;stroke-width:8.15200043;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ </g>
+</svg>
diff --git a/demos/mobile/guitartuner/images/note.svg b/demos/mobile/guitartuner/images/note.svg
new file mode 100644
index 0000000..c1f1771
--- /dev/null
+++ b/demos/mobile/guitartuner/images/note.svg
@@ -0,0 +1,101 @@
+<?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="690.84283"
+ height="597.90881"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="New document 1">
+ <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="perspective3604"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.49497475"
+ inkscape:cx="586.90391"
+ inkscape:cy="224.44944"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1280"
+ inkscape:window-height="888"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1" />
+ <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" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-9.1421334,-233.17919)">
+ <path
+ sodipodi:type="arc"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:10;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="path3620"
+ sodipodi:cx="64.649765"
+ sodipodi:cy="472.53461"
+ sodipodi:rx="117.1777"
+ sodipodi:ry="268.70059"
+ d="m 181.82746,472.53461 c 0,148.39924 -52.46224,268.70059 -117.177695,268.70059 -64.71545463,0 -117.177696,-120.30135 -117.177696,-268.70059 0,-148.39924 52.46224137,-268.7006 117.177696,-268.7006 64.715455,0 117.177695,120.30136 117.177695,268.7006 z"
+ transform="matrix(2.8726899,0,0,1.0798196,168.84482,21.881457)" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:10;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 355.87166,686.47203 0,-381.77521"
+ id="path2816"
+ sodipodi:nodetypes="cc" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="path2818"
+ sodipodi:cx="284.86301"
+ sodipodi:cy="703.85956"
+ sodipodi:rx="80.812202"
+ sodipodi:ry="83.842659"
+ d="m 365.67521,703.85956 c 0,46.30502 -36.18086,83.84266 -80.8122,83.84266 -44.63135,0 -80.81221,-37.53764 -80.81221,-83.84266 0,-46.30502 36.18086,-83.84266 80.81221,-83.84266 44.63134,0 80.8122,37.53764 80.8122,83.84266 z"
+ transform="matrix(0.86662604,0,0,0.86662604,41.962127,84.107402)" />
+ <path
+ style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:3.49788642;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ d="M 498.23775,478.96203 C 487.43102,436.20815 446.22124,431.4938 416.5823,423.48582 381.21648,411.5191 365.03425,382.76349 358.75673,339.52089 l -2.02761,-36.99987 c 12.76379,33.73415 40.64336,44.6109 67.22015,53.67478 46.38196,11.01541 67.31525,50.25786 74.72373,107.8334 0.48397,6.08567 0.99901,19.27869 0.75259,19.27869 -0.0715,0 -0.60616,-1.95564 -1.1881,-4.34586 l 0,0 2.6e-4,0 z"
+ id="path3618"
+ sodipodi:nodetypes="ccccccsccc" />
+ </g>
+</svg>
diff --git a/demos/mobile/guitartuner/images/noteNo.svg b/demos/mobile/guitartuner/images/noteNo.svg
new file mode 100644
index 0000000..888d230
--- /dev/null
+++ b/demos/mobile/guitartuner/images/noteNo.svg
@@ -0,0 +1,105 @@
+<?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="690.84283"
+ height="597.90881"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="noteCrossed.svg">
+ <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="perspective3604"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.49497475"
+ inkscape:cx="289.91906"
+ inkscape:cy="224.44944"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1280"
+ inkscape:window-height="888"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1" />
+ <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" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-9.1421334,-233.17919)">
+ <path
+ sodipodi:type="arc"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:10;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="path3620"
+ sodipodi:cx="64.649765"
+ sodipodi:cy="472.53461"
+ sodipodi:rx="117.1777"
+ sodipodi:ry="268.70059"
+ d="m 181.82746,472.53461 c 0,148.39924 -52.46224,268.70059 -117.177695,268.70059 -64.71545463,0 -117.177696,-120.30135 -117.177696,-268.70059 0,-148.39924 52.46224137,-268.7006 117.177696,-268.7006 64.715455,0 117.177695,120.30136 117.177695,268.7006 z"
+ transform="matrix(2.8726899,0,0,1.0798196,168.84482,21.881457)" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:10;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 355.87166,686.47203 0,-381.77521"
+ id="path2816"
+ sodipodi:nodetypes="cc" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="path2818"
+ sodipodi:cx="284.86301"
+ sodipodi:cy="703.85956"
+ sodipodi:rx="80.812202"
+ sodipodi:ry="83.842659"
+ d="m 365.67521,703.85956 c 0,46.30502 -36.18086,83.84266 -80.8122,83.84266 -44.63135,0 -80.81221,-37.53764 -80.81221,-83.84266 0,-46.30502 36.18086,-83.84266 80.81221,-83.84266 44.63134,0 80.8122,37.53764 80.8122,83.84266 z"
+ transform="matrix(0.86662604,0,0,0.86662604,41.962127,84.107402)" />
+ <path
+ style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:3.49788642;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ d="M 498.23775,478.96203 C 487.43102,436.20815 446.22124,431.4938 416.5823,423.48582 381.21648,411.5191 365.03425,382.76349 358.75673,339.52089 l -2.02761,-36.99987 c 12.76379,33.73415 40.64336,44.6109 67.22015,53.67478 46.38196,11.01541 67.31525,50.25786 74.72373,107.8334 0.48397,6.08567 0.99901,19.27869 0.75259,19.27869 -0.0715,0 -0.60616,-1.95564 -1.1881,-4.34586 l 0,0 2.6e-4,0 z"
+ id="path3618"
+ sodipodi:nodetypes="ccccccsccc" />
+ <path
+ style="fill:none;stroke:#ff0000;stroke-width:16;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 176.92972,346.31704 369.5113,373.55192"
+ id="path2817" />
+ </g>
+</svg>
diff --git a/demos/mobile/guitartuner/src/application.qml b/demos/mobile/guitartuner/src/application.qml
new file mode 100644
index 0000000..7da138d
--- /dev/null
+++ b/demos/mobile/guitartuner/src/application.qml
@@ -0,0 +1,328 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "mycomponents"
+
+/* The base canvas for all QML drawing. */
+Rectangle {
+ id: application
+
+ property int targetNoteIndex: 0
+ property alias frequency: noteChooser.currentFrequency
+ //Data provided to C++.
+ property bool isInput: true
+ property bool isMuted: false
+ property bool isAuto: true
+ property alias maxVoiceDifference: voiceDifferenceMeter.maxValue
+ property real volume: 0.5
+ property real sensitivity: 0.5
+
+ //Signals to C++.
+ signal volumeChanged(real volume)
+ signal microphoneSensitivityChanged(real sensitivity)
+ signal targetFrequencyChanged(real frequency)
+ signal modeChanged(bool isInput)
+ signal muteStateChanged(bool isMuted)
+
+ //Slots for signals coming from C++.
+ function voiceDifferenceChanged(difference) {
+ if (isAuto) timer.running = true;
+ voiceDifferenceMeter.valueChanged(difference);
+ noteImage.glowing = false
+ }
+ function correctFrequencyObtained() {
+ noteImage.glowing = true
+ }
+ function lowVoice() {
+ noteImage.glowing = false
+ }
+
+ //Private function for changing the target frequency automatically.
+ function calculateTargetFrequency(difference) {
+ var tempDifference = Math.abs(difference);
+ var tempIndex = targetNoteIndex
+ while (!(difference < 0 && tempIndex == 0) &&
+ tempDifference >= notes.get(tempIndex-(difference<0)).interval/2) {
+ tempDifference -= notes.get(tempIndex-(difference<0)).interval;
+ tempIndex += difference/Math.abs(difference);
+ }
+ if (tempIndex != targetNoteIndex) {
+ targetNoteIndex = tempIndex
+ noteChooser.currentFrequency = notes.get(targetNoteIndex).frequency;
+ targetFrequencyChanged(frequency);
+ }
+ }
+
+ width: 360; height: 640
+ color: "black"
+
+ //Provides data for functions.
+ NotesModel {id: notes}
+
+ /* A timer for changing the target frequency automatically.
+ * This is needed for avoiding recursion. */
+ Timer {
+ id: timer
+
+ interval: 1
+ onTriggered: calculateTargetFrequency(voiceDifferenceMeter.value)
+ }
+
+ //A meter for showing the difference between current and target frequency.
+ Meter {
+ id: voiceDifferenceMeter
+
+ maxValue: 12
+ minValue: -maxValue
+ height: imageSize.height/background.sourceSize.height*parent.height
+ width: imageSize.width/background.sourceSize.width*parent.width
+ anchors {
+ topMargin: 100/background.sourceSize.height*parent.height
+ horizontalCenter: parent.horizontalCenter
+ top: parent.top
+ }
+ }
+
+ Image {
+ id: background
+
+ anchors.fill: parent
+ smooth: true
+ source: "./mycomponents/images/guitartuner_skin.png"
+ }
+
+ //A button for quitting the application.
+ Image {
+ id: quitButton
+
+ width: sourceSize.width/background.sourceSize.width*parent.width
+ height: sourceSize.height/background.sourceSize.height*parent.height
+ source: "./mycomponents/images/power.png"
+ smooth: true
+ KeyNavigation.up: volumeAdjuster
+ KeyNavigation.down: modeButton
+ Keys.onEnterPressed: Qt.quit()
+ anchors{
+ leftMargin: 297/background.sourceSize.width*parent.width
+ left: parent.left;
+ topMargin: 17/background.sourceSize.height*parent.height
+ top: parent.top
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: Qt.quit()
+ }
+ }
+
+ //An image for showing the target note.
+ Image {
+ id: noteImage
+
+ property bool glowing: false
+
+ width: sourceSize.width/background.sourceSize.width*parent.width
+ height: sourceSize.height/background.sourceSize.height*parent.height
+ source: glowing ? notes.get(targetNoteIndex).glowSource : notes.get(targetNoteIndex).bigSource
+
+ anchors {
+ topMargin: 273/background.sourceSize.height*parent.height
+ top: parent.top
+ horizontalCenter: parent.horizontalCenter
+ }
+ }
+
+ //A button for choosing the input/output mode.
+ Image {
+ id: modeButton
+
+ function buttonPressed() {
+ isInput = !isInput
+ modeChanged(isInput)
+ if (isInput) {
+ soundIcons.source = "./mycomponents/images/sensitivity.png"
+ source = "./mycomponents/images/voicemode_off.png"
+ volumeAdjuster.setValue(sensitivity)
+ }
+ else {
+ //Change off from "auto" mode
+ if (isAuto) {
+ noteChooser.pushButton(targetNoteIndex)
+ }
+ if (isMuted) {
+ soundIcons.source = "./mycomponents/images/volume_off.png";
+ }
+ else
+ soundIcons.source = "./mycomponents/images/volume.png"
+ source = "./mycomponents/images/voicemode_on.png"
+ volumeAdjuster.setValue(volume)
+ }
+ }
+
+ width: sourceSize.width/background.sourceSize.width*parent.width
+ height: sourceSize.height/background.sourceSize.height*parent.height
+ smooth: true
+ source: "./mycomponents/images/voicemode_off.png"
+ KeyNavigation.up: quitButton
+ KeyNavigation.down: noteChooser
+ Keys.onEnterPressed: buttonPressed()
+ anchors {
+ leftMargin: 16/background.sourceSize.width*parent.width
+ left: parent.left
+ topMargin: 353/background.sourceSize.height*parent.height
+ top: parent.top
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ parent.focus = true
+ parent.scale = 0.95
+ }
+ onReleased: {
+ parent.scale = 1/0.95
+ }
+ onClicked: parent.buttonPressed()
+ }
+ }
+
+ //Buttons for choosing the target note.
+ NoteButtonView {
+ id: noteChooser
+
+ width: parent.width*0.95; height: width/model.count
+ onNoteSelected: {
+ if (note == "Auto") {
+ if (!isAuto) {
+ isAuto = true
+ }
+ if (!isInput) {
+ modeButton.buttonPressed()
+ }
+ }
+ else {
+ timer.running = false;
+ isAuto = false
+ targetNoteIndex = index
+ targetFrequencyChanged(frequency)
+ }
+ focus = true
+ }
+ KeyNavigation.up: modeButton
+ KeyNavigation.down: soundIcons
+ anchors {
+ horizontalCenter: parent.horizontalCenter
+ topMargin: 454/background.sourceSize.height*parent.height
+ top: parent.top
+ }
+ }
+
+ //An element for showing the mode and changing the mute state.
+ Image {
+ id: soundIcons
+
+ function stateChanged() {
+ isMuted = !isMuted
+ muteStateChanged(isMuted)
+ if (isMuted) {
+ source = "qrc:/src/mycomponents/images/volume_off.png"
+ }
+ else {
+ source = "qrc:/src/mycomponents/images/volume.png"
+ }
+ }
+
+ width: sourceSize.width/background.sourceSize.width*parent.width
+ height: sourceSize.height/background.sourceSize.height*parent.height
+ smooth: true
+ source: "./mycomponents/images/sensitivity.png"
+ Keys.onEnterPressed: stateChanged()
+ KeyNavigation.up: noteChooser
+ KeyNavigation.down: quitButton
+ KeyNavigation.left: volumeAdjuster
+ KeyNavigation.right: volumeAdjuster
+ anchors {
+ leftMargin: 42/background.sourceSize.width*parent.width
+ left: parent.left
+ topMargin: 565/background.sourceSize.height*parent.height
+ top: parent.top
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (!isInput) {
+ parent.stateChanged()
+ }
+ parent.focus = true
+ }
+ }
+ }
+
+ //An element for adjusting volume.
+ Adjuster {
+ id: volumeAdjuster
+
+ max: 1
+ value: 0.5
+ width: 222/background.sourceSize.width*parent.width
+ height: parent.height*0.1
+ onFocusChangedByClick: focus = true
+ onArrowPressedWhenValueOverLimits: soundIcons.focus = true
+ KeyNavigation.up: modeButton
+ KeyNavigation.down: quitButton
+ anchors {
+ leftMargin: 98/background.sourceSize.width*parent.width
+ left: parent.left
+ verticalCenter: soundIcons.verticalCenter
+ }
+ onValueChanged: {
+ if (isInput) {
+ sensitivity = value;
+ microphoneSensitivityChanged(1-sensitivity)
+ }
+ else {
+ volume = value
+ volumeChanged(volume)
+ }
+ }
+ }
+}
diff --git a/demos/mobile/guitartuner/src/constants.h b/demos/mobile/guitartuner/src/constants.h
new file mode 100644
index 0000000..c3eddaa
--- /dev/null
+++ b/demos/mobile/guitartuner/src/constants.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef CONSTANTS_H
+#define CONSTANTS_H
+
+#define M_MAX_AMPLITUDE_8BIT_SIGNED 127
+#define M_MAX_AMPLITUDE_8BIT_UNSIGNED 255
+#define M_MAX_AMPLITUDE_16BIT_SIGNED 32767
+#define M_MAX_AMPLITUDE_16BIT_UNSIGNED 65535
+
+#define M_TWELTH_ROOT_OF_2 1.05946309435930000000
+
+// M_SAMPLE_COUNT_MULTIPLIER is 2/(M_TWELTH_ROOT_OF_2 - 1)
+#define M_SAMPLE_COUNT_MULTIPLIER 33.63430749021150000000
+
+#endif // CONSTANTS_H
diff --git a/demos/mobile/guitartuner/src/fastfouriertransformer.cpp b/demos/mobile/guitartuner/src/fastfouriertransformer.cpp
new file mode 100644
index 0000000..9158fd4
--- /dev/null
+++ b/demos/mobile/guitartuner/src/fastfouriertransformer.cpp
@@ -0,0 +1,184 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "fastfouriertransformer.h"
+#include "math.h"
+
+#define STIN inline
+#define __STATIC
+
+#include "fftpack.c"
+
+// called by __ogg_fdrffti
+__STATIC void drfti1(int n, float *wa, int *ifac);
+void __ogg_fdrffti(int n, float *wsave, int *ifac);
+void __ogg_fdcosqi(int n, float *wsave, int *ifac);
+// called by drftf1
+STIN void dradf2(int ido,int l1,float *cc,float *ch,float *wa1);
+// called by drftf1
+STIN void dradf4(int ido,int l1,float *cc,float *ch,float *wa1,
+ float *wa2,float *wa3);
+// called by drftf1
+STIN void dradfg(int ido,int ip,int l1,int idl1,float *cc,float *c1,
+ float *c2,float *ch,float *ch2,float *wa);
+// called by drftf1
+STIN void drftf1(int n,float *c,float *ch,float *wa,int *ifac);
+void __ogg_fdrfftf(int n,float *r,float *wsave,int *ifac);
+STIN void dcsqf1(int n,float *x,float *w,float *xh,int *ifac);
+void __ogg_fdcosqf(int n,float *x,float *wsave,int *ifac);
+STIN void dradb2(int ido,int l1,float *cc,float *ch,float *wa1);
+STIN void dradb3(int ido,int l1,float *cc,float *ch,float *wa1,
+ float *wa2);
+STIN void dradb4(int ido,int l1,float *cc,float *ch,float *wa1,
+ float *wa2,float *wa3);
+STIN void dradbg(int ido,int ip,int l1,int idl1,float *cc,float *c1,
+ float *c2,float *ch,float *ch2,float *wa);
+STIN void drftb1(int n, float *c, float *ch, float *wa, int *ifac);
+void __ogg_fdrfftb(int n, float *r, float *wsave, int *ifac);
+STIN void dcsqb1(int n,float *x,float *w,float *xh,int *ifac);
+void __ogg_fdcosqb(int n,float *x,float *wsave,int *ifac);
+
+FastFourierTransformer::FastFourierTransformer(QObject *parent) :
+ QObject(parent),
+ m_waveFloat(0),
+ m_workingArray(0),
+ m_ifac(0),
+ m_last_n(-1)
+{
+}
+
+FastFourierTransformer::~FastFourierTransformer()
+{
+ if (m_waveFloat != 0) {
+ delete [] m_waveFloat;
+ }
+ if (m_workingArray != 0) {
+ delete [] m_workingArray;
+ }
+ if (m_ifac != 0) {
+ delete [] m_ifac;
+ }
+}
+
+/**
+ * Prepares the arrays to be of length n.
+ */
+void FastFourierTransformer::reserve(int n)
+{
+ Q_ASSERT(n>0);
+ if (m_waveFloat != 0) {
+ delete [] m_waveFloat;
+ }
+ if (m_workingArray != 0) {
+ delete [] m_workingArray;
+ }
+ if (m_ifac != 0) {
+ delete [] m_ifac;
+ }
+ m_workingArray = new float[2*n+15];
+ m_waveFloat = new float[n];
+ m_ifac = new int[n];
+ __ogg_fdrffti(n, m_workingArray, m_ifac);
+ m_last_n = n;
+}
+
+/**
+ * Calculates the Fast Fourier Transformation (FFT).
+ */
+void FastFourierTransformer::calculateFFT(QList<qint16> wave)
+{
+ const int n = wave.size();
+ if (m_last_n != n) {
+ reserve(n);
+ }
+ for (int i = 0; i < n; i++) {
+ m_waveFloat[i] = (float) wave.at(i);
+ }
+
+ __ogg_fdrfftf(n, m_waveFloat, m_workingArray, m_ifac);
+
+}
+
+/**
+ * Returns the index which corresponds to the maximum density
+ * of the FFT.
+ */
+int FastFourierTransformer::getMaximumDensityIndex()
+{
+ const int halfN = m_last_n / 2;
+ float maxDensity = 0;
+ int maxDensityIndex = 0;
+ float densitySquared = 0.f;
+ for (int k = 1; k < halfN; k++) {
+ // Here, we calculate the frequency k/N.
+ // k=1, the wave oscillation time is N, and the frequency
+ // is 1/sample.
+ // k=2, the wave oscillation time is N/2, and the frequency
+ // is 2/sample.
+ // k=3, the wave oscillation time is N/3, and the frequency
+ // is 3/sample.
+ // Note, that the documentation is for Fortran, so indexes in the
+ // documentation does not match.
+ // The sine and cosine coefficients are obtained thus as follows:
+ const float cosCoefficient = qAbs(m_waveFloat[2*k-1]);
+ const float sinCoefficient = qAbs(m_waveFloat[2*k]);
+
+ densitySquared = sinCoefficient*sinCoefficient + cosCoefficient*cosCoefficient;
+ if (densitySquared > maxDensity) {
+ maxDensity = densitySquared;
+ maxDensityIndex = k;
+ }
+ }
+
+ if (m_cutOffForDensitySquared < maxDensity) {
+ return maxDensityIndex;
+ }
+ else {
+ return -1;
+ }
+}
+
+/**
+ * Sets the cutoff density.
+ */
+void FastFourierTransformer::setCutOffForDensity(float cutoff)
+{
+ m_cutOffForDensitySquared = cutoff*cutoff;
+}
diff --git a/demos/mobile/guitartuner/src/fastfouriertransformer.h b/demos/mobile/guitartuner/src/fastfouriertransformer.h
new file mode 100644
index 0000000..d126b45
--- /dev/null
+++ b/demos/mobile/guitartuner/src/fastfouriertransformer.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef FASTFOURIERTRANSFORM_H
+#define FASTFOURIERTRANSFORM_H
+
+#include <QObject>
+#include <QList>
+
+class FastFourierTransformer : public QObject
+{
+ Q_OBJECT
+
+public:
+ FastFourierTransformer(QObject *parent = 0);
+ ~FastFourierTransformer();
+ void reserve(int n);
+ void calculateFFT(QList<qint16> wave);
+ int getMaximumDensityIndex();
+ void setCutOffForDensity(float cutoff);
+
+private:
+ float *m_waveFloat;
+ float *m_workingArray;
+ int *m_ifac;
+ int m_last_n;
+ float m_cutOffForDensitySquared;
+};
+
+#endif // FASTFOURIERTRANSFORM_H
diff --git a/demos/mobile/guitartuner/src/fftpack.c b/demos/mobile/guitartuner/src/fftpack.c
new file mode 100644
index 0000000..24eaa57
--- /dev/null
+++ b/demos/mobile/guitartuner/src/fftpack.c
@@ -0,0 +1,1406 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/********************************************************************
+
+ The routines in this file are from http://www.netlib.org/fftpack/.
+ According to the comments in the original file (which are provided below)
+ and according to the wikipedia article about the FFTPACK[1],
+ they are released as public domain.
+
+ For information about the author of the original, Fortran routines,
+ and the author of the C translation these routines,
+ see the comments below.
+
+ [1] http://en.wikipedia.org/wiki/FFTPACK, referenced 2010-12-21.
+
+ ********************************************************************/
+
+/********************************************************************
+
+ file: fft.c
+ function: Fast discrete Fourier and cosine transforms and inverses
+ author: Monty <xiphmont@mit.edu>
+ modifications by: Monty
+ last modification date: Jul 1 1996
+
+ ********************************************************************/
+
+/* These Fourier routines were originally based on the Fourier
+ routines of the same names from the NETLIB bihar and fftpack
+ fortran libraries developed by Paul N. Swarztrauber at the National
+ Center for Atmospheric Research in Boulder, CO USA. They have been
+ reimplemented in C and optimized in a few ways for OggSquish. */
+
+/* As the original fortran libraries are public domain, the C Fourier
+ routines in this file are hereby released to the public domain as
+ well. The C routines here produce output exactly equivalent to the
+ original fortran routines. Of particular interest are the facts
+ that (like the original fortran), these routines can work on
+ arbitrary length vectors that need not be powers of two in
+ length. */
+
+#include <math.h>
+
+__STATIC void drfti1(int n, float *wa, int *ifac){
+ static int ntryh[4] = { 4,2,3,5 };
+ static float tpi = 6.28318530717958647692528676655900577;
+ float arg,argh,argld,fi;
+ int ntry=0,i,j=-1;
+ int k1, l1, l2, ib;
+ int ld, ii, ip, is, nq, nr;
+ int ido, ipm, nfm1;
+ int nl=n;
+ int nf=0;
+
+ L101:
+ j++;
+ if (j < 4)
+ ntry=ntryh[j];
+ else
+ ntry+=2;
+
+ L104:
+ nq=nl/ntry;
+ nr=nl-ntry*nq;
+ if (nr!=0) goto L101;
+
+ nf++;
+ ifac[nf+1]=ntry;
+ nl=nq;
+ if (ntry!=2) goto L107;
+ if (nf==1) goto L107;
+
+ for (i=1;i<nf;i++){
+ ib=nf-i+1;
+ ifac[ib+1]=ifac[ib];
+ }
+ ifac[2] = 2;
+
+ L107:
+ if (nl!=1) goto L104;
+ ifac[0]=n;
+ ifac[1]=nf;
+ argh=tpi/n;
+ is=0;
+ nfm1=nf-1;
+ l1=1;
+
+ if (nfm1==0) return;
+
+ for (k1=0;k1<nfm1;k1++){
+ ip=ifac[k1+2];
+ ld=0;
+ l2=l1*ip;
+ ido=n/l2;
+ ipm=ip-1;
+
+ for (j=0;j<ipm;j++){
+ ld+=l1;
+ i=is;
+ argld=(float)ld*argh;
+ fi=0.;
+ for (ii=2;ii<ido;ii+=2){
+ fi+=1.;
+ arg=fi*argld;
+ wa[i++]=cos(arg);
+ wa[i++]=sin(arg);
+ }
+ is+=ido;
+ }
+ l1=l2;
+ }
+}
+
+void __ogg_fdrffti(int n, float *wsave, int *ifac){
+
+ if (n == 1) return;
+ drfti1(n, wsave+n, ifac);
+}
+
+void __ogg_fdcosqi(int n, float *wsave, int *ifac){
+ static float pih = 1.57079632679489661923132169163975;
+ static int k;
+ static float fk, dt;
+
+ dt=pih/n;
+ fk=0.;
+ for (k=0;k<n;k++){
+ fk+=1.;
+ wsave[k] = cos(fk*dt);
+ }
+
+ __ogg_fdrffti(n, wsave+n,ifac);
+}
+
+STIN void dradf2(int ido,int l1,float *cc,float *ch,float *wa1){
+ int i,k;
+ float ti2,tr2;
+ int t0,t1,t2,t3,t4,t5,t6;
+
+ t1=0;
+ t0=(t2=l1*ido);
+ t3=ido<<1;
+ for (k=0;k<l1;k++){
+ ch[t1<<1]=cc[t1]+cc[t2];
+ ch[(t1<<1)+t3-1]=cc[t1]-cc[t2];
+ t1+=ido;
+ t2+=ido;
+ }
+
+ if (ido<2) return;
+ if (ido==2) goto L105;
+
+ t1=0;
+ t2=t0;
+ for (k=0;k<l1;k++){
+ t3=t2;
+ t4=(t1<<1)+(ido<<1);
+ t5=t1;
+ t6=t1+t1;
+ for (i=2;i<ido;i+=2){
+ t3+=2;
+ t4-=2;
+ t5+=2;
+ t6+=2;
+ tr2=wa1[i-2]*cc[t3-1]+wa1[i-1]*cc[t3];
+ ti2=wa1[i-2]*cc[t3]-wa1[i-1]*cc[t3-1];
+ ch[t6]=cc[t5]+ti2;
+ ch[t4]=ti2-cc[t5];
+ ch[t6-1]=cc[t5-1]+tr2;
+ ch[t4-1]=cc[t5-1]-tr2;
+ }
+ t1+=ido;
+ t2+=ido;
+ }
+
+ if (ido%2==1) return;
+
+ L105:
+ t3=(t2=(t1=ido)-1);
+ t2+=t0;
+ for (k=0;k<l1;k++){
+ ch[t1]=-cc[t2];
+ ch[t1-1]=cc[t3];
+ t1+=ido<<1;
+ t2+=ido;
+ t3+=ido;
+ }
+}
+
+STIN void dradf4(int ido,int l1,float *cc,float *ch,float *wa1,
+ float *wa2,float *wa3){
+ static float hsqt2 = .70710678118654752440084436210485;
+ int i,k,t0,t1,t2,t3,t4,t5,t6;
+ float ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4;
+ t0=l1*ido;
+
+ t1=t0;
+ t4=t1<<1;
+ t2=t1+(t1<<1);
+ t3=0;
+
+ for (k=0;k<l1;k++){
+ tr1=cc[t1]+cc[t2];
+ tr2=cc[t3]+cc[t4];
+ ch[t5=t3<<2]=tr1+tr2;
+ ch[(ido<<2)+t5-1]=tr2-tr1;
+ ch[(t5+=(ido<<1))-1]=cc[t3]-cc[t4];
+ ch[t5]=cc[t2]-cc[t1];
+
+ t1+=ido;
+ t2+=ido;
+ t3+=ido;
+ t4+=ido;
+ }
+
+ if (ido<2) return;
+ if (ido==2) goto L105;
+
+ t1=0;
+ for (k=0;k<l1;k++){
+ t2=t1;
+ t4=t1<<2;
+ t5=(t6=ido<<1)+t4;
+ for (i=2;i<ido;i+=2){
+ t3=(t2+=2);
+ t4+=2;
+ t5-=2;
+
+ t3+=t0;
+ cr2=wa1[i-2]*cc[t3-1]+wa1[i-1]*cc[t3];
+ ci2=wa1[i-2]*cc[t3]-wa1[i-1]*cc[t3-1];
+ t3+=t0;
+ cr3=wa2[i-2]*cc[t3-1]+wa2[i-1]*cc[t3];
+ ci3=wa2[i-2]*cc[t3]-wa2[i-1]*cc[t3-1];
+ t3+=t0;
+ cr4=wa3[i-2]*cc[t3-1]+wa3[i-1]*cc[t3];
+ ci4=wa3[i-2]*cc[t3]-wa3[i-1]*cc[t3-1];
+
+ tr1=cr2+cr4;
+ tr4=cr4-cr2;
+ ti1=ci2+ci4;
+ ti4=ci2-ci4;
+ ti2=cc[t2]+ci3;
+ ti3=cc[t2]-ci3;
+ tr2=cc[t2-1]+cr3;
+ tr3=cc[t2-1]-cr3;
+
+
+ ch[t4-1]=tr1+tr2;
+ ch[t4]=ti1+ti2;
+
+ ch[t5-1]=tr3-ti4;
+ ch[t5]=tr4-ti3;
+
+ ch[t4+t6-1]=ti4+tr3;
+ ch[t4+t6]=tr4+ti3;
+
+ ch[t5+t6-1]=tr2-tr1;
+ ch[t5+t6]=ti1-ti2;
+ }
+ t1+=ido;
+ }
+ if (ido%2==1) return;
+
+ L105:
+
+ t2=(t1=t0+ido-1)+(t0<<1);
+ t3=ido<<2;
+ t4=ido;
+ t5=ido<<1;
+ t6=ido;
+
+ for (k=0;k<l1;k++){
+ ti1=-hsqt2*(cc[t1]+cc[t2]);
+ tr1=hsqt2*(cc[t1]-cc[t2]);
+ ch[t4-1]=tr1+cc[t6-1];
+ ch[t4+t5-1]=cc[t6-1]-tr1;
+ ch[t4]=ti1-cc[t1+t0];
+ ch[t4+t5]=ti1+cc[t1+t0];
+ t1+=ido;
+ t2+=ido;
+ t4+=t3;
+ t6+=ido;
+ }
+}
+
+STIN void dradfg(int ido,int ip,int l1,int idl1,float *cc,float *c1,
+ float *c2,float *ch,float *ch2,float *wa){
+
+ static float tpi=6.28318530717958647692528676655900577;
+ int idij,ipph,i,j,k,l,ic,ik,is;
+ int t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
+ float dc2,ai1,ai2,ar1,ar2,ds2;
+ int nbd;
+ float dcp,arg,dsp,ar1h,ar2h;
+ int idp2,ipp2;
+
+ arg=tpi/(float)ip;
+ dcp=cos(arg);
+ dsp=sin(arg);
+ ipph=(ip+1)>>1;
+ ipp2=ip;
+ idp2=ido;
+ nbd=(ido-1)>>1;
+ t0=l1*ido;
+ t10=ip*ido;
+
+ if (ido==1) goto L119;
+ for (ik=0;ik<idl1;ik++)ch2[ik]=c2[ik];
+
+ t1=0;
+ for (j=1;j<ip;j++){
+ t1+=t0;
+ t2=t1;
+ for (k=0;k<l1;k++){
+ ch[t2]=c1[t2];
+ t2+=ido;
+ }
+ }
+
+ is=-ido;
+ t1=0;
+ if (nbd>l1){
+ for (j=1;j<ip;j++){
+ t1+=t0;
+ is+=ido;
+ t2= -ido+t1;
+ for (k=0;k<l1;k++){
+ idij=is-1;
+ t2+=ido;
+ t3=t2;
+ for (i=2;i<ido;i+=2){
+ idij+=2;
+ t3+=2;
+ ch[t3-1]=wa[idij-1]*c1[t3-1]+wa[idij]*c1[t3];
+ ch[t3]=wa[idij-1]*c1[t3]-wa[idij]*c1[t3-1];
+ }
+ }
+ }
+ }else{
+
+ for (j=1;j<ip;j++){
+ is+=ido;
+ idij=is-1;
+ t1+=t0;
+ t2=t1;
+ for (i=2;i<ido;i+=2){
+ idij+=2;
+ t2+=2;
+ t3=t2;
+ for (k=0;k<l1;k++){
+ ch[t3-1]=wa[idij-1]*c1[t3-1]+wa[idij]*c1[t3];
+ ch[t3]=wa[idij-1]*c1[t3]-wa[idij]*c1[t3-1];
+ t3+=ido;
+ }
+ }
+ }
+ }
+
+ t1=0;
+ t2=ipp2*t0;
+ if (nbd<l1){
+ for (j=1;j<ipph;j++){
+ t1+=t0;
+ t2-=t0;
+ t3=t1;
+ t4=t2;
+ for (i=2;i<ido;i+=2){
+ t3+=2;
+ t4+=2;
+ t5=t3-ido;
+ t6=t4-ido;
+ for (k=0;k<l1;k++){
+ t5+=ido;
+ t6+=ido;
+ c1[t5-1]=ch[t5-1]+ch[t6-1];
+ c1[t6-1]=ch[t5]-ch[t6];
+ c1[t5]=ch[t5]+ch[t6];
+ c1[t6]=ch[t6-1]-ch[t5-1];
+ }
+ }
+ }
+ }else{
+ for (j=1;j<ipph;j++){
+ t1+=t0;
+ t2-=t0;
+ t3=t1;
+ t4=t2;
+ for (k=0;k<l1;k++){
+ t5=t3;
+ t6=t4;
+ for (i=2;i<ido;i+=2){
+ t5+=2;
+ t6+=2;
+ c1[t5-1]=ch[t5-1]+ch[t6-1];
+ c1[t6-1]=ch[t5]-ch[t6];
+ c1[t5]=ch[t5]+ch[t6];
+ c1[t6]=ch[t6-1]-ch[t5-1];
+ }
+ t3+=ido;
+ t4+=ido;
+ }
+ }
+ }
+
+L119:
+ for (ik=0;ik<idl1;ik++)c2[ik]=ch2[ik];
+
+ t1=0;
+ t2=ipp2*idl1;
+ for (j=1;j<ipph;j++){
+ t1+=t0;
+ t2-=t0;
+ t3=t1-ido;
+ t4=t2-ido;
+ for (k=0;k<l1;k++){
+ t3+=ido;
+ t4+=ido;
+ c1[t3]=ch[t3]+ch[t4];
+ c1[t4]=ch[t4]-ch[t3];
+ }
+ }
+
+ ar1=1.;
+ ai1=0.;
+ t1=0;
+ t2=ipp2*idl1;
+ t3=(ip-1)*idl1;
+ for (l=1;l<ipph;l++){
+ t1+=idl1;
+ t2-=idl1;
+ ar1h=dcp*ar1-dsp*ai1;
+ ai1=dcp*ai1+dsp*ar1;
+ ar1=ar1h;
+ t4=t1;
+ t5=t2;
+ t6=t3;
+ t7=idl1;
+
+ for (ik=0;ik<idl1;ik++){
+ ch2[t4++]=c2[ik]+ar1*c2[t7++];
+ ch2[t5++]=ai1*c2[t6++];
+ }
+
+ dc2=ar1;
+ ds2=ai1;
+ ar2=ar1;
+ ai2=ai1;
+
+ t4=idl1;
+ t5=(ipp2-1)*idl1;
+ for (j=2;j<ipph;j++){
+ t4+=idl1;
+ t5-=idl1;
+
+ ar2h=dc2*ar2-ds2*ai2;
+ ai2=dc2*ai2+ds2*ar2;
+ ar2=ar2h;
+
+ t6=t1;
+ t7=t2;
+ t8=t4;
+ t9=t5;
+ for (ik=0;ik<idl1;ik++){
+ ch2[t6++]+=ar2*c2[t8++];
+ ch2[t7++]+=ai2*c2[t9++];
+ }
+ }
+ }
+
+ t1=0;
+ for (j=1;j<ipph;j++){
+ t1+=idl1;
+ t2=t1;
+ for (ik=0;ik<idl1;ik++)ch2[ik]+=c2[t2++];
+ }
+
+ if (ido<l1) goto L132;
+
+ t1=0;
+ t2=0;
+ for (k=0;k<l1;k++){
+ t3=t1;
+ t4=t2;
+ for (i=0;i<ido;i++)cc[t4++]=ch[t3++];
+ t1+=ido;
+ t2+=t10;
+ }
+
+ goto L135;
+
+ L132:
+ for (i=0;i<ido;i++){
+ t1=i;
+ t2=i;
+ for (k=0;k<l1;k++){
+ cc[t2]=ch[t1];
+ t1+=ido;
+ t2+=t10;
+ }
+ }
+
+ L135:
+ t1=0;
+ t2=ido<<1;
+ t3=0;
+ t4=ipp2*t0;
+ for (j=1;j<ipph;j++){
+
+ t1+=t2;
+ t3+=t0;
+ t4-=t0;
+
+ t5=t1;
+ t6=t3;
+ t7=t4;
+
+ for (k=0;k<l1;k++){
+ cc[t5-1]=ch[t6];
+ cc[t5]=ch[t7];
+ t5+=t10;
+ t6+=ido;
+ t7+=ido;
+ }
+ }
+
+ if (ido==1) return;
+ if (nbd<l1) goto L141;
+
+ t1=-ido;
+ t3=0;
+ t4=0;
+ t5=ipp2*t0;
+ for (j=1;j<ipph;j++){
+ t1+=t2;
+ t3+=t2;
+ t4+=t0;
+ t5-=t0;
+ t6=t1;
+ t7=t3;
+ t8=t4;
+ t9=t5;
+ for (k=0;k<l1;k++){
+ for (i=2;i<ido;i+=2){
+ ic=idp2-i;
+ cc[i+t7-1]=ch[i+t8-1]+ch[i+t9-1];
+ cc[ic+t6-1]=ch[i+t8-1]-ch[i+t9-1];
+ cc[i+t7]=ch[i+t8]+ch[i+t9];
+ cc[ic+t6]=ch[i+t9]-ch[i+t8];
+ }
+ t6+=t10;
+ t7+=t10;
+ t8+=ido;
+ t9+=ido;
+ }
+ }
+ return;
+
+ L141:
+
+ t1=-ido;
+ t3=0;
+ t4=0;
+ t5=ipp2*t0;
+ for (j=1;j<ipph;j++){
+ t1+=t2;
+ t3+=t2;
+ t4+=t0;
+ t5-=t0;
+ for (i=2;i<ido;i+=2){
+ t6=idp2+t1-i;
+ t7=i+t3;
+ t8=i+t4;
+ t9=i+t5;
+ for (k=0;k<l1;k++){
+ cc[t7-1]=ch[t8-1]+ch[t9-1];
+ cc[t6-1]=ch[t8-1]-ch[t9-1];
+ cc[t7]=ch[t8]+ch[t9];
+ cc[t6]=ch[t9]-ch[t8];
+ t6+=t10;
+ t7+=t10;
+ t8+=ido;
+ t9+=ido;
+ }
+ }
+ }
+}
+
+STIN void drftf1(int n,float *c,float *ch,float *wa,int *ifac){
+ int i,k1,l1,l2;
+ int na,kh,nf;
+ int ip,iw,ido,idl1,ix2,ix3;
+
+ nf=ifac[1];
+ na=1;
+ l2=n;
+ iw=n;
+
+ for (k1=0;k1<nf;k1++){
+ kh=nf-k1;
+ ip=ifac[kh+1];
+ l1=l2/ip;
+ ido=n/l2;
+ idl1=ido*l1;
+ iw-=(ip-1)*ido;
+ na=1-na;
+
+ if (ip!=4) goto L102;
+
+ ix2=iw+ido;
+ ix3=ix2+ido;
+ if (na!=0)
+ dradf4(ido,l1,ch,c,wa+iw-1,wa+ix2-1,wa+ix3-1);
+ else
+ dradf4(ido,l1,c,ch,wa+iw-1,wa+ix2-1,wa+ix3-1);
+ goto L110;
+
+ L102:
+ if (ip!=2) goto L104;
+ if (na!=0) goto L103;
+
+ dradf2(ido,l1,c,ch,wa+iw-1);
+ goto L110;
+
+ L103:
+ dradf2(ido,l1,ch,c,wa+iw-1);
+ goto L110;
+
+ L104:
+ if (ido==1)na=1-na;
+ if (na!=0) goto L109;
+
+ dradfg(ido,ip,l1,idl1,c,c,c,ch,ch,wa+iw-1);
+ na=1;
+ goto L110;
+
+ L109:
+ dradfg(ido,ip,l1,idl1,ch,ch,ch,c,c,wa+iw-1);
+ na=0;
+
+ L110:
+ l2=l1;
+ }
+
+ if (na==1) return;
+
+ for (i=0;i<n;i++)c[i]=ch[i];
+}
+
+void __ogg_fdrfftf(int n,float *r,float *wsave,int *ifac){
+ if (n==1) return;
+ drftf1(n,r,wsave,wsave+n,ifac);
+}
+
+STIN void dcsqf1(int n,float *x,float *w,float *xh,int *ifac){
+ int modn,i,k,kc;
+ int np2,ns2;
+ float xim1;
+
+ ns2=(n+1)>>1;
+ np2=n;
+
+ kc=np2;
+ for (k=1;k<ns2;k++){
+ kc--;
+ xh[k]=x[k]+x[kc];
+ xh[kc]=x[k]-x[kc];
+ }
+
+ modn=n%2;
+ if (modn==0)xh[ns2]=x[ns2]+x[ns2];
+
+ for (k=1;k<ns2;k++){
+ kc=np2-k;
+ x[k]=w[k-1]*xh[kc]+w[kc-1]*xh[k];
+ x[kc]=w[k-1]*xh[k]-w[kc-1]*xh[kc];
+ }
+
+ if (modn==0)x[ns2]=w[ns2-1]*xh[ns2];
+
+ __ogg_fdrfftf(n,x,xh,ifac);
+
+ for (i=2;i<n;i+=2){
+ xim1=x[i-1]-x[i];
+ x[i]=x[i-1]+x[i];
+ x[i-1]=xim1;
+ }
+}
+
+void __ogg_fdcosqf(int n,float *x,float *wsave,int *ifac){
+ static float sqrt2=1.4142135623730950488016887242097;
+ float tsqx;
+
+ switch (n){
+ case 0:case 1:
+ return;
+ case 2:
+ tsqx=sqrt2*x[1];
+ x[1]=x[0]-tsqx;
+ x[0]+=tsqx;
+ return;
+ default:
+ dcsqf1(n,x,wsave,wsave+n,ifac);
+ return;
+ }
+}
+
+STIN void dradb2(int ido,int l1,float *cc,float *ch,float *wa1){
+ int i,k,t0,t1,t2,t3,t4,t5,t6;
+ float ti2,tr2;
+
+ t0=l1*ido;
+
+ t1=0;
+ t2=0;
+ t3=(ido<<1)-1;
+ for (k=0;k<l1;k++){
+ ch[t1]=cc[t2]+cc[t3+t2];
+ ch[t1+t0]=cc[t2]-cc[t3+t2];
+ t2=(t1+=ido)<<1;
+ }
+
+ if (ido<2) return;
+ if (ido==2) goto L105;
+
+ t1=0;
+ t2=0;
+ for (k=0;k<l1;k++){
+ t3=t1;
+ t5=(t4=t2)+(ido<<1);
+ t6=t0+t1;
+ for (i=2;i<ido;i+=2){
+ t3+=2;
+ t4+=2;
+ t5-=2;
+ t6+=2;
+ ch[t3-1]=cc[t4-1]+cc[t5-1];
+ tr2=cc[t4-1]-cc[t5-1];
+ ch[t3]=cc[t4]-cc[t5];
+ ti2=cc[t4]+cc[t5];
+ ch[t6-1]=wa1[i-2]*tr2-wa1[i-1]*ti2;
+ ch[t6]=wa1[i-2]*ti2+wa1[i-1]*tr2;
+ }
+ t2=(t1+=ido)<<1;
+ }
+
+ if (ido%2==1) return;
+
+L105:
+ t1=ido-1;
+ t2=ido-1;
+ for (k=0;k<l1;k++){
+ ch[t1]=cc[t2]+cc[t2];
+ ch[t1+t0]=-(cc[t2+1]+cc[t2+1]);
+ t1+=ido;
+ t2+=ido<<1;
+ }
+}
+
+STIN void dradb3(int ido,int l1,float *cc,float *ch,float *wa1,
+ float *wa2){
+ static float taur = -.5;
+ static float taui = .86602540378443864676372317075293618;
+ int i,k,t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
+ float ci2,ci3,di2,di3,cr2,cr3,dr2,dr3,ti2,tr2;
+ t0=l1*ido;
+
+ t1=0;
+ t2=t0<<1;
+ t3=ido<<1;
+ t4=ido+(ido<<1);
+ t5=0;
+ for (k=0;k<l1;k++){
+ tr2=cc[t3-1]+cc[t3-1];
+ cr2=cc[t5]+(taur*tr2);
+ ch[t1]=cc[t5]+tr2;
+ ci3=taui*(cc[t3]+cc[t3]);
+ ch[t1+t0]=cr2-ci3;
+ ch[t1+t2]=cr2+ci3;
+ t1+=ido;
+ t3+=t4;
+ t5+=t4;
+ }
+
+ if (ido==1) return;
+
+ t1=0;
+ t3=ido<<1;
+ for (k=0;k<l1;k++){
+ t7=t1+(t1<<1);
+ t6=(t5=t7+t3);
+ t8=t1;
+ t10=(t9=t1+t0)+t0;
+
+ for (i=2;i<ido;i+=2){
+ t5+=2;
+ t6-=2;
+ t7+=2;
+ t8+=2;
+ t9+=2;
+ t10+=2;
+ tr2=cc[t5-1]+cc[t6-1];
+ cr2=cc[t7-1]+(taur*tr2);
+ ch[t8-1]=cc[t7-1]+tr2;
+ ti2=cc[t5]-cc[t6];
+ ci2=cc[t7]+(taur*ti2);
+ ch[t8]=cc[t7]+ti2;
+ cr3=taui*(cc[t5-1]-cc[t6-1]);
+ ci3=taui*(cc[t5]+cc[t6]);
+ dr2=cr2-ci3;
+ dr3=cr2+ci3;
+ di2=ci2+cr3;
+ di3=ci2-cr3;
+ ch[t9-1]=wa1[i-2]*dr2-wa1[i-1]*di2;
+ ch[t9]=wa1[i-2]*di2+wa1[i-1]*dr2;
+ ch[t10-1]=wa2[i-2]*dr3-wa2[i-1]*di3;
+ ch[t10]=wa2[i-2]*di3+wa2[i-1]*dr3;
+ }
+ t1+=ido;
+ }
+}
+
+STIN void dradb4(int ido,int l1,float *cc,float *ch,float *wa1,
+ float *wa2,float *wa3){
+ static float sqrt2=1.4142135623730950488016887242097;
+ int i,k,t0,t1,t2,t3,t4,t5,t6,t7,t8;
+ float ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4;
+ t0=l1*ido;
+
+ t1=0;
+ t2=ido<<2;
+ t3=0;
+ t6=ido<<1;
+ for (k=0;k<l1;k++){
+ t4=t3+t6;
+ t5=t1;
+ tr3=cc[t4-1]+cc[t4-1];
+ tr4=cc[t4]+cc[t4];
+ tr1=cc[t3]-cc[(t4+=t6)-1];
+ tr2=cc[t3]+cc[t4-1];
+ ch[t5]=tr2+tr3;
+ ch[t5+=t0]=tr1-tr4;
+ ch[t5+=t0]=tr2-tr3;
+ ch[t5+=t0]=tr1+tr4;
+ t1+=ido;
+ t3+=t2;
+ }
+
+ if (ido<2) return;
+ if (ido==2) goto L105;
+
+ t1=0;
+ for (k=0;k<l1;k++){
+ t5=(t4=(t3=(t2=t1<<2)+t6))+t6;
+ t7=t1;
+ for (i=2;i<ido;i+=2){
+ t2+=2;
+ t3+=2;
+ t4-=2;
+ t5-=2;
+ t7+=2;
+ ti1=cc[t2]+cc[t5];
+ ti2=cc[t2]-cc[t5];
+ ti3=cc[t3]-cc[t4];
+ tr4=cc[t3]+cc[t4];
+ tr1=cc[t2-1]-cc[t5-1];
+ tr2=cc[t2-1]+cc[t5-1];
+ ti4=cc[t3-1]-cc[t4-1];
+ tr3=cc[t3-1]+cc[t4-1];
+ ch[t7-1]=tr2+tr3;
+ cr3=tr2-tr3;
+ ch[t7]=ti2+ti3;
+ ci3=ti2-ti3;
+ cr2=tr1-tr4;
+ cr4=tr1+tr4;
+ ci2=ti1+ti4;
+ ci4=ti1-ti4;
+
+ ch[(t8=t7+t0)-1]=wa1[i-2]*cr2-wa1[i-1]*ci2;
+ ch[t8]=wa1[i-2]*ci2+wa1[i-1]*cr2;
+ ch[(t8+=t0)-1]=wa2[i-2]*cr3-wa2[i-1]*ci3;
+ ch[t8]=wa2[i-2]*ci3+wa2[i-1]*cr3;
+ ch[(t8+=t0)-1]=wa3[i-2]*cr4-wa3[i-1]*ci4;
+ ch[t8]=wa3[i-2]*ci4+wa3[i-1]*cr4;
+ }
+ t1+=ido;
+ }
+
+ if (ido%2 == 1) return;
+
+ L105:
+
+ t1=ido;
+ t2=ido<<2;
+ t3=ido-1;
+ t4=ido+(ido<<1);
+ for (k=0;k<l1;k++){
+ t5=t3;
+ ti1=cc[t1]+cc[t4];
+ ti2=cc[t4]-cc[t1];
+ tr1=cc[t1-1]-cc[t4-1];
+ tr2=cc[t1-1]+cc[t4-1];
+ ch[t5]=tr2+tr2;
+ ch[t5+=t0]=sqrt2*(tr1-ti1);
+ ch[t5+=t0]=ti2+ti2;
+ ch[t5+=t0]=-sqrt2*(tr1+ti1);
+
+ t3+=ido;
+ t1+=t2;
+ t4+=t2;
+ }
+}
+
+STIN void dradbg(int ido,int ip,int l1,int idl1,float *cc,float *c1,
+ float *c2,float *ch,float *ch2,float *wa){
+ static float tpi=6.28318530717958647692528676655900577;
+ int idij,ipph,i,j,k,l,ik,is,t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,
+ t11,t12;
+ float dc2,ai1,ai2,ar1,ar2,ds2;
+ int nbd;
+ float dcp,arg,dsp,ar1h,ar2h;
+ int ipp2;
+
+ t10=ip*ido;
+ t0=l1*ido;
+ arg=tpi/(float)ip;
+ dcp=cos(arg);
+ dsp=sin(arg);
+ nbd=(ido-1)>>1;
+ ipp2=ip;
+ ipph=(ip+1)>>1;
+ if (ido<l1) goto L103;
+
+ t1=0;
+ t2=0;
+ for (k=0;k<l1;k++){
+ t3=t1;
+ t4=t2;
+ for (i=0;i<ido;i++){
+ ch[t3]=cc[t4];
+ t3++;
+ t4++;
+ }
+ t1+=ido;
+ t2+=t10;
+ }
+ goto L106;
+
+ L103:
+ t1=0;
+ for (i=0;i<ido;i++){
+ t2=t1;
+ t3=t1;
+ for (k=0;k<l1;k++){
+ ch[t2]=cc[t3];
+ t2+=ido;
+ t3+=t10;
+ }
+ t1++;
+ }
+
+ L106:
+ t1=0;
+ t2=ipp2*t0;
+ t7=(t5=ido<<1);
+ for (j=1;j<ipph;j++){
+ t1+=t0;
+ t2-=t0;
+ t3=t1;
+ t4=t2;
+ t6=t5;
+ for (k=0;k<l1;k++){
+ ch[t3]=cc[t6-1]+cc[t6-1];
+ ch[t4]=cc[t6]+cc[t6];
+ t3+=ido;
+ t4+=ido;
+ t6+=t10;
+ }
+ t5+=t7;
+ }
+
+ if (ido == 1) goto L116;
+ if (nbd<l1) goto L112;
+
+ t1=0;
+ t2=ipp2*t0;
+ t7=0;
+ for (j=1;j<ipph;j++){
+ t1+=t0;
+ t2-=t0;
+ t3=t1;
+ t4=t2;
+
+ t7+=(ido<<1);
+ t8=t7;
+ for (k=0;k<l1;k++){
+ t5=t3;
+ t6=t4;
+ t9=t8;
+ t11=t8;
+ for (i=2;i<ido;i+=2){
+ t5+=2;
+ t6+=2;
+ t9+=2;
+ t11-=2;
+ ch[t5-1]=cc[t9-1]+cc[t11-1];
+ ch[t6-1]=cc[t9-1]-cc[t11-1];
+ ch[t5]=cc[t9]-cc[t11];
+ ch[t6]=cc[t9]+cc[t11];
+ }
+ t3+=ido;
+ t4+=ido;
+ t8+=t10;
+ }
+ }
+ goto L116;
+
+ L112:
+ t1=0;
+ t2=ipp2*t0;
+ t7=0;
+ for (j=1;j<ipph;j++){
+ t1+=t0;
+ t2-=t0;
+ t3=t1;
+ t4=t2;
+ t7+=(ido<<1);
+ t8=t7;
+ t9=t7;
+ for (i=2;i<ido;i+=2){
+ t3+=2;
+ t4+=2;
+ t8+=2;
+ t9-=2;
+ t5=t3;
+ t6=t4;
+ t11=t8;
+ t12=t9;
+ for (k=0;k<l1;k++){
+ ch[t5-1]=cc[t11-1]+cc[t12-1];
+ ch[t6-1]=cc[t11-1]-cc[t12-1];
+ ch[t5]=cc[t11]-cc[t12];
+ ch[t6]=cc[t11]+cc[t12];
+ t5+=ido;
+ t6+=ido;
+ t11+=t10;
+ t12+=t10;
+ }
+ }
+ }
+
+L116:
+ ar1=1.;
+ ai1=0.;
+ t1=0;
+ t9=(t2=ipp2*idl1);
+ t3=(ip-1)*idl1;
+ for (l=1;l<ipph;l++){
+ t1+=idl1;
+ t2-=idl1;
+
+ ar1h=dcp*ar1-dsp*ai1;
+ ai1=dcp*ai1+dsp*ar1;
+ ar1=ar1h;
+ t4=t1;
+ t5=t2;
+ t6=0;
+ t7=idl1;
+ t8=t3;
+ for (ik=0;ik<idl1;ik++){
+ c2[t4++]=ch2[t6++]+ar1*ch2[t7++];
+ c2[t5++]=ai1*ch2[t8++];
+ }
+ dc2=ar1;
+ ds2=ai1;
+ ar2=ar1;
+ ai2=ai1;
+
+ t6=idl1;
+ t7=t9-idl1;
+ for (j=2;j<ipph;j++){
+ t6+=idl1;
+ t7-=idl1;
+ ar2h=dc2*ar2-ds2*ai2;
+ ai2=dc2*ai2+ds2*ar2;
+ ar2=ar2h;
+ t4=t1;
+ t5=t2;
+ t11=t6;
+ t12=t7;
+ for (ik=0;ik<idl1;ik++){
+ c2[t4++]+=ar2*ch2[t11++];
+ c2[t5++]+=ai2*ch2[t12++];
+ }
+ }
+ }
+
+ t1=0;
+ for (j=1;j<ipph;j++){
+ t1+=idl1;
+ t2=t1;
+ for (ik=0;ik<idl1;ik++)ch2[ik]+=ch2[t2++];
+ }
+
+ t1=0;
+ t2=ipp2*t0;
+ for (j=1;j<ipph;j++){
+ t1+=t0;
+ t2-=t0;
+ t3=t1;
+ t4=t2;
+ for (k=0;k<l1;k++){
+ ch[t3]=c1[t3]-c1[t4];
+ ch[t4]=c1[t3]+c1[t4];
+ t3+=ido;
+ t4+=ido;
+ }
+ }
+
+ if (ido==1) goto L132;
+ if (nbd<l1) goto L128;
+
+ t1=0;
+ t2=ipp2*t0;
+ for (j=1;j<ipph;j++){
+ t1+=t0;
+ t2-=t0;
+ t3=t1;
+ t4=t2;
+ for (k=0;k<l1;k++){
+ t5=t3;
+ t6=t4;
+ for (i=2;i<ido;i+=2){
+ t5+=2;
+ t6+=2;
+ ch[t5-1]=c1[t5-1]-c1[t6];
+ ch[t6-1]=c1[t5-1]+c1[t6];
+ ch[t5]=c1[t5]+c1[t6-1];
+ ch[t6]=c1[t5]-c1[t6-1];
+ }
+ t3+=ido;
+ t4+=ido;
+ }
+ }
+ goto L132;
+
+ L128:
+ t1=0;
+ t2=ipp2*t0;
+ for (j=1;j<ipph;j++){
+ t1+=t0;
+ t2-=t0;
+ t3=t1;
+ t4=t2;
+ for (i=2;i<ido;i+=2){
+ t3+=2;
+ t4+=2;
+ t5=t3;
+ t6=t4;
+ for (k=0;k<l1;k++){
+ ch[t5-1]=c1[t5-1]-c1[t6];
+ ch[t6-1]=c1[t5-1]+c1[t6];
+ ch[t5]=c1[t5]+c1[t6-1];
+ ch[t6]=c1[t5]-c1[t6-1];
+ t5+=ido;
+ t6+=ido;
+ }
+ }
+ }
+
+L132:
+ if (ido==1) return;
+
+ for (ik=0;ik<idl1;ik++)c2[ik]=ch2[ik];
+
+ t1=0;
+ for (j=1;j<ip;j++){
+ t2=(t1+=t0);
+ for (k=0;k<l1;k++){
+ c1[t2]=ch[t2];
+ t2+=ido;
+ }
+ }
+
+ if (nbd>l1) goto L139;
+
+ is= -ido-1;
+ t1=0;
+ for (j=1;j<ip;j++){
+ is+=ido;
+ t1+=t0;
+ idij=is;
+ t2=t1;
+ for (i=2;i<ido;i+=2){
+ t2+=2;
+ idij+=2;
+ t3=t2;
+ for (k=0;k<l1;k++){
+ c1[t3-1]=wa[idij-1]*ch[t3-1]-wa[idij]*ch[t3];
+ c1[t3]=wa[idij-1]*ch[t3]+wa[idij]*ch[t3-1];
+ t3+=ido;
+ }
+ }
+ }
+ return;
+
+ L139:
+ is= -ido-1;
+ t1=0;
+ for (j=1;j<ip;j++){
+ is+=ido;
+ t1+=t0;
+ t2=t1;
+ for (k=0;k<l1;k++){
+ idij=is;
+ t3=t2;
+ for (i=2;i<ido;i+=2){
+ idij+=2;
+ t3+=2;
+ c1[t3-1]=wa[idij-1]*ch[t3-1]-wa[idij]*ch[t3];
+ c1[t3]=wa[idij-1]*ch[t3]+wa[idij]*ch[t3-1];
+ }
+ t2+=ido;
+ }
+ }
+}
+
+STIN void drftb1(int n, float *c, float *ch, float *wa, int *ifac){
+ int i,k1,l1,l2;
+ int na;
+ int nf,ip,iw,ix2,ix3,ido,idl1;
+
+ nf=ifac[1];
+ na=0;
+ l1=1;
+ iw=1;
+
+ for (k1=0;k1<nf;k1++){
+ ip=ifac[k1 + 2];
+ l2=ip*l1;
+ ido=n/l2;
+ idl1=ido*l1;
+ if (ip!=4) goto L103;
+ ix2=iw+ido;
+ ix3=ix2+ido;
+
+ if (na!=0)
+ dradb4(ido,l1,ch,c,wa+iw-1,wa+ix2-1,wa+ix3-1);
+ else
+ dradb4(ido,l1,c,ch,wa+iw-1,wa+ix2-1,wa+ix3-1);
+ na=1-na;
+ goto L115;
+
+ L103:
+ if (ip!=2) goto L106;
+
+ if (na!=0)
+ dradb2(ido,l1,ch,c,wa+iw-1);
+ else
+ dradb2(ido,l1,c,ch,wa+iw-1);
+ na=1-na;
+ goto L115;
+
+ L106:
+ if (ip!=3) goto L109;
+
+ ix2=iw+ido;
+ if (na!=0)
+ dradb3(ido,l1,ch,c,wa+iw-1,wa+ix2-1);
+ else
+ dradb3(ido,l1,c,ch,wa+iw-1,wa+ix2-1);
+ na=1-na;
+ goto L115;
+
+ L109:
+/* The radix five case can be translated later..... */
+/* if (ip!=5) goto L112;
+
+ ix2=iw+ido;
+ ix3=ix2+ido;
+ ix4=ix3+ido;
+ if (na!=0)
+ dradb5(ido,l1,ch,c,wa+iw-1,wa+ix2-1,wa+ix3-1,wa+ix4-1);
+ else
+ dradb5(ido,l1,c,ch,wa+iw-1,wa+ix2-1,wa+ix3-1,wa+ix4-1);
+ na=1-na;
+ goto L115;
+
+ L112:*/
+ if (na!=0)
+ dradbg(ido,ip,l1,idl1,ch,ch,ch,c,c,wa+iw-1);
+ else
+ dradbg(ido,ip,l1,idl1,c,c,c,ch,ch,wa+iw-1);
+ if (ido==1)na=1-na;
+
+ L115:
+ l1=l2;
+ iw+=(ip-1)*ido;
+ }
+
+ if (na==0) return;
+
+ for (i=0;i<n;i++)c[i]=ch[i];
+}
+
+void __ogg_fdrfftb(int n, float *r, float *wsave, int *ifac){
+ if (n == 1) return;
+ drftb1(n, r, wsave, wsave+n, ifac);
+}
+
+STIN void dcsqb1(int n,float *x,float *w,float *xh,int *ifac){
+ int modn,i,k,kc;
+ int np2,ns2;
+ float xim1;
+
+ ns2=(n+1)>>1;
+ np2=n;
+
+ for (i=2;i<n;i+=2){
+ xim1=x[i-1]+x[i];
+ x[i]-=x[i-1];
+ x[i-1]=xim1;
+ }
+
+ x[0]+=x[0];
+ modn=n%2;
+ if (modn==0)x[n-1]+=x[n-1];
+
+ __ogg_fdrfftb(n,x,xh,ifac);
+
+ kc=np2;
+ for (k=1;k<ns2;k++){
+ kc--;
+ xh[k]=w[k-1]*x[kc]+w[kc-1]*x[k];
+ xh[kc]=w[k-1]*x[k]-w[kc-1]*x[kc];
+ }
+
+ if (modn==0)x[ns2]=w[ns2-1]*(x[ns2]+x[ns2]);
+
+ kc=np2;
+ for (k=1;k<ns2;k++){
+ kc--;
+ x[k]=xh[k]+xh[kc];
+ x[kc]=xh[k]-xh[kc];
+ }
+ x[0]+=x[0];
+}
+
+void __ogg_fdcosqb(int n,float *x,float *wsave,int *ifac){
+ static float tsqrt2 = 2.8284271247461900976033774484194;
+ float x1;
+
+ if (n<2){
+ x[0]*=4;
+ return;
+ }
+ if (n==2){
+ x1=(x[0]+x[1])*4;
+ x[1]=tsqrt2*(x[0]-x[1]);
+ x[0]=x1;
+ return;
+ }
+
+ dcsqb1(n,x,wsave,wsave+n,ifac);
+}
+
+
+
diff --git a/demos/mobile/guitartuner/src/guitartuner.cpp b/demos/mobile/guitartuner/src/guitartuner.cpp
new file mode 100644
index 0000000..1750e6a
--- /dev/null
+++ b/demos/mobile/guitartuner/src/guitartuner.cpp
@@ -0,0 +1,359 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "guitartuner.h"
+
+#ifdef Q_OS_SYMBIAN
+#include <SoundDevice.h>
+#endif // Q_OS_SYMBIAN
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+GuitarTuner::GuitarTuner(QWidget *parent) :
+ QMainWindow(parent)
+{
+
+ // Set up the QML.
+ m_guitarTunerUI = new QDeclarativeView(QUrl("qrc:/src/application.qml"), this);
+ setCentralWidget(m_guitarTunerUI);
+ m_guitarTunerUI->setResizeMode(QDeclarativeView::SizeRootObjectToView);
+ qmlObject = m_guitarTunerUI->rootObject();
+
+ // Init audio output and input.
+ initAudioOutput();
+ initAudioInput();
+
+ // Connect the quit signal of m_guitarTunerUI
+ // into the close slot of this.
+ connect(m_guitarTunerUI->engine(), SIGNAL(quit()), SLOT(close()));
+
+ // Connect the signals from qmlObject into proper slots
+ // of this and m_voicegenerator.
+ connect(qmlObject, SIGNAL(muteStateChanged(bool)),
+ SLOT(muteStateChanged(bool)));
+ connect(qmlObject, SIGNAL(volumeChanged(qreal)),
+ m_voicegenerator, SLOT(setAmplitude(qreal)));
+ connect(qmlObject, SIGNAL(volumeChanged(qreal)),
+ SLOT(setMaxVolumeLevel(qreal)));
+
+ // Connect the modeChanged signal from qmlObject
+ // into modeChanged slot of this class.
+ connect(qmlObject, SIGNAL(modeChanged(bool)),
+ SLOT(modeChanged(bool)));
+
+ // Connect the microphoneSensitivityChanged signal from
+ // m_guitarTunerUI into setCutOffPercentage slot of m_analyzer class.
+ connect(qmlObject, SIGNAL(microphoneSensitivityChanged(qreal)),
+ m_analyzer, SLOT(setCutOffPercentage(qreal)));
+
+ // Connect the signals from m_analyzer into slots of qmlObject.
+ connect(m_analyzer, SIGNAL(lowVoice()),
+ qmlObject, SLOT(lowVoice()));
+ connect(m_analyzer, SIGNAL(correctFrequency()),
+ qmlObject, SLOT(correctFrequencyObtained()));
+ connect(m_analyzer, SIGNAL(voiceDifference(QVariant)),
+ qmlObject, SLOT(voiceDifferenceChanged(QVariant)));
+
+ // Initialise the MaximumVoiceDifference
+ // value of qmlObject with the value obtained from m_analyzer.
+ qmlObject->setProperty("maxVoiceDifference",
+ m_analyzer->getMaximumVoiceDifference());
+
+ // Connect the targetFrequencyChanged signal of qmlObject
+ // into targetFrequencyChanged slot of this class.
+ connect(qmlObject, SIGNAL(targetFrequencyChanged(qreal)),
+ SLOT(targetFrequencyChanged(qreal)));
+
+ // Start voice output or input by using the modeChanged function,
+ // depending of the current mode.
+ modeChanged(qmlObject->property("isInput").toBool());
+
+}
+
+/**
+ * Inits audio output.
+ */
+void GuitarTuner::initAudioOutput()
+{
+ // Set up the output format.
+ m_format_output.setFrequency(DataFrequencyHzOutput);
+ m_format_output.setCodec("audio/pcm");
+ m_format_output.setSampleSize(16);
+ m_format_output.setChannels(1);
+ m_format_output.setByteOrder(QAudioFormat::LittleEndian);
+ m_format_output.setSampleType(QAudioFormat::SignedInt);
+
+ // Obtain a default output device, and if the format is not
+ // supported, find the nearest format available.
+ QAudioDeviceInfo outputDeviceInfo(
+ QAudioDeviceInfo::defaultOutputDevice());
+ if (!outputDeviceInfo.isFormatSupported(m_format_output)) {
+ m_format_output = outputDeviceInfo.nearestFormat(m_format_output);
+ }
+
+ // Create new QAudioOutput and VoiceGenerator instances, and store
+ // them in m_audioOutput and m_voicegenerator, respectively.
+ m_audioOutput = new QAudioOutput(outputDeviceInfo,
+ m_format_output, this);
+ m_voicegenerator = new VoiceGenerator(m_format_output,
+ qmlObject->property("frequency").toReal(),
+ qmlObject->property("volume").toReal(),
+ this);
+
+ // Connect m_audioOutput stateChanged signal to outputStateChanged.
+ connect(m_audioOutput, SIGNAL(stateChanged(QAudio::State)),
+ SLOT(outputStateChanged(QAudio::State)));
+}
+
+/**
+ * Inits audio input.
+ */
+void GuitarTuner::initAudioInput()
+{
+ // Set up the input format.
+ m_format_input.setFrequency(DataFrequencyHzInput);
+ m_format_input.setCodec("audio/pcm");
+ m_format_input.setSampleSize(16);
+ m_format_input.setChannels(1);
+ m_format_input.setByteOrder(QAudioFormat::LittleEndian);
+ m_format_input.setSampleType(QAudioFormat::SignedInt);
+
+ // Obtain a default input device, and if the format is not
+ // supported, find the nearest format available.
+ QAudioDeviceInfo inputDeviceInfo(
+ QAudioDeviceInfo::defaultInputDevice());
+ if (!inputDeviceInfo.isFormatSupported(m_format_input)) {
+ m_format_input = inputDeviceInfo.nearestFormat(m_format_input);
+ }
+
+ // Create new QAudioInput and VoiceAnalyzer instances, and store
+ // them in m_audioInput and m_analyzer, respectively.
+ // Remember to set the cut-off percentage for voice analyzer.
+ m_audioInput = new QAudioInput(inputDeviceInfo, m_format_input, this);
+ m_analyzer = new VoiceAnalyzer(m_format_input, this);
+ m_analyzer->setCutOffPercentage(qmlObject->property("sensitivity").toReal());
+
+}
+
+/**
+ * Receives a mode changed signal.
+ */
+void GuitarTuner::modeChanged(bool isInput)
+{
+
+
+
+ // If the mode must be changed to input mode:
+ if (isInput) {
+
+ // Stop audio output and audio generator.
+ m_audioOutput->stop();
+ m_voicegenerator->stop();
+ // Start the audio analyzer and then the audio input.
+ m_analyzer->start(qmlObject->property("frequency").toReal());
+ m_audioInput->start(m_analyzer);
+
+ }
+ // Else:
+ else {
+
+ // Stop audio input and audio analyzer.
+ m_audioInput->stop();
+ m_analyzer->stop();
+
+ // Set up the audio output.
+
+ // If the current frequency of voice generator
+ // is not the same as the target frequency selected in the UI,
+ // update voice generator's frequency.
+ if (m_voicegenerator->frequency() != qmlObject->property("frequency").toReal()) {
+ m_voicegenerator->setFrequency(qmlObject->property("frequency").toReal());
+ }
+
+ // Start the voice generator and then the audio output.
+ m_voicegenerator->start();
+ m_audioOutput->start(m_voicegenerator);
+ // Call setMaxVolumeLevel(1) to set the maximum volume louder.
+ setMaxVolumeLevel(qmlObject->property("volume").toReal());
+
+ // If the voice is muted, the voice is suspended
+ // in the outputStateChanged slot.
+
+ }
+}
+
+/**
+ * Receives a output state changed signal.
+ * Suspends the audio output, if the state is ActiveState
+ * and the voice is muted.
+ */
+void GuitarTuner::outputStateChanged(QAudio::State state)
+{
+ if (QAudio::ActiveState == state && qmlObject->property("isMuted").toBool()) {
+ // If the voice is muted, suspend the voice.
+ m_audioOutput->suspend();
+ }
+}
+
+/**
+ * Receives a mute state changed signal.
+ * Suspends the audio output or resumes it, depending of the
+ * isMuted parameter.
+ */
+void GuitarTuner::muteStateChanged(bool isMuted)
+{
+ if (isMuted) {
+ m_audioOutput->suspend();
+ }
+ else {
+ m_audioOutput->resume();
+ }
+}
+
+/**
+ * Receives a target frequency signal.
+ */
+void GuitarTuner::targetFrequencyChanged(qreal targetFrequency)
+{
+ // If the output mode is active:
+ if (!qmlObject->property("isInput").toBool()) {
+ // Stop the audio output and voice generator.
+ m_audioOutput->stop();
+ m_voicegenerator->stop();
+ // Set the voice generator's frequency to the target frequency.
+ m_voicegenerator->setFrequency(targetFrequency);
+ // Start the voice generator and audio output.
+ m_voicegenerator->start();
+ m_audioOutput->start(m_voicegenerator);
+ // Call setMaxVolumeLevel(1) to set the maximum volume louder.
+ setMaxVolumeLevel(qmlObject->property("volume").toReal());
+
+ // If the voice is muted, the voice is suspended
+ // in the outputStateChanged slot.
+
+ }
+ // Else:
+ else {
+
+ // Stop the audio input and voice analyzer.
+ m_audioInput->stop();
+ m_analyzer->stop();
+ // Start the voice analyzer with new frequency and audio input.
+ m_analyzer->start(targetFrequency);
+ m_audioInput->start(m_analyzer);
+
+ }
+}
+
+/**
+ * This method provides a hack to set the maximum volume level in
+ * Symbian.
+ */
+void GuitarTuner::setMaxVolumeLevel(qreal percent)
+{
+ if (percent >= 1.0) {
+ percent = 1.0;
+ }
+ else if (percent <= 0.0) {
+ percent = 0.0;
+ }
+ percent = percent*0.5 + 0.5;
+ // Warning! This is a hack, which can break when the QtMobility
+ // changes. Use at your own risk.
+#ifdef Q_OS_SYMBIAN
+ unsigned int *pointer_to_abstract_audio
+ = (unsigned int*)( (unsigned char*)m_audioOutput + 8 );
+ unsigned int *dev_sound_wrapper
+ = (unsigned int*)(*pointer_to_abstract_audio) + 16;
+ unsigned int *temp
+ = ((unsigned int*)(*dev_sound_wrapper) + 6);
+ CMMFDevSound *dev_sound = (CMMFDevSound*)(*temp);
+ dev_sound->SetVolume((unsigned int)
+ (percent*(float)dev_sound->MaxVolume()));
+#endif
+}
+
+/**
+ * A function used to lock the orientation.
+ */
+void GuitarTuner::setOrientation(Orientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != Auto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == LockPortrait)
+ ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*>
+ (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+#else // ORIENTATIONLOCK
+ qWarning(QString("'ORIENTATIONLOCK' needs to be defined on")
+ +QString(" Symbian when locking the orientation."));
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case LockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case LockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case Auto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
diff --git a/demos/mobile/guitartuner/src/guitartuner.h b/demos/mobile/guitartuner/src/guitartuner.h
new file mode 100644
index 0000000..aa3e9f8
--- /dev/null
+++ b/demos/mobile/guitartuner/src/guitartuner.h
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+#include <QtDeclarative>
+#include <QAudioDeviceInfo>
+#include <QAudioOutput>
+#include <QAudioInput>
+#include "voicegenerator.h"
+#include "voiceanalyzer.h"
+
+const int DataFrequencyHzOutput = 44100;
+const int DataFrequencyHzInput = 48000;
+
+#define MAX_INPUT_VALUE 50
+#define MIN_INPUT_VALUE -50
+
+class GuitarTuner : public QMainWindow
+{
+ Q_OBJECT
+public:
+ enum Orientation {
+ LockPortrait,
+ LockLandscape,
+ Auto
+ };
+ explicit GuitarTuner(QWidget *parent = 0);
+ qreal getVolume();
+ qreal getMicrophoneSensitivity();
+ bool getMuteState();
+ void setOrientation(Orientation orientation);
+
+signals:
+
+public slots:
+ void modeChanged(bool isInput);
+ void muteStateChanged(bool isMuted);
+ void targetFrequencyChanged(qreal targetFrequency);
+ void outputStateChanged(QAudio::State state);
+ void setMaxVolumeLevel(qreal);
+
+private:
+ void initAudioOutput();
+ void initAudioInput();
+ VoiceGenerator *m_voicegenerator;
+ VoiceAnalyzer *m_analyzer;
+ QObject *qmlObject;
+ QAudioOutput *m_audioOutput;
+ QAudioInput *m_audioInput;
+ QAudioFormat m_format_output;
+ QAudioFormat m_format_input;
+ QDeclarativeView *m_guitarTunerUI;
+};
+
+#endif // MAINWINDOW_H
diff --git a/demos/mobile/guitartuner/src/guitartuner.rc b/demos/mobile/guitartuner/src/guitartuner.rc
new file mode 100644
index 0000000..85cee0b
--- /dev/null
+++ b/demos/mobile/guitartuner/src/guitartuner.rc
@@ -0,0 +1,23 @@
+IDI_ICON1 ICON DISCARDABLE "/../images/guitartuner_icon.ico"
+
+1 VERSIONINFO
+FILEVERSION 1,2,0,0
+PRODUCTVERSION 1,2,0,0
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4"
+ BEGIN
+ VALUE "CompanyName", "Nokia Corporation\0"
+ VALUE "FileDescription", "Qt Quick example application.\0"
+ VALUE "FileVersion", "1.2.0\0"
+ VALUE "LegalCopyright", "Copyright 2011 Nokia Corporation. All rights reserved.\0"
+ VALUE "ProductName", "Guitar Tuner\0"
+ VALUE "ProductVersion", "1.2.0\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1252
+ END
+END \ No newline at end of file
diff --git a/demos/mobile/guitartuner/src/guitartuner.ui b/demos/mobile/guitartuner/src/guitartuner.ui
new file mode 100644
index 0000000..36ee1bd
--- /dev/null
+++ b/demos/mobile/guitartuner/src/guitartuner.ui
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>GuitarTuner</class>
+ <widget class="QWidget" name="GuitarTuner">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>187</width>
+ <height>279</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>GuitarTuner</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QLabel" name="tabulatorIcon">
+ <property name="text">
+ <string notr="true"/>
+ </property>
+ <property name="pixmap">
+ <pixmap resource="../guitartuner.qrc">:/images/guitartab.svg</pixmap>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSlider" name="correctSoundSlider">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="minimum">
+ <number>-50</number>
+ </property>
+ <property name="maximum">
+ <number>50</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="tickPosition">
+ <enum>QSlider::TicksAbove</enum>
+ </property>
+ <property name="tickInterval">
+ <number>50</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QToolButton" name="buttonPrev">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="arrowType">
+ <enum>Qt::LeftArrow</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="noteLabel">
+ <property name="text">
+ <string>A</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="buttonNext">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="autoRaise">
+ <bool>false</bool>
+ </property>
+ <property name="arrowType">
+ <enum>Qt::RightArrow</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QPushButton" name="modeButton">
+ <property name="text">
+ <string>Change mode</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QSlider" name="soundSlider">
+ <property name="value">
+ <number>65</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="soundButton">
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="icon">
+ <iconset resource="../guitartuner.qrc">
+ <normaloff>:/images/note.svg</normaloff>
+ <normalon>:/images/noteNo.svg</normalon>
+ <activeon>:/images/noteNo.svg</activeon>:/images/note.svg</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>30</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="autoRaise">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="micSensitivityLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>microphone
+sensitivity</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources>
+ <include location="../guitartuner.qrc"/>
+ </resources>
+ <connections/>
+</ui>
diff --git a/demos/mobile/guitartuner/src/guitartunerui.cpp b/demos/mobile/guitartuner/src/guitartunerui.cpp
new file mode 100644
index 0000000..9d59d7c
--- /dev/null
+++ b/demos/mobile/guitartuner/src/guitartunerui.cpp
@@ -0,0 +1,341 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QTimer>
+
+#include "guitartunerui.h"
+#include "ui_guitartunerui.h"
+
+GuitarTunerUI::GuitarTunerUI(QWidget *parent) :
+ QWidget(parent),
+ ui(new Ui::GuitarTunerUI),
+ m_maximumPrecision(0)
+{
+ ui->setupUi(this);
+
+ // Set up the class attributes to proper values.
+ m_outputActive = false;
+ m_muted = false;
+ m_outputVolumeLevel = getVolumeFromSoundSlider();
+ m_inputVolumeLevel = 1.0 - m_outputVolumeLevel;
+
+ // Set up the current tone, the frequency, and the name for it.
+ m_currentToneIndex = 5;
+ updateFrequencyByToneIndex(m_currentToneIndex);
+
+ // Connect the signals from UI into proper slots.
+ connect(ui->soundSlider, SIGNAL(valueChanged(int)),
+ SLOT(changeVolume()));
+ connect(ui->soundButton, SIGNAL(toggled(bool)),
+ SLOT(toggleSound(bool)));
+ connect(ui->modeButton, SIGNAL(clicked()),
+ SLOT(toggleInputOrOutput()));
+ connect(ui->buttonNext, SIGNAL(clicked()), SLOT(next()));
+ connect(ui->buttonPrev, SIGNAL(clicked()), SLOT(prev()));
+
+ // Initialise up the UI by calling toggleInputOrOutput
+ // for the first time.
+ toggleInputOrOutput();
+}
+
+GuitarTunerUI::~GuitarTunerUI()
+{
+ delete ui;
+}
+
+void GuitarTunerUI::changeEvent(QEvent *e)
+{
+ QWidget::changeEvent(e);
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ ui->retranslateUi(this);
+ break;
+ default:
+ break;
+ }
+}
+
+/**
+ * Returns a value from 0 to 1, representing the volume.
+ */
+qreal GuitarTunerUI::getVolumeFromSoundSlider() const
+{
+ qreal value = ui->soundSlider->value();
+ return value/ui->soundSlider->maximum();
+}
+
+/**
+ * Updates the m_currentToneFrequency and m_currentToneString,
+ * according to the given index. Also updates the UI.
+ */
+void GuitarTunerUI::updateFrequencyByToneIndex(int index)
+{
+
+ switch (index) {
+ case 0: {
+ m_currentToneFrequency = FrequencyE;
+ m_currentToneString = "E";
+ break;
+ }
+ case 1: {
+ m_currentToneFrequency = FrequencyA;
+ m_currentToneString = "A";
+ break;
+ }
+ case 2: {
+ m_currentToneFrequency = FrequencyD;
+ m_currentToneString = "D";
+ break;
+ }
+ case 3: {
+ m_currentToneFrequency = FrequencyG;
+ m_currentToneString = "G";
+ break;
+ }
+ case 4: {
+ m_currentToneFrequency = FrequencyB;
+ m_currentToneString = "B";
+ break;
+ }
+ case 5: {
+ m_currentToneFrequency = FrequencyE2;
+ m_currentToneString = "e";
+ break;
+ }
+ default: {
+ qDebug() << "invalid index!" << index;
+ }
+ }
+ // Set the noteLabel text according to the current tone.
+ ui->noteLabel->setText(m_currentToneString);
+}
+
+/**
+ * Returns the volume.
+ */
+qreal GuitarTunerUI::getVolume() const
+{
+ return m_outputVolumeLevel;
+}
+
+/**
+ * Returns true if the sound is muted.
+ */
+bool GuitarTunerUI::getMuteState() const
+{
+ return m_muted;
+}
+
+
+/**
+ * Returns the microphone sensitivity.
+ */
+qreal GuitarTunerUI::getMicrophoneSensitivity() const
+{
+ return m_inputVolumeLevel;
+}
+
+/**
+ * Returns whether the input mode is active.
+ */
+bool GuitarTunerUI::isInputModeActive() const
+{
+ return !m_outputActive;
+}
+
+/**
+ * Returns the current target frequency.
+ */
+qreal GuitarTunerUI::getFrequency() const
+{
+ return m_currentToneFrequency;
+}
+
+/**
+ * Toggles the sound according to the parameter.
+ * Has no effect if output is not active.
+ */
+void GuitarTunerUI::toggleSound(bool noSound)
+{
+ if (!m_outputActive) {
+ return;
+ }
+ m_muted = noSound;
+ emit muteChanged(m_muted);
+}
+
+/**
+ * Changes the volume or microphone sensitivity.
+ */
+void GuitarTunerUI::changeVolume()
+{
+ qreal resultingAmplitude = getVolumeFromSoundSlider();
+ qDebug() << "resultingAmplitude" << resultingAmplitude;
+ if (m_outputActive) {
+ m_outputVolumeLevel = resultingAmplitude;
+ emit volumeChanged(resultingAmplitude);
+ }
+ else {
+ m_inputVolumeLevel = resultingAmplitude;
+ emit microphoneSensitivityChanged(1.0-resultingAmplitude);
+ }
+}
+
+/**
+ * Toggles input or output, depending of the current state.
+ */
+void GuitarTunerUI::toggleInputOrOutput()
+{
+ // If output mode is active:
+ if (m_outputActive) {
+ // Change UI to correspond to the input mode.
+ m_outputActive = false;
+ ui->soundSlider->setValue(m_inputVolumeLevel*100);
+ ui->soundButton->setDisabled(true);
+ ui->soundButton->hide();
+ ui->micSensitivityLabel->show();
+ emit modeChanged(true);
+ ui->modeButton->setText("To tone mode");
+ }
+ // Else:
+ else {
+ // Change UI to correspond to the output mode.
+ m_outputActive = true;
+ ui->soundSlider->setValue(m_outputVolumeLevel*100);
+ ui->soundButton->setDisabled(false);
+ ui->micSensitivityLabel->hide();
+ ui->soundButton->show();
+ emit modeChanged(false);
+ ui->modeButton->setText("To listen mode");
+ }
+}
+
+/**
+ * Receives the low voice signal.
+ */
+void GuitarTunerUI::lowVoice()
+{
+ if (ui->noteLabel->font().bold()) {
+ QFont font;
+ font.setBold(false);
+ font.setUnderline(false);
+ ui->noteLabel->setFont(font);
+ }
+}
+
+/**
+ * Receives the voice difference signal.
+ * The difference is qreal, where increase of 1 corresponds
+ * to increase of 1 tone to the target frequency.
+ */
+void GuitarTunerUI::voiceDifference(qreal difference)
+{
+ if (ui->noteLabel->font().bold()) {
+ QFont font;
+ font.setBold(false);
+ font.setUnderline(false);
+ ui->noteLabel->setFont(font);
+ }
+ ui->correctSoundSlider->setValue(difference*m_maximumPrecision);
+}
+
+/**
+ * Receives the correct frequency signal.
+ * Makes the UI to visualize correct frequency event.
+ */
+void GuitarTunerUI::correctFrequencyObtained()
+{
+ qDebug() << "CORRECT FREQUENCY";
+ QFont font;
+ font.setBold(true);
+ font.setUnderline(true);
+ ui->noteLabel->setFont(font);
+}
+
+/**
+ * Sets up the maximum voice difference.
+ */
+void GuitarTunerUI::setMaximumVoiceDifference(int max)
+{
+ // Assert that the maximum precision is known.
+ Q_ASSERT(m_maximumPrecision != 0);
+ // Set the maximum and minimum values of the correctSoundSlider
+ // to the +- max*m_maximumPrecision, and set the tick interval
+ // to be m_maximumPrecision.
+ ui->correctSoundSlider->setMaximum(max*m_maximumPrecision);
+ ui->correctSoundSlider->setMinimum(-max*m_maximumPrecision);
+ ui->correctSoundSlider->setTickInterval(max*m_maximumPrecision);
+}
+
+/**
+ * Stores the maximum precision per note. Used to setup the
+ * correct sound slider.
+ */
+void GuitarTunerUI::setMaximumPrecisionPerNote(int max)
+{
+ m_maximumPrecision = max;
+}
+
+/**
+ * Changes the tone to the next value.
+ */
+void GuitarTunerUI::next()
+{
+ changeTone((m_currentToneIndex + 1) % 6);
+}
+
+/**
+ * Changes the tone to the previous value.
+ */
+void GuitarTunerUI::prev()
+{
+ changeTone((m_currentToneIndex + 5) % 6);
+}
+
+/**
+ * Changes the tone according to the new index.
+ */
+void GuitarTunerUI::changeTone(int newIndex)
+{
+ m_currentToneIndex = newIndex;
+ updateFrequencyByToneIndex(m_currentToneIndex);
+ qDebug() << "targetFrequencyChanged" << m_currentToneFrequency;
+ emit targetFrequencyChanged(m_currentToneFrequency);
+}
diff --git a/demos/mobile/guitartuner/src/guitartunerui.h b/demos/mobile/guitartuner/src/guitartunerui.h
new file mode 100644
index 0000000..fa8e8f4
--- /dev/null
+++ b/demos/mobile/guitartuner/src/guitartunerui.h
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef GUITARTUNERUI_H
+#define GUITARTUNERUI_H
+
+#include <QWidget>
+#include <QDebug>
+
+namespace Ui {
+ class GuitarTunerUI;
+}
+
+const qreal FrequencyE = 82.407;
+const qreal FrequencyA = 110.00;
+const qreal FrequencyD = 146.83;
+const qreal FrequencyG = 196.00;
+const qreal FrequencyB = 246.94;
+const qreal FrequencyE2 = 329.63;
+
+class GuitarTunerUI : public QWidget
+{
+ Q_OBJECT
+
+public:
+ explicit GuitarTunerUI(QWidget *parent = 0);
+ ~GuitarTunerUI();
+
+ qreal getVolume() const;
+ bool getMuteState() const;
+ qreal getMicrophoneSensitivity() const;
+ bool isInputModeActive() const;
+ qreal getFrequency() const;
+ int getScaleMaximumValue() const;
+ void setMaximumVoiceDifference(int max);
+ void setMaximumPrecisionPerNote(int max);
+
+public slots:
+ void toggleSound(bool off);
+ void next();
+ void prev();
+ void changeVolume();
+ void toggleInputOrOutput();
+
+ void lowVoice();
+ void voiceDifference(qreal difference);
+ void correctFrequencyObtained();
+
+signals:
+ void modeChanged(bool isInput);
+ void volumeChanged(qreal volume);
+ void microphoneSensitivityChanged(qreal sensitivity);
+ void muteChanged(bool isMuted);
+ void targetFrequencyChanged(qreal targetFrequency);
+
+protected:
+ void changeEvent(QEvent *e);
+
+private:
+ Ui::GuitarTunerUI *ui;
+ void changeTone(int newIndex);
+ qreal getVolumeFromSoundSlider() const;
+ int m_currentToneIndex;
+ QString m_currentToneString;
+ qreal m_currentToneFrequency;
+ void updateFrequencyByToneIndex(int index);
+ bool m_outputActive;
+ bool m_muted;
+ qreal m_outputVolumeLevel;
+ qreal m_inputVolumeLevel;
+ int m_maximumPrecision;
+};
+
+#endif // GUITARTUNERUI_H
diff --git a/demos/mobile/guitartuner/src/guitartunerui.ui b/demos/mobile/guitartuner/src/guitartunerui.ui
new file mode 100644
index 0000000..af7b585
--- /dev/null
+++ b/demos/mobile/guitartuner/src/guitartunerui.ui
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>GuitarTunerUI</class>
+ <widget class="QWidget" name="GuitarTunerUI">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>187</width>
+ <height>279</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>GuitarTunerUI</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QLabel" name="tabulatorIcon">
+ <property name="text">
+ <string notr="true"/>
+ </property>
+ <property name="pixmap">
+ <pixmap resource="../GuitarTuner.qrc">:/images/guitartab.svg</pixmap>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSlider" name="correctSoundSlider">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="minimum">
+ <number>-50</number>
+ </property>
+ <property name="maximum">
+ <number>50</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="tickPosition">
+ <enum>QSlider::TicksAbove</enum>
+ </property>
+ <property name="tickInterval">
+ <number>50</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QToolButton" name="buttonPrev">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="arrowType">
+ <enum>Qt::LeftArrow</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="noteLabel">
+ <property name="text">
+ <string>A</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="buttonNext">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="autoRaise">
+ <bool>false</bool>
+ </property>
+ <property name="arrowType">
+ <enum>Qt::RightArrow</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QPushButton" name="modeButton">
+ <property name="text">
+ <string>Change mode</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QSlider" name="soundSlider">
+ <property name="value">
+ <number>65</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="soundButton">
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="icon">
+ <iconset resource="../GuitarTuner.qrc">
+ <normaloff>:/images/note.svg</normaloff>
+ <normalon>:/images/noteNo.svg</normalon>
+ <activeon>:/images/noteNo.svg</activeon>:/images/note.svg</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>30</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="autoRaise">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="micSensitivityLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>microphone
+sensitivity</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources>
+ <include location="../GuitarTuner.qrc"/>
+ </resources>
+ <connections/>
+</ui>
diff --git a/demos/mobile/guitartuner/src/main.cpp b/demos/mobile/guitartuner/src/main.cpp
new file mode 100644
index 0000000..33b1181
--- /dev/null
+++ b/demos/mobile/guitartuner/src/main.cpp
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "guitartuner.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ GuitarTuner w;
+ w.setOrientation(GuitarTuner::LockPortrait);
+
+#ifdef Q_OS_SYMBIAN
+ w.showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ w.showMaximized();
+#else
+ w.show();
+#endif
+
+ return a.exec();
+}
+
diff --git a/demos/mobile/guitartuner/src/mycomponents/Adjuster.qml b/demos/mobile/guitartuner/src/mycomponents/Adjuster.qml
new file mode 100644
index 0000000..342e6f7
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/Adjuster.qml
@@ -0,0 +1,131 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "adjustbars.js" as AdjustBars
+
+/* A barchart-like adjuster component. */
+Rectangle {
+ id: adjuster
+
+ property real max: 100
+ property real value: 0
+ property bool created: false
+
+ signal valueChanged(real value)
+ signal focusChangedByClick()
+ signal arrowPressedWhenValueOverLimits()
+
+ function setValue(pValue) {
+ value = pValue;
+ AdjustBars.fillBars(value/max*AdjustBars.maxBars);
+ valueChanged(value);
+ }
+
+ height: 60; width: 300
+ color: "transparent"
+ Keys.onRightPressed: {
+ var val = value+max/AdjustBars.maxBars;
+ if (val <= max) {
+ value = val;
+ AdjustBars.fillBars(value/max*AdjustBars.maxBars);
+ valueChanged(value);
+ }
+ else {
+ arrowPressedWhenValueOverLimits()
+ }
+ }
+ Keys.onLeftPressed: {
+ var val = value-max/AdjustBars.maxBars;
+ if (0 <= val) {
+ value = val;
+ AdjustBars.fillBars(value/max*AdjustBars.maxBars);
+ valueChanged(value);
+ }
+ else {
+ arrowPressedWhenValueOverLimits()
+ }
+ }
+ Component.onCompleted: {
+ AdjustBars.createBars();
+ AdjustBars.fillBars(value/max*AdjustBars.maxBars);
+ created = true;
+ }
+ Component.onDestruction: {
+ AdjustBars.destroyBars;
+ }
+ //Dynamic objects have to be recreated when the window size changes.
+ onWidthChanged: {
+ if (created) {
+ AdjustBars.destroyBars();
+ AdjustBars.createBars();
+ AdjustBars.fillBars(value/max*AdjustBars.maxBars);
+ }
+ }
+ onHeightChanged: {
+ if (created) {
+ AdjustBars.destroyBars();
+ AdjustBars.createBars();
+ AdjustBars.fillBars(value/max*AdjustBars.maxBars);
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPositionChanged: {
+ focusChangedByClick();
+ var val = mouse.x/parent.width*parent.max;
+ if (0 < val && val < max) {
+ parent.value = val;
+ AdjustBars.fillBars(parent.value/parent.max*AdjustBars.maxBars);
+ valueChanged(parent.value);
+ }
+ }
+ onClicked: {
+ focusChangedByClick();
+ var val = mouse.x/parent.width*parent.max;
+ if (0 < val && val < max) {
+ parent.value = val;
+ AdjustBars.fillBars(parent.value/parent.max*AdjustBars.maxBars);
+ valueChanged(parent.value);
+ }
+ }
+ }
+}
diff --git a/demos/mobile/guitartuner/src/mycomponents/Meter.qml b/demos/mobile/guitartuner/src/mycomponents/Meter.qml
new file mode 100644
index 0000000..8a64711
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/Meter.qml
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+/* A meter component. */
+Rectangle {
+ id: meter
+
+ property real value: 0
+ property real minValue: -1
+ property real maxValue: 1
+ property alias imageSize: meterImage.sourceSize
+
+ function valueChanged(pValue) {
+ value = pValue;
+ scaleValueToAngle();
+ }
+ function scaleValueToAngle() {
+ pointer.angle = (((value-minValue)/(maxValue-minValue))*
+ (pointer.angleMax-pointer.angleMin))+
+ pointer.angleMin;
+ }
+
+ color: "transparent"
+
+ Image {
+ id: meterImage
+
+ smooth: true
+ source: "./images/meterBG.png"
+ anchors.fill: parent
+ }
+
+ Image {
+ id:pointerShadow
+
+ x: pointer.x - 2
+ y: pointer.y - 2
+ height: pointer.height
+ smooth: true
+ source: "./images/pointerShadow.png"
+ transform: Rotation {
+ origin.x: 2
+ origin.y: height
+ angle: -pointer.angle
+ }
+ }
+
+ Image {
+ id: pointer
+
+ property real angle: 0
+ property real angleMax: -45
+ property real angleMin: 45
+
+ height: parent.height*0.92
+ transformOrigin: "Bottom"
+ rotation: -angle
+ smooth: true
+ source: "./images/pointer.png"
+ anchors {
+ bottomMargin: 2
+ bottom: parent.bottom;
+ horizontalCenter: parent.horizontalCenter
+ }
+
+ Behavior on angle {
+ SpringAnimation {
+ spring: 1.4
+ damping: 0.15
+ }
+ }
+ }
+}
diff --git a/demos/mobile/guitartuner/src/mycomponents/NoteButtonView.qml b/demos/mobile/guitartuner/src/mycomponents/NoteButtonView.qml
new file mode 100644
index 0000000..fc64fe5
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/NoteButtonView.qml
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+/* A view component for buttons for choosing notes. */
+ListView {
+ id: noteChooser
+
+ property real currentFrequency: 82.407
+
+ signal noteSelected(string note, real frequency, int index)
+
+ //Press down the button corresponding to the given note.
+ function pushButton(index) {
+ currentIndex = index;
+ }
+
+ width: 50*model.count + spacing*(model.count-1); height: 50
+ orientation: ListView.Horizontal
+ model: NotesModel {}
+ delegate: notesDelegate
+ keyNavigationWraps: true
+ boundsBehavior: Flickable.StopAtBounds
+
+ Component {
+ id: notesDelegate
+
+ ToggleButton {
+ id: noteButton
+
+ width: height; height: noteChooser.height
+ offImageSource: offSource
+ onImageSource: onSource
+ state: noteButton.ListView.isCurrentItem ? "pressed" : "unPressed"
+ onSelected: {
+ noteChooser.noteSelected(note, frequency, index)
+ if (note != "Auto") {
+ currentFrequency = frequency
+ }
+ }
+ onPushed: {
+ noteButton.ListView.view.currentIndex = index
+ }
+ }
+ }
+}
diff --git a/demos/mobile/guitartuner/src/mycomponents/NotesModel.qml b/demos/mobile/guitartuner/src/mycomponents/NotesModel.qml
new file mode 100644
index 0000000..3d9c12a
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/NotesModel.qml
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+/* The model component for the NoteButtonView. */
+ListModel {
+ ListElement {
+ note: "E"
+ offSource: "./images/tuner_e.png"
+ onSource: "./images/tuner_e_on.png"
+ bigSource: "./mycomponents/images/big_e.png"
+ glowSource: "./mycomponents/images/glowing_e.png"
+ frequency: "82.407"
+ interval: "5"
+ }
+ ListElement {
+ note: "A"
+ offSource: "./images/tuner_a.png"
+ onSource: "./images/tuner_a_on.png"
+ bigSource: "./mycomponents/images/big_a.png"
+ glowSource: "./mycomponents/images/glowing_a.png"
+ frequency: "110.00"
+ interval: "5"
+ }
+ ListElement {
+ note: "D"
+ offSource: "./images/tuner_d.png"
+ onSource: "./images/tuner_d_on.png"
+ bigSource: "./mycomponents/images/big_d.png"
+ glowSource: "./mycomponents/images/glowing_d.png"
+ frequency: "146.83"
+ interval: "5"
+ }
+ ListElement {
+ note: "G"
+ offSource: "./images/tuner_g.png"
+ onSource: "./images/tuner_g_on.png"
+ bigSource: "./mycomponents/images/big_g.png"
+ glowSource: "./mycomponents/images/glowing_g.png"
+ frequency: "196.00"
+ interval: "4"
+ }
+ ListElement {
+ note: "B"
+ offSource: "./images/tuner_b.png"
+ onSource: "./images/tuner_b_on.png"
+ bigSource: "./mycomponents/images/big_b.png"
+ glowSource: "./mycomponents/images/glowing_b.png"
+ frequency: "246.94"
+ interval: "5"
+ }
+ ListElement {
+ note: "e"
+ offSource: "./images/tuner_e.png"
+ onSource: "./images/tuner_e_on.png"
+ bigSource: "./mycomponents/images/big_e.png"
+ glowSource: "./mycomponents/images/glowing_e.png"
+ frequency: "329.63"
+ interval: "9999" //Big enough that we can't move over this note
+ }
+ ListElement {
+ note: "Auto"
+ offSource: "./images/tuner_auto.png"
+ onSource: "./images/tuner_auto_on.png"
+ frequency: "82.407"
+ }
+}
diff --git a/demos/mobile/guitartuner/src/mycomponents/ToggleButton.qml b/demos/mobile/guitartuner/src/mycomponents/ToggleButton.qml
new file mode 100644
index 0000000..cecf015
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/ToggleButton.qml
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+/* A toggle button component. */
+Rectangle {
+ id: toggleButton
+
+ property url offImageSource: ""
+ property url onImageSource: ""
+ property alias imageSource: buttonImage.source
+
+ signal selected()
+ signal pushed()
+
+ color: "transparent"
+ state: "unPressed"
+ onStateChanged: {
+ if (state == "pressed") {
+ selected()
+ }
+ }
+
+ Image {
+ id: buttonImage
+
+ smooth: true
+ anchors.fill: parent
+ }
+ MouseArea {
+ id: mouseArea
+
+ anchors.fill: parent
+ onPressed: {
+ if (parent.state == "unPressed") {
+ pushed()
+ }
+ }
+ }
+
+ states: [
+ State {
+ name: "pressed"
+ PropertyChanges {
+ target: toggleButton
+ scale: 0.95
+ imageSource: onImageSource
+ }
+ },
+ State {
+ name: "unPressed"
+ PropertyChanges {
+ target: toggleButton
+ scale: 1/0.95
+ imageSource: offImageSource
+ }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ from: "unPressed"
+ to: "pressed"
+ reversible: true
+ PropertyAnimation {
+ target: toggleButton
+ properties: "scale"
+ duration: 100
+ }
+ }
+ ]
+}
diff --git a/demos/mobile/guitartuner/src/mycomponents/adjustbars.js b/demos/mobile/guitartuner/src/mycomponents/adjustbars.js
new file mode 100644
index 0000000..a96292d
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/adjustbars.js
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/* JavaScript functions for creating, handling and
+ * destroying the bars of the adjuster component. */
+
+var maxBars = 10;
+var firstBarHeight = 5;
+var bars = new Array(maxBars);
+var colors = new Array(maxBars);
+var barWidthFactor = 2.3;
+
+function createBars() {
+ var barWidth = adjuster.width/maxBars/barWidthFactor;
+ for (var i = 1; i <= maxBars; i++) {
+ //Create, configure and store the bars.
+ var bar = Qt.createQmlObject('import QtQuick 1.0; Rectangle {smooth: true}', adjuster, "dynamicBar");
+ bar.width = barWidth;
+ bar.height = firstBarHeight+(i/maxBars)*(adjuster.height*0.8-firstBarHeight);
+ bar.radius = bar.width/2;
+ bar.x = (i-1)*(barWidthFactor*barWidth);
+ bar.y = adjuster.height/2 - bar.height/2;
+ bars[i-1] = bar;
+
+ //Calculate and store the colors
+ if (i < maxBars/2) {
+ colors[i-1] = Qt.rgba(1-i/(maxBars/2), 1, 1-i/(maxBars/2), i);
+ }
+ else {
+ colors[i-1] = Qt.rgba((i-(maxBars/2))/(maxBars/2), 1-((i-(maxBars/2))/(maxBars/2)), 0, i);
+ }
+ }
+}
+
+function destroyBars() {
+ for (var i = 0; i < maxBars; i++) {
+ bars[i].color = "transparent" //Colors must be set to transparent or otherwise the bars will stay appeared.
+ bars[i].destroy();
+ }
+}
+
+function fillBars(barNumber) {
+ //Set the color for the bars (transparent from the selected bar to the end).
+ for (var i = 0; i < maxBars; i++) {
+ if (i < barNumber) {
+ bars[i].color = colors[i];
+ }
+ else {
+ bars[i].color = "black";
+ }
+ }
+}
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/big_a.png b/demos/mobile/guitartuner/src/mycomponents/images/big_a.png
new file mode 100644
index 0000000..3838e76
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/big_a.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/big_b.png b/demos/mobile/guitartuner/src/mycomponents/images/big_b.png
new file mode 100644
index 0000000..114b32d
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/big_b.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/big_d.png b/demos/mobile/guitartuner/src/mycomponents/images/big_d.png
new file mode 100644
index 0000000..3ede9f0
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/big_d.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/big_e.png b/demos/mobile/guitartuner/src/mycomponents/images/big_e.png
new file mode 100644
index 0000000..cc1f488
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/big_e.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/big_g.png b/demos/mobile/guitartuner/src/mycomponents/images/big_g.png
new file mode 100644
index 0000000..804177b
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/big_g.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/glowing_a.png b/demos/mobile/guitartuner/src/mycomponents/images/glowing_a.png
new file mode 100644
index 0000000..b6fd0e2
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/glowing_a.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/glowing_b.png b/demos/mobile/guitartuner/src/mycomponents/images/glowing_b.png
new file mode 100644
index 0000000..b5fa016
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/glowing_b.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/glowing_d.png b/demos/mobile/guitartuner/src/mycomponents/images/glowing_d.png
new file mode 100644
index 0000000..32f1a29
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/glowing_d.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/glowing_e.png b/demos/mobile/guitartuner/src/mycomponents/images/glowing_e.png
new file mode 100644
index 0000000..4be9f2a
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/glowing_e.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/glowing_g.png b/demos/mobile/guitartuner/src/mycomponents/images/glowing_g.png
new file mode 100644
index 0000000..4216d82
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/glowing_g.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/guitartuner_malli.png b/demos/mobile/guitartuner/src/mycomponents/images/guitartuner_malli.png
new file mode 100644
index 0000000..dbe3fc7
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/guitartuner_malli.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/guitartuner_skin.png b/demos/mobile/guitartuner/src/mycomponents/images/guitartuner_skin.png
new file mode 100644
index 0000000..5d53df9
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/guitartuner_skin.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/lcdFrame.png b/demos/mobile/guitartuner/src/mycomponents/images/lcdFrame.png
new file mode 100644
index 0000000..ff8dffc
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/lcdFrame.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/meterBG.png b/demos/mobile/guitartuner/src/mycomponents/images/meterBG.png
new file mode 100644
index 0000000..4046355
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/meterBG.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/mute.png b/demos/mobile/guitartuner/src/mycomponents/images/mute.png
new file mode 100644
index 0000000..382e6047
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/mute.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/pointer.png b/demos/mobile/guitartuner/src/mycomponents/images/pointer.png
new file mode 100644
index 0000000..d0cb21b
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/pointer.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/pointerShadow.png b/demos/mobile/guitartuner/src/mycomponents/images/pointerShadow.png
new file mode 100644
index 0000000..a708639
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/pointerShadow.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/power.png b/demos/mobile/guitartuner/src/mycomponents/images/power.png
new file mode 100644
index 0000000..8ec0c5c
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/power.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/quit.png b/demos/mobile/guitartuner/src/mycomponents/images/quit.png
new file mode 100644
index 0000000..2a9443e
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/quit.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/sensitivity.png b/demos/mobile/guitartuner/src/mycomponents/images/sensitivity.png
new file mode 100644
index 0000000..c3d2ea3
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/sensitivity.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_a.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_a.png
new file mode 100644
index 0000000..a1823e5
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_a.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_a_on.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_a_on.png
new file mode 100644
index 0000000..7c78cbd
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_a_on.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_auto.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_auto.png
new file mode 100644
index 0000000..b9e494b
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_auto.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_auto_on.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_auto_on.png
new file mode 100644
index 0000000..d5608d8
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_auto_on.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_b.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_b.png
new file mode 100644
index 0000000..94977f8
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_b.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_b_on.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_b_on.png
new file mode 100644
index 0000000..78841dc
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_b_on.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_d.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_d.png
new file mode 100644
index 0000000..293ee55
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_d.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_d_on.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_d_on.png
new file mode 100644
index 0000000..705de41
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_d_on.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_e.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_e.png
new file mode 100644
index 0000000..569d2c6
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_e.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_e_on.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_e_on.png
new file mode 100644
index 0000000..1342a91
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_e_on.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_g.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_g.png
new file mode 100644
index 0000000..a8f0de5
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_g.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_g_on.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_g_on.png
new file mode 100644
index 0000000..6fdca41
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_g_on.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/voicemode_off.png b/demos/mobile/guitartuner/src/mycomponents/images/voicemode_off.png
new file mode 100644
index 0000000..0701dd3
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/voicemode_off.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/voicemode_on.png b/demos/mobile/guitartuner/src/mycomponents/images/voicemode_on.png
new file mode 100644
index 0000000..986d589
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/voicemode_on.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/volume.png b/demos/mobile/guitartuner/src/mycomponents/images/volume.png
new file mode 100644
index 0000000..46fdb7f
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/volume.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/volume_off.png b/demos/mobile/guitartuner/src/mycomponents/images/volume_off.png
new file mode 100644
index 0000000..a97e422
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/volume_off.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/voiceanalyzer.cpp b/demos/mobile/guitartuner/src/voiceanalyzer.cpp
new file mode 100644
index 0000000..9990e6d
--- /dev/null
+++ b/demos/mobile/guitartuner/src/voiceanalyzer.cpp
@@ -0,0 +1,295 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "voiceanalyzer.h"
+
+/**
+ * Constant used to scale the cut-off density for the fft helper.
+ */
+const static float CutOffScaler = 0.05;
+
+/**
+ * Force the precision to be "1/PrecisionPerNote" notes
+ * near the target frequency.
+ */
+const static int PrecisionPerNote = 4;
+
+/**
+ * TargetFrequencyParameter is a constant which implies the index at
+ * which corresponds to the target frequency.
+ * 0.5 * N * 1/TargetFrequencyParameter is (about) the index which
+ * corresponds to the given target frequency.
+ * Effectively TargetFrequencyParameter = 2^z, and the z*TargetFrequency
+ * is the maximum frequency that can be noticed.
+ */
+const static int TargetFrequencyParameter = 4;
+
+
+VoiceAnalyzer::VoiceAnalyzer(const QAudioFormat &format, QObject *parent):
+ QIODevice(parent),
+ m_format(format),
+ m_frequency(0),
+ m_position(0),
+ m_fftHelper(new FastFourierTransformer(this))
+{
+ Q_ASSERT(qFuzzyCompare(M_SAMPLE_COUNT_MULTIPLIER,
+ float(2)/(M_TWELTH_ROOT_OF_2 -1.0)));
+ m_totalSampleCount = qRound(qreal(PrecisionPerNote)
+ *TargetFrequencyParameter
+ *M_SAMPLE_COUNT_MULTIPLIER);
+ m_samples.reserve(m_totalSampleCount);
+ int i = 2;
+ int j = 1;
+ for (; i < TargetFrequencyParameter; i *= 2) {
+ j++;
+ }
+ m_maximumVoiceDifference = j*12;
+
+ setCutOffPercentage(CutOffScaler);
+}
+
+/**
+ * Opens the parent QIODevice. Sets up the analysation parameters.
+ */
+void VoiceAnalyzer::start(qreal frequency)
+{
+ m_stepSize = (qreal) 1.0 * m_format.sampleRate()
+ / (TargetFrequencyParameter*2*frequency);
+ m_frequency = frequency;
+ open(QIODevice::WriteOnly);
+}
+
+/**
+ * Closes the parent QIODevice, thus the voice is not analysed anymore.
+ * Resets the m_samples QList.
+ */
+void VoiceAnalyzer::stop()
+{
+ m_samples.clear();
+ m_samples.reserve(m_totalSampleCount);
+ close();
+}
+
+/**
+ * Called when data is obtained. Stores each m_stepSize sample
+ * into a QList to be analysed.
+ */
+qint64 VoiceAnalyzer::writeData(const char *data, qint64 maxlen)
+{
+ const int channelBytes = m_format.sampleSize() / 8;
+ int sampleSize = m_format.channels() * channelBytes;
+ int m_stepSizeInBytes = m_stepSize*sampleSize;
+ // assert that each sample fits fully into the data
+ Q_ASSERT((m_position % sampleSize)==0);
+ const uchar *ptr = reinterpret_cast<const uchar *>(data);
+ while (m_position < maxlen) {
+ if (m_samples.size() < m_totalSampleCount) {
+ m_samples.append(getValueInt16(ptr+m_position));
+ }
+ else {
+ analyzeVoice();
+ m_samples.clear();
+ m_samples.reserve(m_totalSampleCount);
+ // fast forward position to the first position after maxlen or to the maxlen
+ m_position += ((m_stepSizeInBytes - 1 + maxlen - m_position) /
+ m_stepSizeInBytes) * m_stepSizeInBytes;
+ break;
+ }
+ m_position += m_stepSizeInBytes;
+ }
+ m_position -= maxlen;
+ return maxlen;
+}
+
+/**
+ * Interprets ptr as a pointer to int value and returns it.
+ */
+qint16 VoiceAnalyzer::getValueInt16(const uchar *ptr)
+{
+ qint16 realValue = 0;
+ if (m_format.sampleSize() == 8)
+ {
+ const qint16 value = *reinterpret_cast<const quint8*>(ptr);
+ if (m_format.sampleType() == QAudioFormat::UnSignedInt) {
+ realValue = value - M_MAX_AMPLITUDE_8BIT_SIGNED - 1;
+ } else if (m_format.sampleType() == QAudioFormat::SignedInt) {
+ realValue = value;
+ }
+ } else if (m_format.sampleSize() == 16) {
+ qint16 value = 0;
+ if (m_format.byteOrder() == QAudioFormat::LittleEndian)
+ value = qFromLittleEndian<quint16>(ptr);
+ else
+ value = qFromBigEndian<quint16>(ptr);
+
+ if (m_format.sampleType() == QAudioFormat::UnSignedInt) {
+ realValue = value - M_MAX_AMPLITUDE_16BIT_SIGNED;
+ } else if (m_format.sampleType() == QAudioFormat::SignedInt) {
+ realValue = value;
+ }
+ }
+ return realValue;
+}
+
+/**
+ * Takes a number between 0 and 1, scales it with CutOffScaler,
+ * multiplies it with maximum density, and then gives it
+ * to the fft helper.
+ */
+void VoiceAnalyzer::setCutOffPercentage(qreal cutoff)
+{
+ cutoff = CutOffScaler*cutoff;
+ if (m_format.sampleSize() == 8) {
+ float t = cutoff*m_totalSampleCount*M_MAX_AMPLITUDE_8BIT_SIGNED;
+ m_fftHelper->setCutOffForDensity(t);
+ }
+ else if (m_format.sampleSize() == 16) {
+ float t = cutoff*m_totalSampleCount*M_MAX_AMPLITUDE_16BIT_SIGNED;
+ m_fftHelper->setCutOffForDensity(t);
+ }
+}
+
+/**
+ * Returns the current target frequency.
+ */
+qreal VoiceAnalyzer::frequency()
+{
+ return m_frequency;
+}
+
+/**
+ * Returns the maximum absolute value sent by
+ * the voiceDifference() signal.
+ */
+int VoiceAnalyzer::getMaximumVoiceDifference()
+{
+ return m_maximumVoiceDifference;
+}
+
+/**
+ * Returns the maximum precision per note
+ * near the target frequency.
+ */
+int VoiceAnalyzer::getMaximumPrecisionPerNote()
+{
+ return PrecisionPerNote;
+}
+
+/**
+ * Analyzes the voice frequency and emits appropriate signals.
+ */
+void VoiceAnalyzer::analyzeVoice()
+{
+ m_fftHelper->calculateFFT(m_samples);
+ int index = m_fftHelper->getMaximumDensityIndex();
+
+ // If index == -1
+ if (index == -1) {
+ // The voice is to be filtered away.
+ // Emit the lowVoice signal and return.
+ emit lowVoice();
+ qDebug() << "low voice";
+ return;
+ }
+ // Else, continue
+
+ // Let the correctIndex to be
+ // the nearest index corresponding to the correct frequency.
+ qreal stepSizeInFrequency = (qreal)m_format.sampleRate()
+ / (m_totalSampleCount * m_stepSize);
+ qreal newFrequency = qreal(index) * stepSizeInFrequency;
+ // Calculate the nearest index corresponding to the correct frequency.
+ int correctIndex = qRound(m_frequency / stepSizeInFrequency);
+ qreal value = 0;
+
+ // If the obtained frequency is more than
+ // log_2(TargetFrequencyParameter) octaves less than the m_frequency:
+
+ // Note:
+ // Instead of m_frequency/TargetFrequencyParameter > newFrequency,
+ // the comparison is done without a div instructions by
+ // m_frequency > newFrequency * TargetFrequencyParameter.
+
+ if (m_frequency > newFrequency * TargetFrequencyParameter) {
+ // Set the difference value to be -m_maximumVoiceDifference.
+ qDebug() << "compare" << "low" << newFrequency << m_frequency - stepSizeInFrequency * correctIndex << (m_frequency - stepSizeInFrequency * correctIndex) / stepSizeInFrequency;
+ value = -m_maximumVoiceDifference;
+ }
+ // Else, if the obtained frequency is more than
+ // log_2(TargetFrequencyParameter) octaves more than the m_frequency:
+ else if (m_frequency*TargetFrequencyParameter < newFrequency) {
+ // Set the difference value to be m_maximumVoiceDifference.
+ qDebug() << "compare" << "high" << newFrequency << m_frequency - stepSizeInFrequency * correctIndex << (m_frequency - stepSizeInFrequency * correctIndex) / stepSizeInFrequency;
+ value = m_maximumVoiceDifference;
+ }
+ // Else:
+ else {
+ // Calculate the difference between the obtained and the correct
+ // frequency in tones.
+ // Use stepSizeInFrequency * correctIndex instead of
+ // m_frequency so that the value is zero when there is correct
+ // voice obtained. Set the difference value to be
+ // log(frequency / target frequency) * 12 / log(2).
+ value = log(newFrequency / (stepSizeInFrequency * correctIndex))
+ * 12 / M_LN2;
+ qDebug() << "compare" << value << newFrequency << m_frequency - stepSizeInFrequency * correctIndex << (m_frequency - stepSizeInFrequency * correctIndex) / stepSizeInFrequency;
+ }
+
+ // Emit voiceDifference signal.
+ QVariant valueVar(value); //Has to be QVariant for QML
+ emit voiceDifference(valueVar);
+
+ // If the correctIndex is index, emit the correctFrequency signal.
+ if (correctIndex == index) {
+ emit(correctFrequency());
+ }
+}
+
+/**
+ * Empty implementation for readData, since no data is provided
+ * by the VoiceAnalyzer class.
+ */
+qint64 VoiceAnalyzer::readData(char *data, qint64 maxlen)
+{
+ Q_UNUSED(data);
+ Q_UNUSED(maxlen);
+
+ return 0;
+}
diff --git a/demos/mobile/guitartuner/src/voiceanalyzer.h b/demos/mobile/guitartuner/src/voiceanalyzer.h
new file mode 100644
index 0000000..147a0d6
--- /dev/null
+++ b/demos/mobile/guitartuner/src/voiceanalyzer.h
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef VOICEANALYZER_H
+#define VOICEANALYZER_H
+
+#include <QObject>
+#include <QAudioFormat>
+#include <QDebug>
+#include <QtCore/qmath.h>
+#include <QtCore/qendian.h>
+#include <QVariant>
+
+#include "constants.h"
+#include "fastfouriertransformer.h"
+#include "math.h"
+
+class VoiceAnalyzer : public QIODevice
+{
+ Q_OBJECT
+public:
+ VoiceAnalyzer(const QAudioFormat &format, QObject *parent = 0);
+ qint64 readData(char *data, qint64 maxlen);
+ qint64 writeData(const char *data, qint64 maxlen);
+ void start(qreal frequency);
+ void stop();
+ qreal frequency();
+ int getMaximumVoiceDifference();
+ int getMaximumPrecisionPerNote();
+
+public slots:
+ void setCutOffPercentage(qreal cutoff);
+
+private:
+ const QAudioFormat m_format;
+ QList<qint16> m_samples;
+ int m_totalSampleCount;
+ int m_maximumVoiceDifference;
+
+ qint16 getValueInt16(const uchar *ptr);
+ int m_stepSize;
+ qreal m_frequency;
+ qint64 m_position;
+ FastFourierTransformer *m_fftHelper;
+ void analyzeVoice();
+signals:
+ void voiceDifference(QVariant frequency);
+ void correctFrequency();
+ void lowVoice();
+
+public slots:
+
+};
+
+
+#endif // VOICEANALYZER_H
diff --git a/demos/mobile/guitartuner/src/voicegenerator.cpp b/demos/mobile/guitartuner/src/voicegenerator.cpp
new file mode 100644
index 0000000..ce25b6e
--- /dev/null
+++ b/demos/mobile/guitartuner/src/voicegenerator.cpp
@@ -0,0 +1,246 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "voicegenerator.h"
+
+const int BufferSizeMilliseconds = 100;
+
+VoiceGenerator::VoiceGenerator(const QAudioFormat &format,
+ qreal frequency, qreal amplitude,
+ QObject *parent) :
+ QIODevice(parent),
+ m_format(format),
+ m_amplitude(0.5)
+{
+ Q_ASSERT(m_format.sampleSize() % 8 == 0);
+ int sampleBytes = m_format.channels() * (m_format.sampleSize() / 8);
+ // + 1 to round up, just to be sure that all samples fit.
+ qint64 samplesInBuffer = m_format.sampleRate()
+ * BufferSizeMilliseconds / 1000 + 1;
+ qint64 length = samplesInBuffer * sampleBytes;
+ m_buffer.resize(length);
+ m_max_position = 0;
+ m_position = 0;
+ m_amplitude = amplitude;
+ setFrequency(frequency);
+}
+
+VoiceGenerator::~VoiceGenerator()
+{
+}
+
+/**
+ * Opens the parent QIODevice.
+ */
+void VoiceGenerator::start()
+{
+ open(QIODevice::ReadOnly);
+}
+
+/**
+ * Closes the parent QIODevice. Resets the m_position to zero.
+ */
+void VoiceGenerator::stop()
+{
+ close();
+ m_position = 0;
+}
+
+/**
+ * Sets the frequency to new frequency.
+ */
+void VoiceGenerator::setFrequency(qreal frequency)
+{
+ Q_ASSERT(1 / frequency < BufferSizeMilliseconds);
+ this->m_frequency = frequency;
+ refreshData();
+}
+
+/**
+ * Sets the amplitude for the voice.
+ */
+void VoiceGenerator::setAmplitude(qreal amplitude)
+{
+ Q_ASSERT(amplitude >= 0);
+ m_amplitude = amplitude;
+ refreshData();
+}
+
+/**
+ * Returns the current frequency.
+ */
+qreal VoiceGenerator::frequency()
+{
+ return m_frequency;
+}
+
+/**
+ * Generates voice data corresponding a sine voice with target frequency.
+ * The number of data generated is calculated
+ * and stored to m_max_position.
+ */
+void VoiceGenerator::refreshData()
+{
+ const int channelBytes = m_format.sampleSize() / 8;
+ const int sampleSize = m_format.channels() * channelBytes;
+ const qint64 voiceOscillationsInBuffer = BufferSizeMilliseconds
+ * m_frequency / 1000;
+ const qint64 voiceSamplesInBuffer = voiceOscillationsInBuffer
+ * m_format.sampleRate() / m_frequency;
+ m_max_position = voiceSamplesInBuffer * sampleSize;
+ qint64 dataGenerationLength = m_buffer.size();
+
+
+ Q_ASSERT(m_max_position % (sampleSize) == 0);
+ Q_ASSERT(dataGenerationLength <= m_buffer.size());
+
+ short *t = (short*)m_buffer.data();
+
+
+/*
+ int te ;
+ static float fpos = 0.0f;
+ //dataGenerationLength>>=1; // in words
+ for (int f=0; f<dataGenerationLength; f++) {
+ te = (short)((sinf(fpos))* (65536.0f/2.0f));
+ fpos += m_frequency/2000.0f;
+ t[f]= te;
+ };
+
+ m_amplitude = 1.0f; */
+ uchar *ptr = reinterpret_cast<uchar *>(m_buffer.data());
+ int sampleIndex = 0;
+ while (dataGenerationLength > 0) {
+ qreal realValue = 0;
+ if (sampleIndex < voiceSamplesInBuffer) {
+ realValue = m_amplitude
+ *qSin(2.0f * M_PI * m_frequency
+ * qreal(sampleIndex % m_format.sampleRate())
+ / m_format.sampleRate());
+ }
+ for (int i=0; i<m_format.channels(); ++i) {
+ setValue(ptr, realValue);
+ ptr += channelBytes;
+ dataGenerationLength -= channelBytes;
+ }
+ ++sampleIndex;
+ }
+}
+
+/**
+ * Stores the realValue into bytes pointed by ptr as an int value.
+ * Align-safe.
+ */
+void VoiceGenerator::setValue(uchar *ptr, qreal realValue) {
+ if (m_format.sampleSize() == 8)
+ {
+ quint8 value = 0;
+ if (m_format.sampleType() == QAudioFormat::UnSignedInt) {
+ value = static_cast<quint8>(
+ qRound((1.0 + realValue) / 2
+ * M_MAX_AMPLITUDE_8BIT_UNSIGNED));
+ } else if (m_format.sampleType() == QAudioFormat::SignedInt) {
+ value = static_cast<qint8>(
+ qRound(realValue
+ * M_MAX_AMPLITUDE_8BIT_SIGNED));
+ }
+ *reinterpret_cast<quint8*>(ptr) = value;
+ } else if (m_format.sampleSize() == 16) {
+ quint16 value = 0;
+ if (m_format.sampleType() == QAudioFormat::UnSignedInt) {
+ value = static_cast<quint16>(
+ qRound((1.0 + realValue) / 2
+ * M_MAX_AMPLITUDE_16BIT_UNSIGNED));
+ } else if (m_format.sampleType() == QAudioFormat::SignedInt) {
+ value = static_cast<qint16>(
+ qRound(realValue
+ * M_MAX_AMPLITUDE_16BIT_SIGNED));
+ }
+ if (m_format.byteOrder() == QAudioFormat::LittleEndian)
+ qToLittleEndian<qint16>(value, ptr);
+ else
+ qToBigEndian<qint16>(value, ptr);
+ }
+}
+
+qint64 VoiceGenerator::bytesAvailable() const
+{
+ return m_max_position + QIODevice::bytesAvailable();
+}
+
+/**
+ * Called by the QIODevice. Puts maxlen amount of voice
+ * samples into the data array.
+ */
+qint64 VoiceGenerator::readData(char *data, qint64 maxlen)
+{
+ qint64 total = 0;
+ qint64 chunk = 0;
+ while (total < maxlen) {
+ if (maxlen - total >= m_max_position - m_position) {
+ // the needed buffer is longer than the currently
+ // available buffer from m_position to the m_max_position
+ chunk = m_max_position - m_position;
+ memcpy(data, m_buffer.constData() + m_position, chunk);
+ m_position = 0;
+ }
+ else {
+ // we can copy the needed data directly, and the loop will end
+ chunk = maxlen - total;
+ memcpy(data, m_buffer.constData() + m_position, chunk);
+ m_position = (m_position + chunk) % m_max_position;
+ }
+ data += chunk;
+ total += chunk;
+ }
+ return total;
+}
+
+/**
+ * Empty implementation for writeData, since no data is provided
+ * for the VoiceGenerator class.
+ */
+qint64 VoiceGenerator::writeData(const char *data, qint64 maxlen)
+{
+ Q_UNUSED(data);
+ Q_UNUSED(maxlen);
+
+ return 0;
+}
diff --git a/demos/mobile/guitartuner/src/voicegenerator.h b/demos/mobile/guitartuner/src/voicegenerator.h
new file mode 100644
index 0000000..e4abd90
--- /dev/null
+++ b/demos/mobile/guitartuner/src/voicegenerator.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef VOICEGENERATOR_H
+#define VOICEGENERATOR_H
+
+#include <QIODevice>
+#include <QByteArray>
+#include <QAudioFormat>
+#include <QtCore/qmath.h>
+#include <QtCore/qendian.h>
+#include <QDebug>
+
+#include "constants.h"
+
+
+class VoiceGenerator : public QIODevice
+{
+ Q_OBJECT
+public:
+ VoiceGenerator(const QAudioFormat &format, qreal frequency, qreal amplitude, QObject *parent = 0);
+ ~VoiceGenerator();
+ void setFrequency(qreal frequency);
+ qint64 readData(char *data, qint64 maxlen);
+ qint64 writeData(const char *data, qint64 maxlen);
+ qint64 bytesAvailable() const;
+ qreal frequency();
+signals:
+
+public slots:
+ void setAmplitude(qreal amplitude);
+ void start();
+ void stop();
+
+private:
+ void setValue(uchar *ptr, qreal realValue);
+ void refreshData();
+ const QAudioFormat m_format;
+ // buffer to store the data
+ QByteArray m_buffer;
+ // current position in buffer
+ qint64 m_position;
+ // max position depends on the sample rate of format and the frequency of voice
+ qint64 m_max_position;
+ qreal m_amplitude;
+ qreal m_frequency;
+};
+
+#endif // VOICEGENERATOR_H
diff --git a/demos/mobile/qcamera/businesscardhandling.cpp b/demos/mobile/qcamera/businesscardhandling.cpp
new file mode 100755
index 0000000..f7467c4
--- /dev/null
+++ b/demos/mobile/qcamera/businesscardhandling.cpp
@@ -0,0 +1,148 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "businesscardhandling.h"
+#include <QFile>
+
+BusinessCardHandling::BusinessCardHandling(QObject *parent) :
+ QObject(parent)
+{
+}
+
+BusinessCardHandling::~BusinessCardHandling()
+{
+ delete m_contactManager;
+}
+
+void BusinessCardHandling::createContactManager()
+{
+#if defined Q_WS_MAEMO_5
+ m_contactManager = new QContactManager("maemo5");
+#elif defined Q_OS_SYMBIAN
+ m_contactManager = new QContactManager("symbian");
+#endif
+
+ // Use default
+ if (!m_contactManager) {
+ m_contactManager = new QContactManager();
+ }
+}
+
+void BusinessCardHandling::storeAvatarToContact(QString phoneNumber, QString filename,
+ QPixmap pixmap)
+{
+ // Create QContactManager
+ if (!m_contactManager) {
+ createContactManager();
+ }
+
+ // Search contacts and save avatar
+ QContact contact;
+ if (findContact(phoneNumber, contact)) {
+ saveAvatar(filename, pixmap, contact);
+ }
+}
+
+bool BusinessCardHandling::findContact(const QString phoneNumber, QContact& c)
+{
+ // Create QContactManager
+ if (!m_contactManager) {
+ createContactManager();
+ }
+
+ QContact contact;
+ QContactDetailFilter phoneFilter;
+ phoneFilter.setDetailDefinitionName(QContactPhoneNumber::DefinitionName,
+ QContactPhoneNumber::FieldNumber);
+
+#if defined Q_WS_MAEMO_5
+ // Workaround for Maemo bug http://bugreports.qt.nokia.com/browse/QTMOBILITY-437
+ phoneFilter.setValue(phoneNumber.right(7));
+ phoneFilter.setMatchFlags(QContactFilter::MatchContains);
+#else
+ phoneFilter.setValue(phoneNumber);
+ phoneFilter.setMatchFlags(QContactFilter::MatchPhoneNumber);
+#endif
+
+ // Find contacts
+ QList<QContact> matchingContacts = m_contactManager->contacts(phoneFilter);
+ if (matchingContacts.size() > 0) {
+ contact = matchingContacts.at(0);
+ c = contact;
+ return true;
+ } else {
+ return false;
+ }
+}
+
+void BusinessCardHandling::saveAvatar(const QString filename, QPixmap p, QContact& contact)
+{
+
+ // Path to store avatar picture
+ QString path;
+#ifdef Q_OS_SYMBIAN
+ path.append("c:/System/");
+#endif
+ path.append(filename);
+
+ // Remove same file if exists
+ QFile file;
+ if (file.exists(path))
+ file.remove(path);
+
+ // Save pixmap into file
+ bool saveRet = p.save(path);
+
+ if (saveRet) {
+ // Create avatar
+ QContactAvatar contactAvatar;
+ contactAvatar.setImageUrl(QUrl(path));
+ bool saveAvatar = contact.saveDetail(&contactAvatar);
+
+ // Save contact
+ if (saveAvatar)
+ m_contactManager->saveContact(&contact);
+
+ // NOTE: Do not remove picture, system needs it for showing avatar
+ // Remove picture file
+ //bool removeRet = file.remove(path);
+ }
+}
+
diff --git a/demos/mobile/qcamera/businesscardhandling.h b/demos/mobile/qcamera/businesscardhandling.h
new file mode 100755
index 0000000..f67dd36
--- /dev/null
+++ b/demos/mobile/qcamera/businesscardhandling.h
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef BUSINESSCARDHANDLING_H
+#define BUSINESSCARDHANDLING_H
+
+#include <QObject>
+#include <QPointer>
+#include <QPixmap>
+
+// QtMobility API headers
+// Contacts
+#include <QContactDetailFilter>
+#include <QContactManager>
+#include <QContactPhoneNumber>
+#include <QContactSortOrder>
+#include <QContact>
+#include <QContactName>
+#include <QContactAvatar>
+
+
+// QtMobility namespace
+QTM_USE_NAMESPACE
+
+class BusinessCardHandling: public QObject
+{
+Q_OBJECT
+
+public:
+ BusinessCardHandling(QObject *parent = 0);
+ ~BusinessCardHandling();
+
+ bool findContact(const QString phoneNumber, QContact& contact);
+
+public slots:
+ void storeAvatarToContact(QString, QString, QPixmap);
+
+private:
+ void createContactManager();
+ void saveAvatar(const QString filename, QPixmap p, QContact& contact);
+
+private:
+ QPointer<QContactManager> m_contactManager;
+};
+
+#endif // BUSINESSCARDHANDLING_H
diff --git a/demos/mobile/qcamera/button.cpp b/demos/mobile/qcamera/button.cpp
new file mode 100755
index 0000000..2a54cd8
--- /dev/null
+++ b/demos/mobile/qcamera/button.cpp
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "button.h"
+#include <QMouseEvent>
+#include <QPainter>
+#include <QTimer>
+
+Button::Button(QWidget *parent, Qt::WindowFlags f) :
+ QLabel(parent, f)
+{
+ m_downPixmap = 0;
+ m_disabled = false;
+}
+
+Button::~Button()
+{
+}
+
+void Button::disableBtn(bool b)
+{
+ m_disabled = b;
+ if (m_disabled) {
+ setPixmap(m_downPixmap);
+ } else {
+ setPixmap(m_upPixmap);
+ }
+}
+
+void Button::mousePressEvent(QMouseEvent *event)
+{
+ if (!m_disabled) {
+ event->accept();
+ setPixmap(m_downPixmap);
+ repaint();
+ // Lift button back to up after 300ms
+ QTimer::singleShot(300, this, SLOT(backToUp()));
+ }
+}
+
+void Button::backToUp()
+{
+ setPixmap(m_upPixmap);
+ repaint();
+ emit pressed();
+}
+
+void Button::setPixmap(const QPixmap& p)
+{
+ // Set up and down picture for the button
+ // Set pixmap
+ if (!p.isNull())
+ QLabel::setPixmap(p);
+
+ // Make down pixmap if it does not exists
+ if (m_downPixmap.isNull()) {
+ // Store up pixmap
+ m_upPixmap = *pixmap();
+
+ // Create down pixmap
+ // Make m_downPixmap as a transparent m_upPixmap
+ QPixmap transparent(m_upPixmap.size());
+ transparent.fill(Qt::transparent);
+ QPainter painter(&transparent);
+ painter.setCompositionMode(QPainter::CompositionMode_Source);
+ painter.drawPixmap(0, 0, m_upPixmap);
+ painter.setCompositionMode(QPainter::CompositionMode_DestinationIn);
+ painter.fillRect(transparent.rect(), QColor(0, 0, 0, 150));
+ painter.end();
+ m_downPixmap = transparent;
+ }
+
+}
diff --git a/demos/mobile/qcamera/button.h b/demos/mobile/qcamera/button.h
new file mode 100755
index 0000000..f988713
--- /dev/null
+++ b/demos/mobile/qcamera/button.h
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef BUTTON_H
+#define BUTTON_H
+
+#include <QLabel>
+#include <QPixmap>
+
+class Button: public QLabel
+{
+Q_OBJECT
+
+public:
+ Button(QWidget *parent = 0, Qt::WindowFlags f = 0);
+ ~Button();
+
+ void mousePressEvent(QMouseEvent *);
+ void disableBtn(bool);
+
+public Q_SLOTS:
+ void setPixmap(const QPixmap &);
+ void backToUp();
+
+ signals:
+ void pressed();
+
+private:
+ QPixmap m_upPixmap;
+ QPixmap m_downPixmap;
+ bool m_disabled;
+
+};
+
+#endif // BUTTON_H
diff --git a/demos/mobile/qcamera/cameraexample.cpp b/demos/mobile/qcamera/cameraexample.cpp
new file mode 100755
index 0000000..1c6a4f0
--- /dev/null
+++ b/demos/mobile/qcamera/cameraexample.cpp
@@ -0,0 +1,517 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "cameraexample.h"
+#include "messagehandling.h"
+#include "contactsdlg.h"
+#include "button.h"
+#include "businesscardhandling.h"
+#include <QDebug>
+
+/*****************************************************************************
+* MyVideoSurface
+*/
+MyVideoSurface::MyVideoSurface(QWidget* widget, VideoIF* target, QObject* parent)
+ : QAbstractVideoSurface(parent)
+{
+ m_targetWidget = widget;
+ m_target = target;
+ m_imageFormat = QImage::Format_Invalid;
+}
+
+MyVideoSurface::~MyVideoSurface()
+{
+}
+
+bool MyVideoSurface::start(const QVideoSurfaceFormat &format)
+{
+ m_videoFormat = format;
+ const QImage::Format imageFormat = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat());
+ const QSize size = format.frameSize();
+
+ if (imageFormat != QImage::Format_Invalid && !size.isEmpty()) {
+ m_imageFormat = imageFormat;
+ QAbstractVideoSurface::start(format);
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool MyVideoSurface::present(const QVideoFrame &frame)
+{
+ m_frame = frame;
+ if (surfaceFormat().pixelFormat() != m_frame.pixelFormat() ||
+ surfaceFormat().frameSize() != m_frame.size()) {
+ stop();
+ return false;
+ } else {
+ m_target->updateVideo();
+ return true;
+ }
+}
+
+void MyVideoSurface::paint(QPainter *painter)
+ {
+ if (m_frame.map(QAbstractVideoBuffer::ReadOnly)) {
+ QImage image(
+ m_frame.bits(),
+ m_frame.width(),
+ m_frame.height(),
+ m_frame.bytesPerLine(),
+ m_imageFormat);
+
+ QRect r = m_targetWidget->rect();
+ QPoint centerPic((qAbs(r.size().width() - image.size().width())) / 2, (qAbs(
+ r.size().height() - image.size().height())) / 2);
+
+ if (!image.isNull()) {
+ painter->drawImage(centerPic,image);
+ }
+
+ m_frame.unmap();
+ }
+ }
+
+QList<QVideoFrame::PixelFormat> MyVideoSurface::supportedPixelFormats(
+ QAbstractVideoBuffer::HandleType handleType) const
+{
+ if (handleType == QAbstractVideoBuffer::NoHandle) {
+ return QList<QVideoFrame::PixelFormat>()
+ << QVideoFrame::Format_RGB32
+ << QVideoFrame::Format_ARGB32
+ << QVideoFrame::Format_ARGB32_Premultiplied
+ << QVideoFrame::Format_RGB565
+ << QVideoFrame::Format_RGB555;
+ } else {
+ return QList<QVideoFrame::PixelFormat>();
+ }
+}
+
+
+/*****************************************************************************
+* CameraExample
+*/
+CameraExample::CameraExample(QWidget *parent) :
+ QMainWindow(parent)
+{
+ setWindowTitle("QCameraExample");
+
+ // Opitimizations for screen update and drawing qwidget
+ setAutoFillBackground(false);
+
+ // Prevent to screensaver to activate
+ m_systemScreenSaver = new QSystemScreenSaver(this);
+ m_systemScreenSaver->setScreenSaverInhibit();
+
+ m_myVideoSurface = 0;
+ pictureCaptured = false;
+ showViewFinder = false;
+ m_focusing = false;
+
+ // MMS handling
+ m_message = new Message(this);
+ QObject::connect(m_message, SIGNAL(messageStateChanged(int)), this, SLOT(messageStateChanged(int)));
+ QObject::connect(m_message, SIGNAL(messageReceived(QString,QString,QPixmap)), this, SLOT(messageReceived(QString,QString,QPixmap)));
+
+ // Business card handling (Contact's avatar picture)
+ m_businessCardHandling = new BusinessCardHandling(this);
+
+ // Black background
+ QPalette palette = this->palette();
+ palette.setColor(QPalette::Background, Qt::black);
+ setPalette(palette);
+
+ // Main widget & layout
+ QWidget* mainWidget = new QWidget(this);
+ mainWidget->setPalette(palette);
+
+ QHBoxLayout* hboxl = new QHBoxLayout;
+ hboxl->setSpacing(0);
+ hboxl->setMargin(0);
+
+ // UI stack
+ m_stackedWidget = new QStackedWidget();
+ m_stackedWidget->setPalette(palette);
+
+ // First widget to stack
+ m_videoWidget = new QWidget();
+ m_videoWidget->setPalette(palette);
+ m_stackedWidget->addWidget(m_videoWidget);
+
+ // Second widget to stack
+ QWidget* secondWidget = new QWidget(this);
+ secondWidget->setPalette(palette);
+ m_stackedWidget->addWidget(secondWidget);
+ m_stackedWidget->setCurrentIndex(0);
+
+ hboxl->addWidget(m_stackedWidget);
+
+ // Buttons
+ QSize iconSize(80, 80);
+ QVBoxLayout* vboxl = new QVBoxLayout;
+ vboxl->setSpacing(0);
+ vboxl->setMargin(0);
+
+ // Exit button
+ m_exit = new Button(this);
+ QObject::connect(m_exit, SIGNAL(pressed()), qApp, SLOT(quit()));
+ QPixmap p = QPixmap(":/icons/exit.png");
+ m_exit->setPixmap(p.scaled(iconSize, Qt::KeepAspectRatio, Qt::SmoothTransformation));
+ vboxl->addWidget(m_exit);
+ vboxl->setAlignment(m_exit, Qt::AlignHCenter | Qt::AlignTop);
+
+ // Camera button
+ m_cameraBtn = new Button(this);
+ QObject::connect(m_cameraBtn, SIGNAL(pressed()), this, SLOT(searchAndLock()));
+ p = QPixmap(":/icons/camera.png");
+ m_cameraBtn->setPixmap(p.scaled(iconSize, Qt::KeepAspectRatio, Qt::SmoothTransformation));
+ vboxl->addWidget(m_cameraBtn);
+ vboxl->setAlignment(m_cameraBtn, Qt::AlignCenter);
+
+ // Send MMS button
+ m_mms = new Button(this);
+ QObject::connect(m_mms, SIGNAL(pressed()), this, SLOT(openContactsDlg()));
+ p = QPixmap(":/icons/mms.png");
+ m_mms->setPixmap(p.scaled(iconSize, Qt::KeepAspectRatio, Qt::SmoothTransformation));
+ vboxl->addWidget(m_mms);
+ vboxl->setAlignment(m_mms, Qt::AlignHCenter | Qt::AlignBottom);
+#ifndef MESSAGING_ENABLED
+ m_mms->disableBtn(true);
+ m_mms->setEnabled(false);
+#endif
+
+ hboxl->addLayout(vboxl);
+ mainWidget->setLayout(hboxl);
+
+ setCentralWidget(mainWidget);
+
+ // Enable camera after 1s, so that the application is started
+ // and widget is created to landscape orientation
+ QTimer::singleShot(1000,this,SLOT(enableCamera()));
+}
+
+CameraExample::~CameraExample()
+{
+if (m_myVideoSurface)
+ m_myVideoSurface->stop();
+ m_camera->stop();
+ delete m_stackedWidget;
+ delete m_stillImageCapture;
+ delete m_camera;
+}
+
+
+void CameraExample::enableCamera()
+{
+ m_camera = new QCamera();
+ m_camera->setCaptureMode(QCamera::CaptureStillImage);
+ connect(m_camera, SIGNAL(error(QCamera::Error)), this, SLOT(error(QCamera::Error)));
+ connect(m_camera, SIGNAL(lockStatusChanged(QCamera::LockStatus,QCamera::LockChangeReason)), this, SLOT(lockStatusChanged(QCamera::LockStatus,QCamera::LockChangeReason)));
+
+ // Own video output drawing that shows camera view finder pictures
+ //! [0]
+ QMediaService* ms = m_camera->service();
+ QVideoRendererControl* vrc = ms->requestControl<QVideoRendererControl*>();
+ m_myVideoSurface = new MyVideoSurface(this,this,this);
+ vrc->setSurface(m_myVideoSurface);
+//! [0]
+ // Image capturer
+ m_stillImageCapture = new QCameraImageCapture(m_camera);
+ connect(m_stillImageCapture, SIGNAL(imageCaptured(int,QImage)), this, SLOT(imageCaptured(int,QImage)));
+
+ // Start camera
+ if (m_camera->state() == QCamera::ActiveState) {
+ m_camera->stop();
+ }
+ m_videoWidget->show();
+ m_camera->start();
+ showViewFinder = true;
+}
+
+void CameraExample::mousePressEvent(QMouseEvent *event)
+{
+ QMainWindow::mousePressEvent(event);
+
+ if (pictureCaptured) {
+ // Starting view finder
+ pictureCaptured = false;
+ m_stackedWidget->setCurrentIndex(0);
+ if (m_myVideoSurface) {
+ showViewFinder = true;
+ }
+ }
+}
+
+void CameraExample::searchAndLock()
+{
+ m_focusing = false;
+ m_focusMessage.clear();
+
+ if (pictureCaptured) {
+ // Starting view finder again
+ pictureCaptured = false;
+ m_stackedWidget->setCurrentIndex(0);
+ if (m_myVideoSurface) {
+ showViewFinder = true;
+ }
+ }
+ else {
+ // Search and lock picture (=focus)
+ if (m_camera->supportedLocks() & QCamera::LockFocus) {
+ m_focusing = true;
+ m_focusMessage = "Focusing...";
+ m_camera->searchAndLock(QCamera::LockFocus);
+ } else {
+ // No focus functionality, take picture right away
+ captureImage();
+ }
+ }
+}
+
+void CameraExample::lockStatusChanged(QCamera::LockStatus status, QCamera::LockChangeReason reason)
+{
+ if (status == QCamera::Locked) {
+ if (reason == QCamera::LockAcquired) {
+ // Focus locked
+ m_focusMessage.clear();
+ m_focusing = false;
+ // Capture new image
+ captureImage();
+ // Unlock camera
+ m_camera->unlock();
+ } else {
+ if (m_focusing)
+ m_focusMessage = "No focus, try again";
+ }
+ } else if (status == QCamera::Unlocked && m_focusing) {
+ m_focusMessage = "No focus, try again";
+ }
+}
+
+void CameraExample::captureImage()
+{
+ if (pictureCaptured) {
+ // Starting view finder again
+ pictureCaptured = false;
+ m_stackedWidget->setCurrentIndex(0);
+ showViewFinder = true;
+ }
+ else {
+ // Capturing image
+ showViewFinder = false;
+ // Get picture location where to store captured images
+ QString path(QDesktopServices::storageLocation(QDesktopServices::PicturesLocation));
+ QDir dir(path);
+
+ // Get next filename
+ QStringList files = dir.entryList(QStringList() << "camera_*.jpg");
+ int lastImage = 0;
+ foreach ( QString fileName, files ) {
+ int imgNumber = fileName.mid(7, fileName.size() - 11).toInt();
+ lastImage = qMax(lastImage, imgNumber);
+ }
+ // Capture image
+ if (m_stillImageCapture->isReadyForCapture()) {
+ m_imageName = QString("camera_%1.jpg").arg(lastImage+1);
+ m_stillImageCapture->capture(m_imageName);
+ }
+ }
+}
+
+void CameraExample::imageCaptured(int id, const QImage &preview)
+{
+ showViewFinder = false;
+ m_focusing = false;
+
+ // Image captured, show it to the user
+ m_stackedWidget->setCurrentIndex(1);
+
+ // Get picture location
+ QString path(QDesktopServices::storageLocation(QDesktopServices::PicturesLocation));
+ m_imageName.prepend(path + "/");
+
+ m_capturedImage = preview;
+
+ // Set suitable size to the image
+ QSize s = m_videoWidget->size();
+ s = s - QSize(20, 20);
+ m_capturedImage = m_capturedImage.scaled(s, Qt::KeepAspectRatio, Qt::SmoothTransformation);
+
+ pictureCaptured = true;
+ update();
+}
+
+void CameraExample::error(QCamera::Error e)
+{
+ switch (e) {
+ case QCamera::NoError:
+ {
+ break;
+ }
+ case QCamera::CameraError:
+ {
+ QMessageBox::warning(this, "QCameraExample", "General Camera error");
+ break;
+ }
+ case QCamera::InvalidRequestError:
+ {
+ QMessageBox::warning(this, "QCameraExample", "Camera invalid request error");
+ break;
+ }
+ case QCamera::ServiceMissingError:
+ {
+ QMessageBox::warning(this, "QCameraExample", "Camera service missing error");
+ break;
+ }
+ case QCamera::NotSupportedFeatureError :
+ {
+ QMessageBox::warning(this, "QCameraExample", "Camera not supported error");
+ break;
+ }
+ };
+}
+
+void CameraExample::openContactsDlg()
+{
+ // Open dialog for showing contacts
+ if (!m_contactsDialog) {
+
+ if (m_capturedImage.isNull()) {
+ QMessageBox::information(this, "QCameraExample", "Take picture first");
+ return;
+ }
+
+ // Show dialog
+ m_contactsDialog = new ContactsDialog(this);
+ QObject::connect(m_contactsDialog, SIGNAL(contactSelected(QString)),
+ this, SLOT(contactSelected(QString)));
+ m_contactsDialog->exec();
+ QObject::disconnect(m_contactsDialog, SIGNAL(contactSelected(QString)),
+ this, SLOT(contactSelected(QString)));
+
+ delete m_contactsDialog;
+ m_contactsDialog = 0;
+ }
+}
+
+void CameraExample::contactSelected(QString phoneNumber)
+{
+ m_phoneNumber = phoneNumber;
+ QTimer::singleShot(1000,this,SLOT(sendMMS()));
+}
+
+void CameraExample::sendMMS()
+{
+#ifdef MESSAGING_ENABLED
+ m_message->sendMMS(m_imageName, m_phoneNumber);
+#endif
+}
+
+void CameraExample::messageStateChanged(int /*error*/)
+{
+}
+
+void CameraExample::updateVideo()
+{
+ if (showViewFinder) {
+ repaint();
+ }
+}
+
+void CameraExample::paintEvent(QPaintEvent *event)
+{
+ //QMainWindow::paintEvent(event);
+
+ QPainter painter(this);
+ QRect r = this->rect();
+
+ QFont font = painter.font();
+ font.setPixelSize(20);
+ painter.setFont(font);
+ painter.setPen(Qt::white);
+
+ if (showViewFinder && m_myVideoSurface && m_myVideoSurface->isActive()) {
+ // Show view finder
+ m_myVideoSurface->paint(&painter);
+
+ // Paint focus message
+ if (!m_focusMessage.isEmpty())
+ painter.drawText(r, Qt::AlignCenter, m_focusMessage);
+
+ } else {
+ // Draw black
+ painter.fillRect(event->rect(), palette().background());
+ // Show captured image
+ if (pictureCaptured) {
+ // Paint captured image
+ QPoint centerPic((qAbs(r.size().width() - m_capturedImage.size().width())) / 2, (qAbs(
+ r.size().height() - m_capturedImage.size().height())) / 2);
+
+ painter.drawImage(centerPic, m_capturedImage);
+
+ // Paint filename
+ painter.drawText(r, Qt::AlignBottom | Qt::AlignCenter, m_imageName);
+ }
+ }
+
+}
+
+void CameraExample::messageReceived(QString phoneNumber, QString filename, QPixmap pixmap)
+{
+#ifdef MESSAGING_ENABLED
+ // MMS message received
+ // Check that is came from some of our contact
+ QContact contact;
+ if (m_businessCardHandling->findContact(phoneNumber, contact)) {
+ // Ask from user to store it as sender avatar picture into contacts
+ if (QMessageBox::question(
+ this,
+ "QCameraExample",
+ QString(
+ "MMS picture message received from %1. Do you want to store it as sender avatar picture?").arg(
+ contact.displayLabel()), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
+
+ m_businessCardHandling->storeAvatarToContact(phoneNumber, filename, pixmap);
+ }
+ }
+#endif
+}
+
diff --git a/demos/mobile/qcamera/cameraexample.h b/demos/mobile/qcamera/cameraexample.h
new file mode 100755
index 0000000..8098ff4
--- /dev/null
+++ b/demos/mobile/qcamera/cameraexample.h
@@ -0,0 +1,157 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QCAMERAEXAMPLE_H
+#define QCAMERAEXAMPLE_H
+
+#include <QtGui>
+
+// Multimedia API in QtMobility API
+// Unlike the other APIs in Qt Mobility,
+// the Multimedia API is not in the QtMobility namespace "QTM_USE_NAMESPACE"
+#include <QCamera>
+#include <QCameraImageCapture>
+
+// QtMobility API
+#include <QSystemScreenSaver>
+QTM_USE_NAMESPACE
+
+
+#include <QAbstractVideoSurface>
+#include <QVideoRendererControl>
+#include <QVideoSurfaceFormat>
+
+/*****************************************************************************
+* MyVideoSurface
+*/
+class VideoIF
+{
+public:
+ virtual void updateVideo() = 0;
+};
+class MyVideoSurface: public QAbstractVideoSurface
+{
+Q_OBJECT
+
+public:
+ MyVideoSurface(QWidget* widget, VideoIF* target, QObject * parent = 0);
+ ~MyVideoSurface();
+
+ bool start(const QVideoSurfaceFormat &format);
+
+ bool present(const QVideoFrame &frame);
+
+ QList<QVideoFrame::PixelFormat> supportedPixelFormats(
+ QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const;
+
+ void paint(QPainter*);
+
+private:
+ QWidget* m_targetWidget;
+ VideoIF* m_target;
+ QVideoFrame m_frame;
+ QImage::Format m_imageFormat;
+ QVideoSurfaceFormat m_videoFormat;
+};
+
+
+
+/*****************************************************************************
+* CameraExample
+*/
+class Message;
+class ContactsDialog;
+class Button;
+class BusinessCardHandling;
+class CameraExample: public QMainWindow, public VideoIF
+{
+Q_OBJECT
+
+public:
+ CameraExample(QWidget *parent = 0);
+ ~CameraExample();
+
+ void paintEvent(QPaintEvent*);
+ void mousePressEvent(QMouseEvent *);
+
+ void updateVideo();
+
+
+public slots:
+ void enableCamera();
+ void lockStatusChanged(QCamera::LockStatus status, QCamera::LockChangeReason reason);
+ void searchAndLock();
+ void captureImage();
+ void imageCaptured(int id, const QImage &preview);
+ void error(QCamera::Error);
+
+ void openContactsDlg();
+ void contactSelected(QString phoneNumber);
+
+ void messageStateChanged(int error);
+ void messageReceived(QString phoneNumber, QString filename, QPixmap pixmap);
+
+ void sendMMS();
+
+private:
+ QWidget* m_videoWidget;
+ QCamera* m_camera;
+ QCameraImageCapture* m_stillImageCapture;
+
+ QStackedWidget* m_stackedWidget;
+ Button* m_exit;
+ Button* m_cameraBtn;
+ Button* m_mms;
+ QImage m_capturedImage;
+ QString m_imageName;
+ QString m_focusMessage;
+ bool m_focusing;
+ QString m_phoneNumber;
+
+ Message* m_message;
+ QPointer<ContactsDialog> m_contactsDialog;
+ BusinessCardHandling* m_businessCardHandling;
+ bool pictureCaptured;
+ bool showViewFinder;
+ MyVideoSurface* m_myVideoSurface;
+ QSystemScreenSaver* m_systemScreenSaver;
+};
+
+#endif // QCAMERA_H
diff --git a/demos/mobile/qcamera/contactsdlg.cpp b/demos/mobile/qcamera/contactsdlg.cpp
new file mode 100755
index 0000000..defd34c
--- /dev/null
+++ b/demos/mobile/qcamera/contactsdlg.cpp
@@ -0,0 +1,159 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "contactsdlg.h"
+#include <QHBoxLayout>
+#include <QApplication>
+#include <QAction>
+#include <QTimer>
+#include <QPushButton>
+
+ContactsDialog::ContactsDialog(QWidget *parent) :
+ QDialog(parent)
+{
+ QHBoxLayout* l = new QHBoxLayout;
+ m_listWidget = new QListWidget(this);
+ l->addWidget(m_listWidget);
+
+ QVBoxLayout* lv = new QVBoxLayout;
+
+ QPushButton* backBtn = new QPushButton("Back",this);
+ QObject::connect(backBtn, SIGNAL(pressed()), this, SLOT(close()));
+ backBtn->setFixedWidth(100);
+ lv->addWidget(backBtn);
+ lv->setAlignment(backBtn,Qt::AlignTop);
+
+ QPushButton* okBtn = new QPushButton("Ok",this);
+ QObject::connect(okBtn, SIGNAL(pressed()), this, SLOT(selectContact()));
+ okBtn->setFixedWidth(100);
+ lv->addWidget(okBtn);
+ lv->setAlignment(okBtn,Qt::AlignBottom);
+
+ l->addLayout(lv);
+
+ setLayout(l);
+
+ // Remove context menu from the all widgets
+#ifdef Q_OS_SYMBIAN
+ QWidgetList widgets = QApplication::allWidgets();
+ QWidget* w = 0;
+ foreach (w,widgets)
+ {
+ w->setContextMenuPolicy(Qt::NoContextMenu);
+ }
+#endif
+
+ // Create QContactManager and search contacts
+ createContactManager();
+ searchContact();
+
+ showFullScreen();
+}
+
+ContactsDialog::~ContactsDialog()
+{
+ delete m_contactManager;
+}
+
+void ContactsDialog::createContactManager()
+{
+#if defined Q_WS_MAEMO_5
+ m_contactManager = new QContactManager("maemo5");
+#elif defined Q_OS_SYMBIAN
+ m_contactManager = new QContactManager("symbian");
+#endif
+
+ // Use default
+ if (!m_contactManager) {
+ m_contactManager = new QContactManager();
+ }
+
+}
+
+void ContactsDialog::searchContact()
+{
+ m_listWidget->clear();
+
+ // Sort contacts by lastname
+ QContactSortOrder sort;
+ sort.setDirection(Qt::AscendingOrder);
+ sort.setDetailDefinitionName(QContactName::DefinitionName, QContactName::FieldLastName);
+
+ // Build QListWidget from the contact list
+ QList<QContactLocalId> contactIds = m_contactManager->contactIds(sort);
+ QContact currContact;
+ foreach (const QContactLocalId& id, contactIds)
+ {
+ QListWidgetItem *currItem = new QListWidgetItem;
+ currContact = m_contactManager->contact(id);
+ QContactDisplayLabel dl = currContact.detail(QContactDisplayLabel::DefinitionName);
+ currItem->setData(Qt::DisplayRole, dl.label());
+ currItem->setData(Qt::UserRole, currContact.localId()); // also store the id of the contact
+ m_listWidget->addItem(currItem);
+ }
+
+ if (m_listWidget->count()>0) {
+ m_listWidget->setCurrentRow(0);
+ }
+}
+
+void ContactsDialog::selectContact()
+{
+ QList<QListWidgetItem*> items = m_listWidget->selectedItems();
+ if (!items.isEmpty()) {
+ itemClicked(items.first());
+ }
+}
+
+void ContactsDialog::itemClicked(QListWidgetItem *item)
+{
+ QVariant data = item->data(Qt::UserRole);
+ QContactLocalId id = data.toInt();
+ QContact contact = m_contactManager->contact(id);
+ QContactPhoneNumber cpn = contact.detail<QContactPhoneNumber> ();
+
+ // Emit contact phonenumber
+ if (!cpn.isEmpty()) {
+ emit contactSelected(cpn.number());
+ // Close dialog
+ close();
+ }
+}
+
diff --git a/demos/mobile/qcamera/contactsdlg.h b/demos/mobile/qcamera/contactsdlg.h
new file mode 100755
index 0000000..4397110
--- /dev/null
+++ b/demos/mobile/qcamera/contactsdlg.h
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef CONTACTSDIALOG_H
+#define CONTACTSDIALOG_H
+
+#include <QtGui/QDialog>
+#include <QListWidget>
+#include <QPointer>
+
+// QtMobility API headers
+// Contacts
+#include <QContactManager>
+#include <QContactPhoneNumber>
+#include <QContactSortOrder>
+#include <QContact>
+#include <QContactName>
+
+// QtMobility namespace
+QTM_USE_NAMESPACE
+
+class ContactsDialog: public QDialog
+{
+Q_OBJECT
+
+public:
+ ContactsDialog(QWidget *parent = 0);
+ ~ContactsDialog();
+
+public slots:
+ void itemClicked(QListWidgetItem *item);
+ void selectContact();
+
+signals:
+ void contactSelected(QString phoneNumber);
+
+private:
+ void createContactManager();
+ void searchContact();
+
+private:
+ QPointer<QContactManager> m_contactManager;
+ QListWidget* m_listWidget;
+};
+
+#endif // CONTACTSDIALOG_H
diff --git a/demos/mobile/qcamera/icons/camera.png b/demos/mobile/qcamera/icons/camera.png
new file mode 100755
index 0000000..dc4ecbf
--- /dev/null
+++ b/demos/mobile/qcamera/icons/camera.png
Binary files differ
diff --git a/demos/mobile/qcamera/icons/cameramms_icon.svg b/demos/mobile/qcamera/icons/cameramms_icon.svg
new file mode 100755
index 0000000..ae6f354
--- /dev/null
+++ b/demos/mobile/qcamera/icons/cameramms_icon.svg
@@ -0,0 +1,255 @@
+<?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="128"
+ height="128"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.48.0 r9654"
+ sodipodi:docname="camera.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.98994949"
+ inkscape:cx="474.09541"
+ inkscape:cy="161.58756"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1098"
+ inkscape:window-height="864"
+ inkscape:window-x="565"
+ inkscape:window-y="18"
+ inkscape:window-maximized="0" />
+ <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" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-924.36218)">
+ <image
+ y="923.7124"
+ x="-0.36037713"
+ id="image3004"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABHNCSVQICAgIfAhkiAAAIABJREFU
+eJztfXuYHVWV72/V49R59jPpTnfSSXceEAgvmYtE4bsBBnT8ooI4AR8QBhBhlMHvfiGAysAIfCZw
+B4SBBBkixBlQBCYjIChXHPhQbq48DQYIJIE0aciLkPQr3edU1V73j6pdvU+dqtPn9DkRvbdXf9VV
+Z79q7bXXXq+9qwqYhEmYhEmYhEmYhEmYhEmYhEmYhEmYhEmYhEmYhEmYhP/HgT6qG7/wwgtwHAeJ
+RGIMGSIwM4g8tJg5SJcQlV+uTBSE2wjfN6p8+B7jta3WKXePRCIBIQSOOuqocdv+i4ctW7Z81Cj8
+2cOePXv+pPc76BLgrbfewiGHHBL8fvHFF9vb29tPJ6L/ZprmDGZOlsODmaFp2sFG86CAEGJcqUFE
+o47jfMjMLw4ODv7qsMMOe0PmjYyM4I477sDy5csPGo4HjQF6e3sxa9YsAMCLL77Y2d7e/h1d18/W
+dX2KLCNFoiRSFLEqEbt/zqCqqXAaM5eoBdd1XSHEfwwPD9986KGHPg8Au3fvRltb20HBr+7U/djH
+Pobly5fjK1/5Ch599NHMMcccc28ikViiFGG/w6QOPBGxis9f+sCHIcQIzMykMoKfBig0cBxnw759
++5YceeSRm9944w3asmULf+5zn6srXnWn8rZt27Tu7m7x5ptvLslmsw/64lv2nuRg+6PPQaJPlIgm
+ixgjJj1ov0I0w21OpL5avhIcA5DMzmNcIa9JCBHUJSISQmB0dHTl7Nmzv83MGhGJcHu1QN2U66JF
+i8DM6O7uFps3b74tl8s9SESOL+Ykt7N/gD0AM0MIwa7ryrQwIHQO6oWuo/IrabOSsuO1H5UfxjkA
+13UhhCiqJ2kiSSOEgM8MTjKZvGrbtm2/l4P/5JNP1mvY6icB2Ndlmzdvvj+TyXyFmQURETNThJ4v
+mRl+56uRAH8JENsnKtVxUip4P8bsA/bPVCgUtnZ3d88FgDPPPBPr1q2rGcG6EHbTpk2YP38+3njj
+jRW5XO4qjHVcivhAzIfEvSpKOeIcxjMs9sMqoFyfxmtXTSvHdLXgFddHCqkFkhJErUtENDo6+vs5
+c+YslBOuVqjbzHr++ef/uqOj4ym1I+y7cCoDyE7JwIjSyTBe4Yw4hkFMWcTkRZWrpEy5+5QMaEzZ
+kvuoklEZ1IB+0pVUbCbq7+9fsWDBgu8sW7YMN998cxnUx4eaGWDXrl16e3u7+/bbb4+apmlJJKX4
+kqIuxK0lM6ZGFVCtmogqX482Ki2jqoAiqSCZQFEFLNWoLC+EoJdffrnnjDPO2FarFKjJCHziiSfQ
+3t7ubtiw4UbTNK0IAynKyCr3Oy4tzuCqtF5Uuai2qm2jEryq6r8/5uXqExHh8MMPf5CIcM0119TE
+ADWxT6FQwLXXXpu56KKL9uu6rhGRBkXMlQvwlAOOVgtxECdug+aqunl0+3FtRYr12IYmSAfJAGp9
+IQRt2bLl2FNPPfWVqhoNgTHRivPnz0cikcBzzz13jq7rhuRQP5t8McaapsmOqGI+TmdWYgSGy4ch
+nFZOz1eSF06LY4Jwf8LtVtV/35aSriCF6atpGlpbW68B8IUwc1QDNdsAr7322tZsNtvNXpBCyjAi
+ImiaxhI5P21cAkgiSfdH5ivuI0JtwJeLAaPFrPQV3dNPi7XWWdG7ajvwI5mhe8UygNp/KF5QXP/l
+vWUeEUEIQUofZFu2EMKcPXu2DmDCwaGabIATTzyxwTTN2bZtu0IIsBfwGbNWxmZ+YAuO12ZAUa+d
+sLtc1L5Sp2TwZbqST0obAX4hdUOhc4nolfVjZhxF9DFIi/D9I9tQrH5S8ZP0ZWa4rqs7joNf/vKX
+iypoMxYmrAIAYPny5Uc4jgPDMHQfQfbdPpWDA6MmwhMIX5eIYsUwUmdvrI8uGSHqPnG2hZLOEekU
+la8yUcS91NnNMfeN7b8sr0od2aYfISQpFSzLOhLA05EdqwBqYgAimsfMcByHdF2HrutF8W1/8Itc
+GGB8HRiaKWFdX24WVWITjGe0VdJ+XBvlYhVAlf1XVA6xHxMQQpAfSiYAEEJ8bJz+lIWaGMA0zRY/
+UCERV1f2JAeHvYKo2T7m/5TmRZatoFwlFnpUfpxBOF7ZinEM0UG9DtMB8reUokIIFkLAXzshIuqM
+wKtiqIkBbNvOuq4bRKqEENLwI994YU3TVH1ajRcQVEPxzIu7Bkpnb1xgKZwfVz+urShrf7zr4HeI
+DkBM/5UJpBqV5EsCyRQJ1AA1MYCCRInlijFrWXJ8WQmg6LqiPNX6VfLKERgxaWUhfB/FZhmvrdiZ
+H4F7UCaiT8E5IEbI9lBcQfKNbijLxxOCmrwA1YpWpZaiCmpesKjHgke4vXJHOp0G89gaRq33qgQi
+vJEiXMPXIc+gJhzrwgAKE0QZa9INksGM8LnIRQvXCf1Wy4Svw+WK0nxDigzDINM0i/AnIhiGgZ07
+d9Kq1asJAOmaVrKUXab9ctdRfSnqfzgtrv+hsrGMUw3UpAJCoIr6EoNQLRc6R6XV3QhkZpimiXvu
+uQd/3LgR3/j7v8e8efNYCIFdu3Zhz+49+NWTv+If3HorfvzjH+Piiy/GWUuWQNd1EBFpmlY3I7BM
+mbIqMEzPekjHmhlAmSHScGFmJmUrWNVuUEyd8a6BmNnpui6y2Szee+89XHfd9ZzOpPGb3/wGnZ2d
+1Nv7LlzHYRCQME3MnTuPEokEVq1ajR/eeSdWrFiBRYv+O2zbIWV3cqwRyMzsui4lk0kA4NHRUfKZ
+aEL99yeTGglUDULUCnWTAGH3D2NuYRSx1PN4afI60vCLCsQoBIPjONzX14dvfetb2Lr1bUyZOgXN
+zS1IpVIYGRnBtGnTAAJ0TYdhGEin05xKpyGEwNDgAP7HsmX09a9dhIsv/jps22bDGCOZHwNBMpmU
+NgMTEd5//31ce+0/saZruOD887m7uxuhQay4/2ogSNKTPEA9oJ4qAFDcF0TP5vAgRs2AuLJqWtxK
+Y1G+67owTZOWLbsc27b1oqWlBelMBk3NTZxKptDY2AjHcbzyGkHTdDK8gBYA76mdbK4B9//kJ9i8
+ZTNWrlwRuLryHoODg7jrrrvQ++676N+/nz78cB927tyBvXv3km6Y/MQTT9DLL70kcaq6/+qAKzZC
+3aDWSGDYSi3a8i3TFOMl3MkoKCJOOHws2yJvsQmyYfJWHdkPk0IIAV3X8bOf/Qyvvvoqps/o5Obm
+VspkM5xIWNA0DToAM3g0jUDk++k+DoZhQNN1zJo1Cxs3voZzz12KO1ev5oaGBgDAvn378NennoqR
+AyNIpVNIJBJsGCY0TafpM2ZA100ce+wx0h0kqR6r6b8KmqZJqVoyESYKdWOAuPRaXUGV41XXbNu2
+bejr68PevXvxwQcfoL+/Hx2dnThs/nxMnz4dbW1t6OvrwzXXXIu29nY0NbWgsbGRDd8DKNXiDOnM
+BPcGQAQkrATa2tvRv38fvvyVr+KHd65GT08P/vXuuzE4MIDpM7qQy+WQSCSg6Tp0TYNuGEiYJjZv
+2YJ3t29HT3d3QI9q+x+mZ9R5olBPG6BI/8v0iIWUiqxgRYSjt7eXX331VTz//PPYsOFVvPnWm2wX
+bJCm6EMiaKSByNsylUgkYJoJpLMZzmazSGey0HTdx0fBKVKiyj4wwCDAcxObmlt4YGAA5y5dim9+
+85t4+KGHMK2jk1taW5HLZVk3DBAIJGsRIZPJYPXqO3HF8mU8ZcpUCCFY9/CYqBcU5VlNGGqWAPIs
+B0LVWb7ICq+mxVrBUkYCINu2kUgkcOONN/Kdd95JjuMimUpyOpOmluYWGKbBhmHKRShoug4NIMEC
+juPAtm24rouklaJcYw5WwixZm4Ay/zVNQ6FQQKFQIG+AADNhwgiYBtB0nRobGpAwTb7llh8gk80h
+l8tRJpNhwzClZPbEPHsXhm7S1q1bcdZZX8LS85by3523lFzXZcMwihbOImgT0CyKtqEJN2GolwRQ
+B7kEI1VlhbNQHOaEZVkEAI7jYNnll+NnD/wMndM7kbSSSKZSlEgkYBgGdMMgXdehaTo0CoyOIDwq
+hAALAU3TYZoG4K1NqPckiQKzINdx+JOf/ATNP+QQdHR0QDDjkUcexcbXXkPCNL0pzQLQNCSTSeqZ
+PZvtQgGmaULXdQKgtl/Uw0w2C8MwsGrVatr4x424+eZ/VjekhGdz2OiJy6uLG1CvOIDkTNUIjHID
+Y908IQQKhQLfd999eO655+iVV17hvR/uxYwZM9DY1MSZbIYSCYt1XYNGGoEil4190P2p6KUTRYZM
+fSYQME2Tr/3Hf8TMmTPVVTdcdeUV+IfLLqP9+/uhe+4fgxmkESwrAcs3IImI/eXZkr4yM2tEsCyL
+5sydw//n97/H4088gS+ccQZLDwSlor+IVsoCWxF9UQcmqGscACGxHhOpCGaglPjMTJlMhr/73e/S
+Pffcw1OmTkUymUJn53Rkcw3IZbNkJhKQGkc2FOMSlUgZxbgrmXGuK3DM0Yejp6cHvosX4GdZFpqb
+mtH33ntoyDWANG/GFgluFBkS0UwAz81MJCxMnTqVCvl8wDARHlIpp0aH2GsOAwN18gJojC1VWwDK
+7qCgirxgZti2TZlMBs8++yzuuOMO/O53z6G7p4ey2RzS6RQlEhbMRIINXZdWepwIrGQmlMQSJAwO
+DpIQrpQYwaYL13XxwosvAExIpzMwyACi3bhyuBTlGYYB23ZK6BaHp1xNDdOWiKgeC1b1kgCRRp2M
+fEVxqhCCt2zZguVXXIFXXnkF6VQa0zqmcWNjI7K5HEwzAW/CFa2JR4nI8fRouWlCBMKGV//I6/7z
+5zj5pJMAeP79jh078D//+Z/Rt72PpnfNALOAL67C9xkPp5JQ5dCB4SJjNMJTCkMcfT96FaBwZAmH
+Sj2lcqm0lDdt2kSnnnYaNzc1obOzk9LpNGcyWUqlUjANE2N6u2hDRNnZFYdiRNpYm8RIWkmsXrUa
+//qvd9Pw0BB2796NwaFBTGltRVNzE6yEBfKNRWWI4gYeofSS6T08NBTo9HJl5X0UulKI3jFdrhxq
+Wg4uY93LfIpDcufOnTDNBDU2NVFr6xS0tE5BNpeFaZrwDG6G/0fBVfEfxVxX8jdW3mMyampu9hDV
+CFOmTsHcuXMxta0NLS2tSKVSHk5c9f1L0k3TxLPP/ha2bQc7n8cjc7n0PwsVQOMEJqKQHBwcZEPX
+kc3lkM16QRpCSMpWZuPUogKCwrquI5fLIZVKQYChgfz4gv/AEwOiVJdFGm1lgRnC39sHlNAmygCM
+HeTY2VUF1EUFSGQU10+9jqw3ODgI0rwIG3ny3remY/sUpWNrJYCnj/x2NV1DQksU5/paqAxuURZ8
+LGMwGK5cgKpQjKtrCSH1+tGvBZTLRjERAsNF0zTu6+sj0zDZTyQOdH2JwSfrVoxWzO9YNysALsKb
+IuZjNTM+sv/gijeFTrT/VUFNDBBh3Y8njqFpGt577z388Ic/RPu0aV47YBATQoF5deBi26tTXrXt
+xDHBuP0HextUqsChmv5XDTUxgPryhzKegFqFdF3Hzp07wQBM0ySNdM/gU3Y6hW5Tie9f6+BWS9SJ
+4AjAC5m7yksfIqRoSR35gG2YtsBHrAJUCVBNVIqIyDAMmGYCpPmPP/HBE3MTBgbk4pLjOHBdAWYR
+BLm8PphVu2Su45QUlhtQpdGnGn9h2srfH3kkcMJAxJqmkXxmRN329JHgE4CHAmmEoaEhZDIZzJ0z
+BwsWLMD8Qw/FlClT0NDQgJGREXy4bx+2bt2KP776R2zeugV79uxBLpfzWmEGxXSFEXgA4QIcZoI/
+BdQ7Ehh5LTlVBobgzXiMPedQFNEKE6ds28o1UBkDRRlXDAY0XcfQ0BB1dHTgaxdeiBM++UlMnToV
+RATbtmFZFogIo6OjPNNx8ImFCyl5YRK7d+/mZ3/7W3rooYfxzjvvcC6XI++Jqai+ECk2QBHeRCVP
+AlXa/wnDn0QCRHEzBxwg4MWjahdnEwdCoVCAYIFLLrkYXzjjDJimCdu2YRgG8vk8tm7dip8/8gg2
+/OEP2L+/HwW7gFQyhc7ODixcuBCnn346Prt4MR77xS9w6623wjRNcIzTwMyRhmBY7P8ppEC9GSBq
+FKNnpx8Q8YRD5ONN48XFJ5IXCaOjI5g1axZWrliB9vZ2lg+8moaB22+/HT/5yU+wceNGZLJZpJIp
+Ngzd249IGra+vRVPPvm/sGLlSpx91ll85ZVX4tBDDsGFX7sIyWQKRN5y9Bhe8Q90hHT+RPpfNRyM
+XcEVTWU58N4iS9kAS1R6uftXgR9hZOQATjjhk7jue9+DpmkQQpBlWbxu3Tp85zvfwZ4P9iKbyWD6
+9OlIJCyYpkmGYbCmj0XRm5uaUbBt/Md/rKOHHn6Yc7kciAiGbsAwDYTHWm4njwLFCJxI/6uGgykB
+ynEwpPoXgkEUkCiufqW6L0raxOJUKBTw8Y8fhxtXrkShUAAAuK7LF37ta3jowQe5qakJbVOnUCqd
+hmVZMA2TNV0uwZK/YAWAGJabRDqd4nw+j4K3U4gFu2AuWW6ReyC4KKE+/a8aDpYNUE4VBL+E4DgJ
+MH79sbQJEcN1XbS1tWHlihVwHW99Pp/PY/HixdiwYQOmdXQgmUwinUrDTCSg6xq8l6CN3VoIeIYe
+EzSNoGkJGIaJdNqL82ua93yBH/ZXBlzAdYslgBJSBzD2mN04/a8ZDhYDFImvKIPGMwIFmAEiLhGT
+47WppFUNuq5hcHAY37v2DmiaBtfbCYTFixdj8+bNmNbRgWw2i2QyCW+fv3ebqEex5ZYH27aRz+eh
+6wZ0XSdNI7ZtL34ghItUKg3dVxtEGt59tw8dHZ0oFApQAj1+m4HXNF7/a4Z6rQUEgSk1G/4MjeRm
+ZhIMVQLEzWY1vWyULQ7NcMLQ0DDOWrIEC45YIL9bRF/96ld506Y3qbmlGblsDslUMnhCyJ/B4bYY
+8DavjoyM0Ny5c/HpT51GRxxxJNqntSOTTtPw8DBv395Hr766Aev+8+cYHBxEKpVCJpPhS/7+Elp1
++x34+PEfVx8AjYrulfR/LAhYuyaoeyRwvOigtIAZMijCqOM293FB0zSkUkksXboUtm1D0zT8+7//
+Ox5//HG0T5uGTCYTPOsXeoagBIaHh7FgwQJcfPHFWHj88UqOJ9Gam5vR1dWFT3xiIc4//3zcc++9
+WLt2LdLpNKxkEhdceCEeffQRdHV1QX3mMAriaF1rNLBe7wdg/zfLE3sAAKwealkWwT+1ThgQka+m
+gUvrxqXz6GieTznlFG5vb2cAGBoawpVXXslt7e1IpVJsWRaTRrFtCR/dAwcO4NJLL8Xae+/FwuOP
+L/regeO4KNg2Z9Jp6LrOtm2zpmn8rcsu49tuvZWHhw+AiDiby/I3v3kpk7eruIRWKi0DmkX0vxao
++YMRIQKpRI/Ml2nwZ1dM/dg2K0iLPwTjwIFhfOGMMzAyMgJd1/HjH/8Yo/k8TMNAwrKgaXrZ+swC
+AwMDWPH972Ppueci7+3wDeL3Eq8f3HILZnZ34/LLL8fOnTuRSqUwODiI448/Hv949Xfx4d69SCQS
+6H23F4899lg5Wso8DmiHaOk6EahZAoSvfaRJuQ7S5LWu62CQT1CFuGMHhX5XkxZ7CBaYMWMGpk+f
+HuC9Zs2P0NDQAMuyYOg6gPj6IKC/fwArV6zAokWL4DiOfDVeeMDouuuuwx233467774bxx+/ED/6
+0Y/IsizYto3PfvazOPmkkzAwMIDGhkasvvNO6LoO+d4fLn57SElaeHLVAgftFTEc8yhzUIYFKYMf
++dqYCq6jmCycH6QJV1BHRweam5thmib+8Ic/4N13e5FOp2EY/mtjinEpamtgYIAuueTrdOqpp8Z9
+Eo4Az87o7++n0047DatXr4ZlJfDdq6/GY489BiIix3Fw8SWXUD5fgGEY2LFjJ7304kvymYSitiIY
+IorhJgz1VgFViGTfA/BnZsTBVaaPlwfbsXnmzJkgAKZp4sknn4SVTMI0jMDoi2vDFS4OPfRQnP93
+57Nt22GRX9J/GVf48pe/jL/6q79Ca2sr/umfvodCoQBmxtFHHYWuGdNRKBRgGDp+97+fG8PBkwRF
+tFRozSrda4V6MwApYkx2huQz+8Ud8phAsIgiZNxsrkQCxOa5jktTp0yB4z/08frrr8PyH+lW+lJ6
+X8EYHBjEFcuXg8fegRh1kPrbZwI699xzaWhwCAODA3jmmWcC5jjllFOwb/8+EBE2v7UZjuOU0G28
+PtYKdbEBwmd5XfaAjAFUKjFqP1zhwrIsuK6LfD6P3Xv2wFBmf9xhOzaOOPIIHH744ZX1LXTMmTMH
+uq7BNE1s3PgaAG8tYP78+RgeHgYA7N6zW24VH/eIo/lEoOY4gFw5U15cWKSvpKj0YSyPGYKVp4rH
++nFQt4SNjo4SszcAB4aHZbjWwyOGlnbBxiknnxIsEXNp7DoWL2bGlClTwAA0Itqx430A3rsPWltb
+yXEcsGAMDQ0FtAy3HZ79ypvZa35RZF0DQeU4VS3jWc7wQ8EB4Q/64rdGhF07d0G1tUgjwLdHEING
+Pp/HySefBNu2q7qf7Hs+n4dj29A1HbphBIPnugKuHyr230sI5uKweSXSoBaomQHUgVb0V9CJ6Pg5
+M8DEDN+9YnCdV7miQNN1bH17K1zXwy+Xa8COHTt8VaT5fBhasxICjU2N6OjogHwvcrXQ29uLAyMj
+AICuGV1wXZeJiN57rw9EBMd1kclmg8fdwzQ7mExQsw0gLVbFyGMAcZYsSw73Jj5L8AJD3sGI/13u
+Olyv9ACjr+89/vDDD1nXde7qmgHHdeGjHdmG47qY1t4e3CKfz2NkZITDX/4sd/3rX//aexiENF6w
+4PDgBVYvv/wyW1aSXddFZ2en3I9QRDO1vah7/lm8K1gioSIVQjRIH5MOaicjuTyoF0eQavPAwPbt
+2/H+jh1wHAdHHXUU7IKNCGN0jOiugGkmwOzZDTt37uQ1a9bAsqxwP0vuL4TAwMAAr1mzhltaWtCQ
+y+KYY46BEAKGYeDpp59GOp2CEAJzZs8uiSYyF02s2D5+5AygXpdBlP2y7LtR/phI/50hmMNnxPwu
+d4yVFQIF2+aR0VEeGhrC4NAQEwFr7r4biUQCixcvRqGQhysN2FIcGGCMjo5IJufGxkb84Ac/wNNP
+Px3HBEF/DcPA0qVLAQDDBw7wueeei1QyycyMDRs2cF9fnxcVFYKPO+44uK7LKq0qYexaoeb9AJLT
+1deXS4T9N24UlRdCoKmpybfCD0CjDAzDqGShu6QIeULH872ZwT4erv9BBSuRwMyZM9E5fTpmzZyJ
+rq4uzOjqwsyuLgwPD6OlpYU///nP46mnfoOmpkZvBobuoek6tm/fHhA8m81i7ty5WLp0KVauXImz
+zz6bC4VCkW1ARLx3715ccMEF2LBhAxobGzFt2jScc845KPgvv7rvvvu85w1cF10zurBggbc0XbJv
+Yoy+HEPrygcrAuriBbDyBnCZLvOidFRjYyO/9NJL9NBDD2H9+vXY9OabSFpWpBEY7h4LAdu2YTsO
+FQoF5HI5TGtvp7b2dnRMm4aumV3o6e7BnDlz0NnZGbxJQzKixMt1Xe9FVMuW4ddPPYWQuxoAARgY
+HMLmzZtxyCGHkGVZ+PSnP4133nkHV111Fe6991764he/iDlz5sCyLNq9ezeeffZZPPjggzBNE42N
+jWBm/Mvtt3vvEdQ0vPvuu/xv//Zv1NTcjPzoKM459xzYth18Lj6KzuEZr9K6FqjJ6v7pT3969axZ
+s64HwKZpkmmaMAwjCK6Q/wBIuB6zF04zTZNt28ayyy+np//rv5j9R8ckdwNAMpnkbDZLmUwG2WwW
+09rbMXfePMydO5fnzplDLc3NsJJJtiwLiUQi8I397+rEPbXD8P1rXdfx5JNP8lVXXYXGhobInQmj
++TzOWrIEy5cvRz6fBzPzokWLwADlR0fR399fYsHncjkYhsHMTHfddRcWLlyI0dFRJJNJ/O3f/i2/
+8sor1Nrayul0Go8//gsyzUQsrWRsRT6hZNs2bNtmZqY9e/Y8c/rpp5880TGsixuoGC9SV8mvRYFj
+WFQIwYVCAY7jYOWKFfz2229j165dPDA4iJRlIZPNIpPJwLIsZDMZTmcylM1mOZVKwXEc8h7VcpmZ
+Sdd1uK6L0dHR4C1awNj+uhgUGPDeR3jKKadg7dq1uPQf/oEL+TysZNL3GgAAZBoGHn/8cXzjG99g
+wHuH8F133YWlS5eCiHhae7u0I5jZe/fRgZERnjNjBm695RaeO28eRkZG0NjYiJU33ogXXngBTU1N
+PDg4iG9/+9swDJPjEFXoSiH6Bvm1QN0igf61GvMn+c2gqH5BWTljZvT09HBPTw+pYVlZVnkokkZH
+RwGMPV/oQ7n4eKyUk9JBCEGHH344Hn7oIVx22WXYtOlNNDY2eMzt4zg4OIjvf//7dMMNN2BkZASH
+HXYYHn30Udx88820fv16Xx+DmAXmzZuHJUuW0Oc+9zmWq3+pVApr1vwIt916K3K5HDMzLVq0CJ/5
+zGfkJJJvDivCTw6+jP7FLRlPFOoVCGIFIRZCBBFNMbahLtgjqNQP8tR38fsDHjUbgvrqNYpNhfEe
+GhnjrLGQLgsh0NjYiPvuu49WrVrFa9asocbGRs92YIZlWXj00Ucxc+ZMvvDCC1EoFNDe3k633HIL
+hoaG+J133iHXdTFjxgxua2sjuepHRKzrOm644Qa6++67OZvNEhFh6tSpuPHGG9m2bZimqer+AM+w
+xe8bggGdJUPUAnWLBIYDP0IIlk/RhriUQ+e4tHCdSvfFh/Oj7lMEqo3gOA5feumlOPHEE/mGG25A
+b28vZTIZAEA2m+WbbroJO3bswHJvZRD5fB6WZcmFImZmjI6OQgjB2WwWL7/8Mq6++mq8/vrr3qtw
+NI0bGxuxdu1aTvgvmpR0C+MnVav/qbiiCabaSbVAvQJBUZso4tImWjZLSLv6AAAKL0lEQVQuDaG8
+cumR9RXVRUREtm3TkUceSQ888AB97aKLYNs28oUCSNNo6tSpdN/999Opp56Kxx57DDt37oTjOGSa
+JhKJBLmuSzt37sTzzz9PZ599Ns4880zatGkT+a+Yp7a2Nrr//vvR2toaLJOXoV+Al0yLqFMTA9TL
+BmCFiGEVUFQF8bMzrkxcXlRblXg1qrQJqxCWasF1Xdi2jQsvuACf+Zu/wW233YZnnnkGmqahtaWF
+bdvGVVddhYaGBjQ3N3M6nSZN0zA0NMT79u2j/v5+JBIJNDQ0QAiBfD6Pk046ia+//npKJpNyXaFs
+/+Xg/kWoACnGJENI8Y8IVz50jkqLqxN1HcVQ4zFZubwgzTAMOI5Dra2tuOmmm/DGG2/wAw88gF/+
+8pcAvG3fAHjfvn3Yu3cv+zofADibzcJxHOTzeZ45cyYuv/xynHDCCXAcJ/hyqDJ7Y/svI5DqWouk
+80cuAaS/LR+qVBYrpI5SH3FSjcCwQVYuT+YjpnwY4tbqoyhVSR7kq+Rnz55N1157LZ933nn46U9/
+iqeffhoffPABGYYh4wosv+uby+Vwwgkn8GmnnYaTTz4ZjuOoXpGUNOP2P0xPRfzL6wjUK4e6MIDk
+fBlxk+5VOAz8ZwCVPF5VtkyhUMD06dNxxRVXYNmyZejt7cU777yDgYEBSE+ip6cHXV1dME0TmqZB
+3UNYLSjiP6C3jGIyR79noBqoiQEkMpIBdF0P9sQpDztWu3Mn/BhYJS5eJflqu3EjEfUIWkkZVQx3
+d3djzpw5XoYfD5FRSCkNFFFddf/Ve0k7S7b/kUsA13WF7CSR94k2XwqQpmnsLwZxDPdPxA2M0vFR
+bVZqA5TDSUJkW7I/oUEI7i8VPMdP+7L9V5eGXddl4b3BnP0IKHkPnYqPVgIUCoUh//k69hddSDIB
+EZGu60UeAaqzAcJ1oJSNg0psgkpUwHh5JYyg5JezUyruv+LGMjMHr6+Xgy9VwMjIyPA4/SkLNTHA
+/v37d7e1tclgDyu6P6CK8qkzmVRvLyCuXCX6vqwXUEFbleA1IS9IjWU4jsNS79u2zf5iEDEzhoeH
+t0XgVTHUxAB9fX1vdHd3Q9d1AUD3B5o1TZOxe4ZvBkjXB7VJgHLXQOnsjZrN43kXcVDO3awER/V3
+xRJACMGu65JcAbRtm2zbRqFQYGamwcHBV8rgPC7UxABr1qzZcNxxxwnTNAX770KR1r+MBQBg1TNA
+fSRAOQIjJq0SqNgGKINb+LpqCSANP2lQOo4jZz0KhQLn83mybVsIIfTXX3/9+fJdKg817wjasWPH
+U11dXZ/yt0yz6gpKYOaitInsrP3/BVTRL4RQ1//lZ+3kJ/H4wIEDIw8//PAfa7lfzQzw5ptv3tbW
+1vYpIrkFYOyV5oC3sifftKGoBLmBohYVAFQm8sdTA+OVjcqPszVqMgJ5bM2f5OA7jsOFQoHy+Tzy
++byc/SAi4+233/6XcfAdF/RaG9i4cePmE0888RLTNLNqaFKd7aH9ckUx7oMIlRiBH0VbRRAO9EjX
+Tlr6hUIB/uBDvoHMdV0eHR2ltWvXnt3f3z9Qy/1rYoCjjz4au3btQjKZ7Ovp6Vkigx7wCCYDGeSH
+PYNNI6HwZtFqnJJX6Spi+NGpqPzxVgorXT2Mu18l1+qKXsnmGRlPkX5+oVAgZeZTPp8nKf4BaG+9
+9daap5566r6ZM2eiv79/wmNYszK+4IIL6J577uErrrji9x0dHR8nIjZNkxKJBFuWBX+ZNHjBoq7r
+qqEYZw9EbQgpJ16jyiImL6pcJWXK3SfOqh+ryNEvfgzrfMXXZ6nz/ZlP8nO4Q0NDw9dcc00LM9sx
+K4oVQz2tsc7rr7/+vUwmA8kEpmmyZVnB516VDaPSVazkS5iVpFfixoXrquXrUb9q3BVrXy4kBQEf
+OdsLhQLLwZfBn3Xr1n1+/fr1j1WIa1mox3sCZQfff/jhhz/7pS996ReGYagxa3YcJ5AAhmGQpmmQ
+kiBCCoRnUzhPvWdU/nh55WZMnCEahUO5vDjXtKjdmNnPjuOQEvAJrH5N0+jZZ5+9bv369Y91dHTQ
+jh07xsNnXJioBAh0vA9aOp2mAwcO2Mcee+z5X/ziF++RM13X9eADy5IBdF1nuV4gPQbVQ0DpQEXN
+1DgVUM3AlVMBlbRTTgVElWVFFRQtn7uuKyUASxUgRb6/eYSee+65VY888silmUwmOTw8LPx2hHKv
+uNhDLFTDABRxaPAMSR2Aoeu67rpuvrOz8/Tzzjvv7paWlqTruqzruhx0BJ97Dy0d1xAbiJrVEw0E
+xbUf19aEvYOQ4Vm0gijtAH9DLRUKBTzxxBM3rV+//kbDMBKO96ZpF4A8u/AYgUNHFM6xnRuvjFzc
+1/000782/SMBwAKQ8pHpPuecc1YeccQRhxMRXNcV3itUg4EnuWagxASC2IFKK5TOtKjrSvtTTrJU
+20ZVoWD2XCQ13MsAijZ4SGkAALquU29v7+5Vq1ZdC2A9EenMPAIgD6DgHw4A2z8LeMwgJYO8VywT
+VBr40PxrOfiGf8jBTypHGkDGNM2kbdtWZ2fnpxYvXnxmT09Ps/cRBQ72w6kDPwEjsNoy45WvRxuV
+lpEMAGBs4UdOEMdxsHv37sKvfvWrx19//fV1uq4Puq47CmAEwDAAeV2AxwySAVQmAMaYIHbTQKUM
+IMW9POTgJzDGAHL2p+AzgX9OAGhoamo6+uijjz523rx5c2bNmpWRW6JLblhDmPhPGWKeaBArqp40
+At9///3C1q1bt23cuHHD9u3bnwewF94gDwM44B/D8AZdHqokUNWBVAlADRJALSMHX1fOKhNY/lky
+gQWPAVLwmEGqiAYAbclkctrUqVObLMtKaZpmMLPB3oKSAUDzr6XE0WQwycdFDwWcVEYNziFilwsh
+q1BCtAjGknlFBpjikwsAwv8tlN+uPBORw8x2Pp/PDwwMDOzfv/99ALsA7Ic3w+UhB17O+hF4M95G
+qQpQbQGEriOhmikjGUDWM1CsDnSMMYN6lpLB8n8nQtfh36bfXkJpWx6q0alFHGEDNZY5YkAd/PC1
+anGrZ/VwlUM11ByMDZacsXl4g2r7ZzXdhjfQ4VmuDrhsW95XnfVhBo2FamWmygDyd5RkkMwhbQRN
+uVYNRwtjjKPaFeq1HnOo95SDrTKpmhbub5T+D1+HCakygcoALoqNLzlAAmOD76JYT6szWKaHZ3Pc
+QLvKvVRdf9DdwLh6YabQld9RgyOZQ0oPlYGkoamm6aH6OqJneTgPoXO4r/JTZWFihWdNmAnCM00e
+cjAcJV9ljrCUiJIc4fYFSgda4hQe7AkZJfW2mqRVH94PHta/YeMyXEYLXUe1F64nLe6wXRBuG0r5
+qLwwIcvNrHB6nC8u88Jlw21EDWqtcYyy8Kczm+sH4YGtJoo3ERhvAFQGPKiDNQmTMAmTMAmTMAmT
+MAmTMAmTMAmTMAmTMAmTMAmTMAmTMAmTMAmTMAmTUDn8X7Er4pbsPLYtAAAAAElFTkSuQmCC
+"
+ height="128"
+ width="128" />
+ </g>
+</svg>
diff --git a/demos/mobile/qcamera/icons/exit.png b/demos/mobile/qcamera/icons/exit.png
new file mode 100755
index 0000000..dbe586a
--- /dev/null
+++ b/demos/mobile/qcamera/icons/exit.png
Binary files differ
diff --git a/demos/mobile/qcamera/icons/mms.png b/demos/mobile/qcamera/icons/mms.png
new file mode 100755
index 0000000..46a1a73
--- /dev/null
+++ b/demos/mobile/qcamera/icons/mms.png
Binary files differ
diff --git a/demos/mobile/qcamera/main.cpp b/demos/mobile/qcamera/main.cpp
new file mode 100755
index 0000000..6157c2d
--- /dev/null
+++ b/demos/mobile/qcamera/main.cpp
@@ -0,0 +1,127 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "cameraexample.h"
+
+#include <QtGui>
+#include <QApplication>
+#include <QDebug>
+
+// Lock Symbian orientation
+#ifdef Q_OS_SYMBIAN
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif
+
+
+#ifdef Q_OS_SYMBIAN
+#include <QSymbianEvent>
+#include <w32std.h>
+
+#endif
+
+static const int KGoomMemoryLowEvent = 0x10282DBF;
+static const int KGoomMemoryGoodEvent = 0x20026790;
+
+class MyApplication : public QApplication
+{
+public:
+ MyApplication( int argc, char** argv ) : QApplication( argc, argv ) {}
+
+#ifdef Q_OS_SYMBIAN
+protected:
+//! [0]
+ bool symbianEventFilter( const QSymbianEvent* symbianEvent )
+ {
+ const TWsEvent *event = symbianEvent->windowServerEvent();
+ if ( !event ) {
+ return false;
+ }
+ switch ( event->Type() ) {
+ // GOOM handling enabled
+ // http://wiki.forum.nokia.com/index.php/Graphics_memory_handling
+ case EEventUser: {
+ TApaSystemEvent* eventData = reinterpret_cast<TApaSystemEvent*>(event->EventData());
+ if ((*eventData) == EApaSystemEventShutdown) {
+ eventData++;
+ if ((*eventData) == KGoomMemoryLowEvent) {
+ return true;
+ }
+ }
+ break;
+ }
+ default:
+ break;
+ };
+
+ // Always return false so we don't stop
+ // the event from being processed
+ return false;
+ }
+//! [0]
+#endif
+};
+
+
+int main(int argc, char *argv[])
+{
+ // NOTE: set this value before creating MyApplication instance
+ // http://doc.trolltech.com/qapplication.html#setGraphicsSystem
+ QApplication::setGraphicsSystem("raster"); // NOTE: Seems that raster have to be enabled with Nokia N8
+
+ MyApplication a(argc, argv);
+
+ // Lock Symbian orientation
+#ifdef Q_OS_SYMBIAN
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAP_IGNORE(
+ if (appUi) {
+ appUi->SetOrientationL(CAknAppUi::EAppUiOrientationLandscape);
+ }
+ );
+#endif
+
+ CameraExample w;
+ w.showFullScreen();
+
+ return a.exec();
+}
diff --git a/demos/mobile/qcamera/messagehandling.cpp b/demos/mobile/qcamera/messagehandling.cpp
new file mode 100755
index 0000000..bf7bfcb
--- /dev/null
+++ b/demos/mobile/qcamera/messagehandling.cpp
@@ -0,0 +1,183 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "messagehandling.h"
+#include <QMessageBox>
+#include <QDebug>
+#include <QTimerEvent>
+#include <QTimer>
+#include <QFile>
+#include <QPixmap>
+#include <QImageReader>
+
+Message::Message(QObject *parent) :
+ QObject(parent)
+{
+ // QMessageService class provides the interface for requesting messaging service operations
+ m_service = new QMessageService(this);
+ //QObject::connect(m_service, SIGNAL(stateChanged(QMessageService::State)), this, SLOT(stateChanged(QMessageService::State)));
+ QObject::connect(m_service, SIGNAL(messagesFound(const QMessageIdList&)), this, SLOT(messagesFound(const QMessageIdList&)));
+
+ // QMessageManager class represents the main interface for storage and
+ // retrieval of messages, folders and accounts in the system message store
+ m_manager = new QMessageManager(this);
+
+ QObject::connect(m_manager, SIGNAL(messageAdded(const QMessageId&,const QMessageManager::NotificationFilterIdSet&)),
+ this, SLOT(messageAdded(const QMessageId&,const QMessageManager::NotificationFilterIdSet&)));
+
+ // Register MMS in inbox (draft in emulator) folder notificationfilter
+#ifdef Q_OS_SYMBIAN
+#ifdef __WINS__
+ m_notifFilterSet.insert(m_manager->registerNotificationFilter(QMessageFilter::byStandardFolder(
+ QMessage::DraftsFolder)));
+#else
+ m_notifFilterSet.insert(m_manager->registerNotificationFilter(QMessageFilter::byStandardFolder(
+ QMessage::InboxFolder)));
+#endif
+#else
+ m_notifFilterSet.insert(m_manager->registerNotificationFilter(QMessageFilter::byStandardFolder(
+ QMessage::InboxFolder)));
+#endif
+
+}
+
+Message::~Message()
+{
+}
+
+void Message::messageAdded(const QMessageId& id,
+ const QMessageManager::NotificationFilterIdSet& matchingFilterIds)
+{
+ if (matchingFilterIds.contains(m_notifFilterSet)) {
+ processIncomingMMS(id);
+ }
+}
+
+
+void Message::checkMessages()
+{
+#ifdef Q_OS_SYMBIAN
+#ifdef __WINS__
+ QMessageFilter folderFilter(QMessageFilter::byStandardFolder(QMessage::DraftsFolder));
+#else
+ QMessageFilter folderFilter(QMessageFilter::byStandardFolder(QMessage::InboxFolder));
+#endif
+#else
+ QMessageFilter folderFilter(QMessageFilter::byStandardFolder(QMessage::InboxFolder));
+#endif
+
+ m_service->queryMessages(folderFilter);
+ // Message::messagesFound() is called if MMS messages found
+
+}
+
+void Message::messagesFound(const QMessageIdList &ids)
+{
+ foreach (const QMessageId& id, ids) {
+ processIncomingMMS(id);
+ }
+}
+
+void Message::processIncomingMMS(const QMessageId& id)
+{
+ QMessage message = m_manager->message(id);
+
+ // Handle only MMS messages
+ if (message.type()!=QMessage::Mms)
+ return;
+
+
+ QMessageContentContainerIdList attachments = message.attachmentIds();
+ if (!attachments.isEmpty()) {
+ QMessageContentContainer messageContent = message.find(attachments[0]);
+ if (messageContent.isContentAvailable() && messageContent.contentType() == "image") {
+
+ // Create QPixmap from the message image attachment
+ QPixmap pixmap;
+ pixmap.loadFromData(messageContent.content());
+
+ QString from = message.from().addressee();
+ QString filename = messageContent.suggestedFileName();
+
+ // Emit received MMS message info
+ emit messageReceived(from, filename, pixmap);
+ }
+ }
+}
+
+bool Message::sendMMS(QString picturePath, QString phoneNumber)
+{
+ QString tmpFileName = "c:/System/qcamera_mms.jpg";
+
+ // Create temp image for MMS
+ // Delete previous temp image
+ QFile previousFile(tmpFileName);
+ if (previousFile.exists()) {
+ previousFile.remove();
+ }
+ // Create new temp image
+ QImageReader reader;
+ reader.setFileName(picturePath);
+ QSize imageSize = reader.size();
+ imageSize.scale(QSize(300,300), Qt::KeepAspectRatio);
+ reader.setScaledSize(imageSize);
+ QImage image = reader.read();
+ image.save(tmpFileName);
+
+ // Use temp mms image
+ picturePath = tmpFileName;
+
+ // Send MMS
+ QMessage message;
+ message.setType(QMessage::Mms);
+ message.setParentAccountId(QMessageAccount::defaultAccount(QMessage::Mms));
+ message.setTo(QMessageAddress(QMessageAddress::Phone, phoneNumber));
+
+ QStringList paths;
+ paths << picturePath;
+ message.appendAttachments(paths);
+
+ return m_service->send(message);
+}
+
+void Message::stateChanged(QMessageService::State s)
+{
+ emit messageStateChanged(s);
+}
diff --git a/demos/mobile/qcamera/messagehandling.h b/demos/mobile/qcamera/messagehandling.h
new file mode 100755
index 0000000..86a9071
--- /dev/null
+++ b/demos/mobile/qcamera/messagehandling.h
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MESSAGE_H
+#define MESSAGE_H
+
+#include <QObject>
+#include <QPixmap>
+
+// QtMobility API headers
+// Messaging
+#include <QMessage>
+#include <QMessageManager>
+#include <QMessageService>
+
+// Location
+#include <QGeoPositionInfo>
+
+// QtMobility namespace
+QTM_USE_NAMESPACE
+
+class Message: public QObject
+{
+Q_OBJECT
+
+public:
+ Message(QObject *parent = 0);
+ ~Message();
+
+ void checkMessages();
+ bool sendMMS(QString picturePath, QString phoneNumber);
+
+private:
+ void processIncomingMMS(const QMessageId& id);
+
+public slots:
+ // QMessageService
+ void stateChanged(QMessageService::State s);
+ void messagesFound(const QMessageIdList &ids);
+
+ // QMessageManager
+ void messageAdded(const QMessageId &id, const QMessageManager::NotificationFilterIdSet &matchingFilterIds);
+
+signals:
+ void messageStateChanged(int);
+ void messageReceived(QString from, QString filename, QPixmap pixmap);
+
+private:
+ QMessageService* m_service;
+ QMessageManager* m_manager;
+ QMessageManager::NotificationFilterIdSet m_notifFilterSet;
+ QMessageId m_messageId;
+};
+
+#endif // MESSAGE_H
diff --git a/demos/mobile/qcamera/qcamera.pro b/demos/mobile/qcamera/qcamera.pro
new file mode 100755
index 0000000..17b9513
--- /dev/null
+++ b/demos/mobile/qcamera/qcamera.pro
@@ -0,0 +1,62 @@
+
+# Copyright (c) 2011 Nokia Corporation.
+
+TEMPLATE = app
+TARGET = qcamera
+
+VERSION = 1.1.0
+
+QT += network
+
+HEADERS += contactsdlg.h \
+ cameraexample.h \
+ messagehandling.h \
+ button.h \
+ businesscardhandling.h
+
+SOURCES += contactsdlg.cpp \
+ main.cpp \
+ cameraexample.cpp \
+ messagehandling.cpp \
+ button.cpp \
+ businesscardhandling.cpp
+
+CONFIG += mobility
+MOBILITY = contacts \
+ messaging \
+ multimedia \
+ systeminfo \
+ location
+
+RESOURCES += resources.qrc
+
+ICON = icons/cameramms_icon.svg
+
+symbian: {
+ # Because landscape orientation lock
+ LIBS += -lcone -leikcore -lavkon
+ TARGET.UID3 = 0xEF642F0E
+ TARGET = QCamera
+ TARGET.EPOCSTACKSIZE = 0x14000
+ TARGET.EPOCHEAPSIZE = 0x20000 0x8000000
+
+ # Self-signing capabilities
+ TARGET.CAPABILITY += NetworkServices \
+ ReadUserData \
+ WriteUserData \
+ LocalServices \
+ UserEnvironment
+
+ # QtMobility Messaging module needs these
+ #DEFINES += MESSAGING_ENABLED
+
+ contains(DEFINES,MESSAGING_ENABLED) {
+ # Additional capabilities that needs Open Signed Online signing
+ TARGET.CAPABILITY += ReadDeviceData WriteDeviceData
+ }
+}
+
+!contains(DEFINES,MESSAGING_ENABLED) {
+ warning(Qt Mobility Messaging disabled!)
+}
+
diff --git a/demos/mobile/qcamera/qcamera.pro.user b/demos/mobile/qcamera/qcamera.pro.user
new file mode 100644
index 0000000..6ac56bc
--- /dev/null
+++ b/demos/mobile/qcamera/qcamera.pro.user
@@ -0,0 +1,582 @@
+<!DOCTYPE QtCreatorProject>
+<qtcreator>
+ <data>
+ <variable>ProjectExplorer.Project.ActiveTarget</variable>
+ <value type="int">1</value>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.EditorSettings</variable>
+ <valuemap type="QVariantMap">
+ <value key="EditorConfiguration.Codec" type="QByteArray">Default</value>
+ </valuemap>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.Target.0</variable>
+ <valuemap type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Desktop</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Desktop</value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.DesktopTarget</value>
+ <value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">2</value>
+ <value key="ProjectExplorer.Target.ActiveDeployConfiguration" type="int">0</value>
+ <value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value>
+ <valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qmake</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
+ <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
+ <value key="QtProjectManager.QMakeBuildStep.QMakeForced" type="bool">false</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+ <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
+ <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
+ <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Build</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+ <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
+ <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
+ <value type="QString">clean</value>
+ </valuelist>
+ <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Clean</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
+ <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
+ <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Qt in PATH Debug</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/jpasion/gitorious/qt-contributor-team/demos/qcamera-build-desktop</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.Target.BuildConfiguration.1" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qmake</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
+ <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
+ <value key="QtProjectManager.QMakeBuildStep.QMakeForced" type="bool">false</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+ <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
+ <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
+ <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Build</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+ <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
+ <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
+ <value type="QString">clean</value>
+ </valuelist>
+ <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Clean</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
+ <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
+ <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Qt in PATH Release</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/jpasion/gitorious/qt-contributor-team/demos/qcamera-build-desktop</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.Target.BuildConfiguration.2" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qmake</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
+ <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
+ <value key="QtProjectManager.QMakeBuildStep.QMakeForced" type="bool">false</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+ <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
+ <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
+ <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Build</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+ <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
+ <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
+ <value type="QString">clean</value>
+ </valuelist>
+ <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Clean</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
+ <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
+ <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Desktop Qt for GCC (Qt SDK) Release</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/jpasion/gitorious/qt-contributor-team/demos/qcamera-build-desktop</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">4</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.Target.BuildConfiguration.3" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qmake</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
+ <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
+ <value key="QtProjectManager.QMakeBuildStep.QMakeForced" type="bool">false</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+ <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
+ <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
+ <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Build</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+ <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
+ <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
+ <value type="QString">clean</value>
+ </valuelist>
+ <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Clean</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
+ <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
+ <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Desktop Qt for GCC (Qt SDK) Debug</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/jpasion/gitorious/qt-contributor-team/demos/qcamera-build-desktop</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">4</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
+ </valuemap>
+ <value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">4</value>
+ <valuemap key="ProjectExplorer.Target.DeployConfiguration.0" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
+ <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">0</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Deploy</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Deploy</value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">1</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">No deployment</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.DefaultDeployConfiguration</value>
+ </valuemap>
+ <value key="ProjectExplorer.Target.DeployConfigurationCount" type="int">1</value>
+ <valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qcamera</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
+ <valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">qcamera.pro</value>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
+ <valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
+ <value key="RunConfiguration.QmlDebugServerPort" type="uint">3768</value>
+ <value key="RunConfiguration.UseCppDebugger" type="bool">true</value>
+ <value key="RunConfiguration.UseQmlDebugger" type="bool">false</value>
+ </valuemap>
+ <value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
+ </valuemap>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.Target.1</variable>
+ <valuemap type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Qt Simulator</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Qt Simulator</value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.QtSimulatorTarget</value>
+ <value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">3</value>
+ <value key="ProjectExplorer.Target.ActiveDeployConfiguration" type="int">0</value>
+ <value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value>
+ <valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qmake</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
+ <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
+ <value key="QtProjectManager.QMakeBuildStep.QMakeForced" type="bool">false</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+ <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
+ <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
+ <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Build</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+ <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
+ <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
+ <value type="QString">clean</value>
+ </valuelist>
+ <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Clean</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
+ <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
+ <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Release</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/jpasion/gitorious/qt-contributor-team/demos/qcamera-build-simulator</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">6</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.Target.BuildConfiguration.1" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qmake</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
+ <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
+ <value key="QtProjectManager.QMakeBuildStep.QMakeForced" type="bool">false</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+ <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
+ <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
+ <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Build</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+ <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
+ <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
+ <value type="QString">clean</value>
+ </valuelist>
+ <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Clean</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
+ <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
+ <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Debug</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/jpasion/gitorious/qt-contributor-team/demos/qcamera-build-simulator</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">6</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.Target.BuildConfiguration.2" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qmake</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
+ <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
+ <value key="QtProjectManager.QMakeBuildStep.QMakeForced" type="bool">false</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+ <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
+ <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
+ <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Build</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+ <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
+ <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
+ <value type="QString">clean</value>
+ </valuelist>
+ <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Clean</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
+ <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
+ <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Simulator Qt for GCC (Qt SDK) Debug</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/jpasion/gitorious/qt-contributor-team/demos/qcamera-build-simulator</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">6</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.Target.BuildConfiguration.3" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qmake</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
+ <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
+ <value key="QtProjectManager.QMakeBuildStep.QMakeForced" type="bool">false</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+ <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
+ <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
+ <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Build</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+ <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
+ <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
+ <value type="QString">clean</value>
+ </valuelist>
+ <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Clean</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
+ <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
+ <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Simulator Qt for GCC (Qt SDK) Release</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/jpasion/gitorious/qt-contributor-team/demos/qcamera-build-simulator</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">6</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
+ </valuemap>
+ <value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">4</value>
+ <valuemap key="ProjectExplorer.Target.DeployConfiguration.0" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
+ <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">0</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Deploy</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Deploy</value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">1</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">No deployment</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.DefaultDeployConfiguration</value>
+ </valuemap>
+ <value key="ProjectExplorer.Target.DeployConfigurationCount" type="int">1</value>
+ <valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qcamera</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
+ <valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">qcamera.pro</value>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
+ <valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
+ <value key="RunConfiguration.QmlDebugServerPort" type="uint">3768</value>
+ <value key="RunConfiguration.UseCppDebugger" type="bool">true</value>
+ <value key="RunConfiguration.UseQmlDebugger" type="bool">false</value>
+ </valuemap>
+ <value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
+ </valuemap>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.Target.2</variable>
+ <valuemap type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Remote Compiler</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Remote Compiler</value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.WccCompilerTarget</value>
+ <value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">0</value>
+ <value key="ProjectExplorer.Target.ActiveDeployConfiguration" type="int">0</value>
+ <value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value>
+ <valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.WccBuildStep</value>
+ <value key="Qt4ProjectManager.WccBuildStep.CertFile" type="QString"></value>
+ <value key="Qt4ProjectManager.WccBuildStep.CertKeyFile" type="QString"></value>
+ <value key="Qt4ProjectManager.WccBuildStep.CertKeyPass" type="QString"></value>
+ <value key="Qt4ProjectManager.WccBuildStep.PkgOpt" type="int">1</value>
+ <value key="Qt4ProjectManager.WccBuildStep.PostOp" type="int">1</value>
+ <value key="Qt4ProjectManager.WccBuildStep.QtVersion" type="QString">4_7_0_m1_0_2</value>
+ <value key="Qt4ProjectManager.WccBuildStep.SisOpt" type="int">1</value>
+ <value key="Qt4ProjectManager.WccBuildStep.Target" type="QString">maemo5</value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Build</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
+ <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">0</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Clean</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
+ <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
+ <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Remote Compiler</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/jpasion/gitorious/qt-contributor-team/demos/qcamera-build-remote</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">7</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">12</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
+ </valuemap>
+ <value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">1</value>
+ <valuemap key="ProjectExplorer.Target.DeployConfiguration.0" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
+ <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">0</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Deploy</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Deploy</value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">1</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">No deployment</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.DefaultDeployConfiguration</value>
+ </valuemap>
+ <value key="ProjectExplorer.Target.DeployConfigurationCount" type="int">1</value>
+ <valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Remote Compiler - Empty Run Configuration</value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.WccRunConfiguration</value>
+ <value key="Qt4ProjectManager.WccRunConfiguration.ProFile" type="QString">qcamera.pro</value>
+ <value key="RunConfiguration.QmlDebugServerPort" type="uint">3768</value>
+ <value key="RunConfiguration.UseCppDebugger" type="bool">true</value>
+ <value key="RunConfiguration.UseQmlDebugger" type="bool">false</value>
+ </valuemap>
+ <value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
+ </valuemap>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.TargetCount</variable>
+ <value type="int">3</value>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
+ <value type="QString">{7d0e1b67-5eac-4464-8506-ed03165c2662}</value>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
+ <value type="int">8</value>
+ </data>
+</qtcreator>
diff --git a/demos/mobile/qcamera/resources.qrc b/demos/mobile/qcamera/resources.qrc
new file mode 100755
index 0000000..833fa99
--- /dev/null
+++ b/demos/mobile/qcamera/resources.qrc
@@ -0,0 +1,7 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+ <file>icons/camera.png</file>
+ <file>icons/exit.png</file>
+ <file>icons/mms.png</file>
+</qresource>
+</RCC>
diff --git a/demos/mobile/qtbubblelevel/accelerometerfilter.cpp b/demos/mobile/qtbubblelevel/accelerometerfilter.cpp
new file mode 100644
index 0000000..2d3a48a
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/accelerometerfilter.cpp
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <math.h>
+#include "accelerometerfilter.h"
+
+#define RADIANS_TO_DEGREES 57.2957795
+
+AccelerometerFilter::AccelerometerFilter()
+ : x(0), y(0), z(0)
+{
+}
+
+//! [0]
+bool AccelerometerFilter::filter(QAccelerometerReading *reading)
+{
+ qreal rx = reading->x();
+ qreal ry = reading->y();
+ qreal rz = reading->z();
+
+ qreal divider = sqrt(rx * rx + ry * ry + rz * rz);
+
+ // Lowpass factor
+#ifdef Q_OS_SYMBIAN
+ float lowPassFactor = 0.10;
+#else
+ float lowPassFactor = 0.05;
+#endif
+
+ // Calculate the axis angles in degrees and reduce the noise in sensor
+ // readings.
+ x += (acos(rx / divider) * RADIANS_TO_DEGREES - 90 - x) * lowPassFactor;
+ y += (acos(ry / divider) * RADIANS_TO_DEGREES - 90 - y) * lowPassFactor;
+ z += (acos(rz / divider) * RADIANS_TO_DEGREES - 90 - z) * lowPassFactor;
+
+ // The orientations of the accelerometers are different between
+ // Symbian and Maemo devices so we use the different axes
+ // depending on the platform.
+#if defined(Q_OS_SYMBIAN)
+ emit rotationChanged(-y);
+#else
+ emit rotationChanged(x);
+#endif
+
+ // Don't store the reading in the sensor.
+ return false;
+}
+//! [0]
diff --git a/demos/mobile/qtbubblelevel/accelerometerfilter.h b/demos/mobile/qtbubblelevel/accelerometerfilter.h
new file mode 100644
index 0000000..0eeffa3
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/accelerometerfilter.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef ACCELEROMETERFILTER_H
+#define ACCELEROMETERFILTER_H
+
+//! [0]
+#include <QAccelerometerFilter>
+#include <QVariant>
+
+QTM_USE_NAMESPACE
+
+class AccelerometerFilter
+ : public QObject, public QAccelerometerFilter
+{
+ Q_OBJECT
+
+protected:
+ qreal x;
+ qreal y;
+ qreal z;
+
+public:
+ AccelerometerFilter();
+ bool filter(QAccelerometerReading *reading);
+
+signals:
+ void rotationChanged(const QVariant &deg);
+};
+//! [0]
+
+#endif // ACCELEROMETERFILTER_H
diff --git a/demos/mobile/qtbubblelevel/debian/changelog b/demos/mobile/qtbubblelevel/debian/changelog
new file mode 100644
index 0000000..0413145
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/debian/changelog
@@ -0,0 +1,19 @@
+qtbubblelevel (1.2.0) stable; urgency=low
+
+ * Improved the usability of the calibration dialog.
+
+ -- Forum Nokia <FN.Documentation@nokia.com> Wed, 16 Feb 2011 12:59:30 +0100
+
+qtbubblelevel (1.1.0) stable; urgency=low
+
+ * QtMobility Rotation sensor support
+
+ -- Antonio Aloisio <antonio.aloisio@nokia.com> Tue, 15 Jun 2010 9:03:02 +0100
+
+
+qtbubblelevel (1.0.0) unstable; urgency=low
+
+ * Initial release
+
+ -- Antonio Aloisio <antonio.aloisio@nokia.com> Tue, 15 Jun 2010 9:03:02 +0100
+
diff --git a/demos/mobile/qtbubblelevel/debian/compat b/demos/mobile/qtbubblelevel/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/demos/mobile/qtbubblelevel/debian/control b/demos/mobile/qtbubblelevel/debian/control
new file mode 100644
index 0000000..5980327
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/debian/control
@@ -0,0 +1,12 @@
+Source: qtbubblelevel
+Section: user/games
+Priority: extra
+Maintainer: Forum Nokia <FN.Documentation@nokia.com>
+Build-Depends: debhelper (>= 5), libqt4-dev, libqtm-sensors
+Standards-Version: 3.7.3
+
+Package: qtbubblelevel
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Qt Bubble Level example
+ QtQuick example
diff --git a/demos/mobile/qtbubblelevel/debian/copyright b/demos/mobile/qtbubblelevel/debian/copyright
new file mode 100644
index 0000000..e8dea63
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/debian/copyright
@@ -0,0 +1,36 @@
+This package was debianized by unknown <anonymous@digia.com> on
+Tue, 15 Jun 2010 9:03:02 +0100.
+
+It was downloaded from <fill in http/ftp site>
+
+Upstream Author: <put author(s) name and email here>
+
+Copyright: <put the year(s) of the copyright, and the names of the
+ copyright holder(s) here>
+
+License:
+
+ This package is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this package; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian systems, the complete text of the GNU Lesser General
+Public License can be found in `/usr/share/common-licenses/LGPL'.
+
+
+The Debian packaging is (C) 2010, unknown <anonymous@digia.com> and
+is licensed under the GPL, see `/usr/share/common-licenses/GPL'.
+
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
diff --git a/demos/mobile/qtbubblelevel/debian/dirs b/demos/mobile/qtbubblelevel/debian/dirs
new file mode 100644
index 0000000..80507f1
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/debian/dirs
@@ -0,0 +1,2 @@
+usr/bin
+usr/share/applications/hildon
diff --git a/demos/mobile/qtbubblelevel/debian/files b/demos/mobile/qtbubblelevel/debian/files
new file mode 100644
index 0000000..3d43242
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/debian/files
@@ -0,0 +1 @@
+qtbubblelevel_1.2.0_armel.deb user/games extra
diff --git a/demos/mobile/qtbubblelevel/debian/postinst b/demos/mobile/qtbubblelevel/debian/postinst
new file mode 100644
index 0000000..79fb6dd
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/debian/postinst
@@ -0,0 +1,5 @@
+#!/bin/sh -e
+
+gtk-update-icon-cache -f /usr/share/icons/hicolor
+
+exit 0
diff --git a/demos/mobile/qtbubblelevel/debian/rules b/demos/mobile/qtbubblelevel/debian/rules
new file mode 100644
index 0000000..f18b9cd
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/debian/rules
@@ -0,0 +1,91 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ $(MAKE)
+ #docbook-to-man debian/qtbubblelevel.sgml > qtbubblelevel.1
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ $(MAKE) clean
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/qtbubblelevel.
+ $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/qtbubblelevel install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+# dh_install
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+# dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+ dh_makeshlibs
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/demos/mobile/qtbubblelevel/icons/26x26/qtbubblelevel.png b/demos/mobile/qtbubblelevel/icons/26x26/qtbubblelevel.png
new file mode 100644
index 0000000..ae34ccf
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/icons/26x26/qtbubblelevel.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/icons/40x40/qtbubblelevel.png b/demos/mobile/qtbubblelevel/icons/40x40/qtbubblelevel.png
new file mode 100644
index 0000000..6230f55
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/icons/40x40/qtbubblelevel.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/icons/64x64/qtbubblelevel.png b/demos/mobile/qtbubblelevel/icons/64x64/qtbubblelevel.png
new file mode 100644
index 0000000..375326c
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/icons/64x64/qtbubblelevel.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/icons/bubblelevel.svg b/demos/mobile/qtbubblelevel/icons/bubblelevel.svg
new file mode 100644
index 0000000..a3c30df
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/icons/bubblelevel.svg
@@ -0,0 +1,264 @@
+<?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="128"
+ height="128"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.48.0 r9654"
+ sodipodi:docname="bubblelevel.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.98994949"
+ inkscape:cx="599.30983"
+ inkscape:cy="93.17066"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1680"
+ inkscape:window-height="1003"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1" />
+ <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" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-924.36218)">
+ <image
+ y="923.61945"
+ x="0.05510572"
+ id="image2993"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACBCAYAAAAIYrJuAAAABHNCSVQICAgIfAhkiAAAIABJREFU
+eJztvU2SJEmu3/mDqpq5R2ZWP3b3UPhEuBiZWcysZnZzBS5IEV6D5+OCPAIPwPXshiJk83V3VX5E
+hLuZKsAFoGoWEe5RFZHZ8/hEHCVeHunuZqYfUOAPKACFG93oRje60Y1udKMb3ehGN7rRjW50oxvd
+6EY3utGNbnSjG93oRje60Y1udKMb3ehGN7rRjW50oxvd6EY3utGNbnSjG93oRje60Y1udKMb3ehG
+N7rRjW50oxvd6EY3utGNbnSjG93oRje60Y1udKMb3ehGN7rRPzLJf/p//8O/M7N//ZaLkkDJgBmm
+App4eFz473/6C8tSubv7wO//8Ed++ukDpitNG5IgiQF29b6KXnoaWPL3C1eYsrunIAApAfryWXF7
+w1C79CxIkvpdfgi99qwskJPF7wAV1Hx8cyqIZCDxyy+/8Kd/+DOocrg78Id/8QeOHw4Xn4Vy9XnP
+SUT+Y1nq+n+L2b99S6dEQJv6MFnCNLEsZx4fH1mWFZHE+fRAycZ5eaTWhZQSkpwB5ML4ml1hDBN8
+8l8ywPNrJG4s4wF28fdmdvF5IrK79sfRpecJzqdJOlcK208EkUQpMyVPnE5nltPJ75GEZTmTp5ft
+NOI519fYM5L/r9zff37DBb15RkJJIogUtMHnz/f8w1/+G6fHhd/99He0dubzl4lffvkrD4/3lJJ9
+YcILBvCOX2MA8MmXeD1ry27S+t/+etri7ffXGeD5/X4EvfasJF0q+u9UYVu8wt3dB/7ud/+Mb9/u
++ctf/oKZcffpA/PHRGN58/NekAhlXR+5LF5fuQ7dGIBMa8K6nqjriXU983jK8LmBGJ9/+Sun0yNl
+yqQkb+U1J7s8+YiQU0JSQkRcfMcEpt3nPp/+Lp2R5FJLLjHP95FZlzwXJI4ZQsPUUMPf1d/N4HQ+
+o2qcTwvLumBqlCWzrmfWelki/ubJ9ysoZg2jvalTCYNkGKCqmAkijTIJeQW1hfuHhXVdOZ0eUF0R
+LSiJaxJKkItz3L+9/Knjg0RCSIiYy1VJkCGXvDHEXjokZ5aL95T0N2CAyzrZtGFtDQZQtIGooWq0
+pqx15dv9N1p1DCWSkAQqDbX14sPM7LcvMjPKspy9w2/otGBoUsTATDBN1HamtYVaz7RWMVNqqzRd
+8SmvmCX0iig34RXRe+VzMUzi2gQkQZKRkjneSAoxoZL2DABXVY7Ym8biV8mAa+oGi8YbNAFRTAwT
+xVCqGo/nR7Qpa22kJFTN1Hqm1guPUuM3T7+BiFHW9vgK6r228gxNLRggYSos64m1LjhDyQZIMNf9
+0TGurLyUXhO9drEtIoYk9dWRgByTK7iCDUvAXGYFo7saej5MMv6vV/v9Vur4/tq0CApiqBmG+n8W
+0sAUVWit0apSWyPnzKSZWhfW9eUdX5M2l/tkFGvtovHVL0oX5sswaC1ETkKrUOuKWuvfevfFSLE6
+JcC8q3N7wnSus11vX6Zrq9XnWcSZAWko6qoBSOTAjoolQUXDzOvj0cEj4/11VfQ2ElxCSoDcp1jX
+fLXHxLfBAM4EzVowgzNBrQ1JLi1UG61dkKK/ggH2+Kar4qJoNOryCjO7NCnebLHtof3BKQtCiu66
+OE3JX5qCoWQbfx9wIec0QNzzZ71qpqSAsGLBCADNH5itz+oQ7ZZ0ZzXsB2ZnTVx/2puoy62OAaXr
+5yfv/mVnhZ0sGPKrf05yVbZJ16dP83m43JZt4vcmslH8y2uASK6sCEEsQBcbAs+pkFIbA2moi2mx
+WOWbT0eiVS7602CAS8/iFRnVOydpm9RuY7vk6VLIVdF+lfd2yY4hd28/hlwuj8nui0ZwnU1i4xQB
+ki/NPhRiQsrici05t180Vc0ZQy5aN71XezUrjgES5WqXhWs2sU+KBPomCSkVcsrkXEiS6bxL6Lkk
+giXFijsz0jDV+t/ZO/jicfbs/XI76YMSE5xiYtMAgPhnqf8mXh1AAhe7+h3kq98wNaQvzZ0ziozz
+dmcCY4MgqTNmIgEZQXKXVAkhv3hYQq9KAKL/2wC77ClIhisw0Afkgllk26qU5EyQcnYmyEpOxR9g
+Gkzg4tmyQmkutlMi5zykR7oqAYYgvdivDR5uNrxLrhQT7MAwpc0c3J7x1HH0N3ACYiobBNxrsz7Z
+KdphIIpzrDlGEvPxzSHeJXdGz+Em3j3H7FUH1uYL6dLZh6HIVSfQc5Gx/yqNAYZMIpGkkFImp0Ip
+E2ag2n0MuoHA5B3pDDCYIKUrILCPzAUGGDp0J636hOIu6v29n+t6YDzzb+EC9gcQIDCYWGKCRWjp
+WZ9EAstIgFpvu2VIasOHccluF+mu5Gs2ztO57IujpJReAQ7XVEAIDxwDWNhhkooDvjwBhqiE+tsU
+c8ruzEg5kUPsp5QcPA7utK2VsGO2Cy0xG52T/TK27gRKQzX01/h3PGNggvdaAHZNhvrGTJIUK3Qb
+vY4DNr+Do2Pvq+uB1D2dCDQji0vJxEuwbLaXYC/bcm0uS0qZ1zcDroDArsAs0KoIJgVSJqUZk0ZK
+Z5p22y+RxEhSYmewm37B1Qn3LgoDO5i4oyQzxcBcGGR59ukezdme88Med2Q1Vv74jL0UeWU4npMF
+g1pmE67xlVnMr20Mai751UKypQaWIXb+uq0otiDAlIqD6aRMOTNJvjiZIVh+RQ3s+hZgtED7dd/R
+c0nFhpzcuUN43QJw5URKhlqiVUObkiV888k2YJYCQ2TCc8cm7kWHhPH5u6Aehrh/Q+NxNWTppcPH
+sCs45BVypBc+kf0zLWS/YaoIMpgPU8waJtXHTbujJBg2AHYSJXeRn5Mvmo70L6D917SY2/36bDiE
+Uuv54s1+vddpNMQM1BrNFpqCkUlJEVNaW2itOYObYKqo+Ho2xCdaQj9aWL5Jx+A53GyX56SDuje3
+PmFXsI9P1dvuKYhjnd6PHdJTUVR2ey1mNFOaNcwaakozC6dPRq3vrywu81Jyc1EU1UpVid/9tj3/
+aMbOV7Oba4HycP7yps6OK7veTR4U8vi4cv/4jbqCysKBAiw8nL+wnFfm6YjUhK1KKm7b5pLIkwS6
+NbeBRZFkm8dYhKSuAi61I71VZMc9L+l7B0ZvlADgtro9v6ibe4q2TcqaGk0b2vxlK2jL6JppNaHV
+Yy3MKvOUKOUOU+N0PmNNmHSm3FWalN/eQHMsYvqUAQyhfPn285sR8MDd4vvZqvBwv/LL5y+sK5zX
+D3z8dCClxtdvP/Pw8Mg03SFFsOJWQC6JMifSlEg5NEpyJpDwHHZ9LlaQFwMcOju9B7Vdtm46Mn6r
+PSjR9EukqphqAD8wbbTmG2VWFVvAggFqFbT6biBU7g6FlH+HVuXb1wdME/NxRuY7DvoWBrCx4/jk
+Y4Hy9dtfQtC+4X7RbR8r37q8/3rmz3/9zLLAp9MHqn6iTPDzlz/z7es3cpphcpNGipBLZpqzS4OQ
+CCkD2cbmjoSXEJXLzsDfhAGu0JXr3rMd3ANkttW1SSs1Q9uGEVpr4duv6KrYGaz66q9VsGZYa4go
+Hz8eSbmxLpXPf/0MVjjeHWG641jfwACAql3cKCr3p4f3O0DEvRnajIfTmYfHL5wXQ6Ry+ACzJJb1
+gcfzN0wzVgTbif9SMnnKpCmRC+7pSoYUds6b1KHBy8dfNVN/Q9OvmHzvMQU9QKaxuXzSaK9vlxMR
+P0YNBmi1oWeXAK0mF/8raGtgyjQlytxY1iOn08rX+69ghWor82NF0/SGFl7fJyjG6ibJm0mCq5tv
+W1qlWUVVaVYxIhC0AMmo9YyuAR410VRomiiWyJZpJqSGT74SaiENXDU8fnt73d65+ndd+I0fvkoe
+HaUIIeo1fB8WQBdBWwR6VFcBramL+0XRmmgNWgVrvqM6Hw+USSArSmVtK6aNtAprS0ztbUE8F2fY
+jFJ1fZ/zgxSu3hZWQKXaSjVDqSgNUmY6FKY5c14WmgpSO3DsDqKMifmuQg4smN2BJMk9iMPb50r6
+3br65QB83+XbbdzlLdhu70d8JzV8Ea0abccA2oxWFW3+agP8GSULZc5MB9/Obtao2kbEb9NG/QFt
+N4XStJtcbyFflkbYswbVGk3VX+YvE2M6TMx3M+nxTKsG2iNXBROjDf6TzeurAtp3DyV8Dbbp+yQR
+htbb8o9JbsJJsEG3Zs1igVgChdaM1oxaPZRC1dBVgwlA1T/LSShTZjpM7lInrAZVUDcTmyntDVbg
+NRKgVOpFhP3rlwrQ3K43c9GvbUS0tPi8TIXj8cB8XLDHhVZtuEIxcV+BEZDUMQCRa0BgAhN1hwmx
+6tUn3/5W/vu3Utj2hM/femy+JUyV1gRtwQTVBjO0qmhtqMqIBs6lcDzOzPNEzsmDQ5pRm3sVnVFi
+zH4AFWsemfJ26hzeMBOaKarqjgxzrm2tIZKY5pm7uzusCqfl7NwsoMmc+SzeNSHZfaWioBrewuzi
+z8S2ECBkSK7vRALfSVtAjLiAG6DVlAjrMhfxatQ1Jl8NrW5BEapCRJimwuF4JOeMSUy26gCRTc0X
+1w+QAEaPCHrHzdyr5LrPNLkYC3vTzNDWqK15YE4qfPz4iXaG5X6lNfVVbWxBopLcCdR9FdoQDdMQ
+G7F+ogzzs2OAp8Hm38MM71xWZh7NG23fI38Hd/HeoFWlNTcNa3OpmQAR3xmd5gOHwxFJQtWKWA7P
+4KYmusT9XhKgaHtfEKR1tANgQlIhqzc2NYEGNI9xM4xchPmYKYdCtUqrimnseDV3zZqCZCM1yBmS
+RuqXiasDie2CzgybMeAd2r2/y7BBMKu8ZITN8+m/2Y0B7gmU8FXYbuX3VavV0Kqu+1s4ZZpirWHa
+UDHmSbg7FI5zpmQQU3T1QBJrDawhtkYQLqg+Cwh5B5lAaQojaO0tF5tEYkM48DQFAwTSryDNUFsx
+UyRlykE4fiqsJiwR+55ip1At+X5SU3ICilsKohGX2CKgYziIGGFTPfjUhl9gQ+NvY+4exNJjrvcb
+NOGUoqP8za72Tb0w+yKu3z1vIQkC/WsNY9YjPV3KWSMnYy4TH+4yhwmS1ZDKfj9aJVlFcVWpmi4G
+hb6NfJyKqj0Tob9hmGyTAAlDAumiFp4sl1cOEJUmzSVEThzuJpY6U1ulPkTiqDSf6AQpb0a/BgNg
+ikW8QM4gHRsMdcDYaXsS+fpmKRmWzYvx8AYNhTNMPcJyMay588cnv3vefMV30KfN76Pjew+VOxwO
+3N0dOQTw615D17Ku/yMNxxm0W1LfRf6AolrfDqJstwoC7ag2F3d90jVs3KSoBKoDSkkcjxOtztS1
+sa5Ka9V3vSJB0jIjS9ahQnMxK4JqjyHYh4TvxH8ETXo7w4v0ho71+Ny42/YyojG7IJcYA1FBq0IE
+wDgWIjJ8jFr319mQEgTo+3B3x93dHaW4e1ctcJkFU1nsJxhjUf0IDABQrF1Oyv7VoQrV0bNbOqDR
+PvHqTNFoqDU09clQ5jlhHw+oKg/3C+taPXZOErHzuSWKeIqhxwyIkHJCxSdfd6ogdSw5cMD7RORT
+CWBs2ckhlp44ekISNkFqhtD5+0TPIS0i78/HxttZ5sLxWDgej0zz7BauefwAKiMOwmI8TfGt43Y5
+L+DNJOIq4A3ZZNtAPWGALgF0mC3aui9AaaKkCBBVbWHuJI53s1sEtlADHXdnTxPouXDJQIpbAtqM
+lMSZIG3SYEs46RIhOONtveLJaDz5YwfyLLyT3emjQO3eTdsm22xjmI7gI7Yv58zx4DZ/mYpHTZti
+6nsBPRqYuI9FzIC1TdJ+H3UM8HZFudN/6uHOoZd0cGoXUx7cYaaR3NBQq322mOeM3k0+aKfV/eIK
+fTPFU78ElcAa4u5hC8aweG1qYIsjGKbiK92/BBBf5C4aw58flu9OAtj2WWUwwF7HbzrbrxMRSikc
+7+64uyscDgWRtG0bBwOk7vY2HX4GG4wQHsbvIutWQHuX+eu+nNhIDi/gE0ni7j5vMIZoRPsMi8N3
+BedDBmb/zFZqOEdMPTJWcGuiB1WmiB900GhYqJY9FpAuPXq42gu6jnps/97t+vh0OPsC7XdJYI0A
+voS9bkNva0ygWzCZaZo4Hg98uDsyzx4iZ6a07kEKqeEL09GthleVwFyqSnvjZtA1Cj/AG8k2Bkji
+HjvVLd7sCcdqgKrketQGMPNXysJ8LPTo3vPJzcba76cCrVsGMpxNKaJpVTwTeBP9/ofIlgL2nLZt
+5Eucb+P/m6TbofI+6TsQaArWdFMBO5VoEeE7TYVpyhyPE3d3M/OhkJKrSt/cNCRciEJf6SDhTjb1
+BvSQMdXvxwDuCNLrA3WNNhs71oZupslzUdVC+EvorGG9yBhmRIT5MO3i9xewSm2+1ZxIYQVYmH46
+UsJFXBqEj2ZTBSPI8kLHX40j8DZtzh58FXYm0P556Hc2068zhGr1PX+t5JyYZ5/w43HmeJyZpoRI
+SMzdyobIYx73dkeQBlP1mMq3F4K41lOjmNqV4ky/crF2xO0OId8X6C7LvgI8I1fHj30Xbz/5njTi
+6L6QOFqPdBFYKnX1Choufl1De0rZc5EPTxNEZbvPM+oq4tqwdFXVHUn9XZttUsBkqAmjSwjdJJ4o
+OQvzXDgeJw7HifmQPfAlxsRj9BjgtTOCoFvu5VhQrhYtTMAfogFEKFV7+PUbKAbAvW8GKgPhttYb
+GKageASsT0oOFRDid3P8Aw3Mt0KPMnnW0GnhdFpZF/ehq3aJYeReC2Cn//fu4W3erzHAZRd4xyhj
+y9p2en+ogR0A7BhBOsZRck6UMjHPhcNx5nCYwlpx6dCNCg91F8amlmngKn9Q94P4guqqxYYp+d1k
+RrEAKW8jGfrI2y+jqIGLwM1Z0ZWAJ0WkQK8W/pU++dEG8XSTlBJlShyZSJJYS6IuxrqutFZdujTf
+gOlSYewnPZn9K/16JZx8rOq9CQd49FHA3k1yx4o1JDtT5jwxzRPTVJjnQimJHFHPFnrCWa8HjOQh
+ETcGCP7oYj/UQI+l6MUjfgQVImL1TWR95vtA9MIGvcxBRa162Bf+uUfyKO5UCeN5mGkhNi3sfzJe
+Ji2RUuEwT9TZOJ/PLIvXHvJt6BCPMSMS6mXAuxDdL0gM7aHhTzsW1+0m37oN0LNywzEUJp1HJuOb
+XXNhniemuTBNJYprmPe/g4S9hRnSpIuSwUwYIwzePOeiF99o5qV2tjz/95NJ7AW8bwfVkbAGUGlp
+peWVapWajVWEglHVV+xWKLKNDZy9s952q7ZnFCNCSgYpR/pYJpVMWY2mgmplXdvmfbO26VXzpOpL
+dD2aTPBMqc4Atv0d3ydJngSbswe35kSZhDJbrHbIWZG0bvy37+cTcFnZ9uK79dGfpGjkC66yUtMa
+foRGs0z5bj+AP9IdQe8AlBKeq06aFDkoKSvMFc0r1ZL7B8xIFtaAbODp2R29TW5W7D6PVSeJXBRJ
+HlKuKrTm8QKttcAdggepdlS+WQK2zWJ8dokDtk2X6ORQKZHFHVVShTwJJRdKyZQJptlGIcwn6XbP
++2kbE8TIXRtiiHx/TQ2ZY8EUz0L6IdvBhBn4rot3veg1fo7HCdXMNHkCY2tt/E5VPdX5rXhj2OBp
+jFwpAhTMMvM8uSOlh1sPZoC2yjChust7yya+nIreCzellMjJ6x6IyPjbTdWtoIVnNhvIunNyPZ/k
+95OZY4u7u0P8nWJT7AcEhLgn8O3bwb1hWwMzInA4TMPrdamRHiL2Vn0jXo94QGd2Ct7zCyx2CFNO
+5JZjwkGnpxE0HaDKKyDQQ9ENkT65kZLdfRSp+xAkdiNdYmh4On809fGc56d5AD+CAczeux3MUwnQ
+V3fO+YUzCHgy6e+yOEgOGcb120re5+QlEaREEaLolUfm6GCA7lK+XhfJNpOSnnq2pZiPhrD3Bbgl
+c2kYv8dhsx+/kc7+bGy/i8x8O/i90bWjoINtu1P7v/u/9799x1PAGj3d6jljmaV43wbEJ9knq+vl
+rSZv9xVcAb+y/7gzQweCtoHM7SfRFrsoAL5noi6N7/O+fi8VR/Hvv8FzUf9EzL5H5z+jzeFySeSF
+Z3Ho3d3qEA1nT5+h3Zu4tr/Gk/sWW2QfdZPwspiPRJZnN/xRE/WcAfbv33vfMsKtv+Mm1/597e+3
+U/favbTbfX/9wvMja+kivdqUS97Bp++Xb3jNq/j9dOk+P+re5Xtu9tp1P0xPwW7CnjPb0/en1J1N
+r9z24nXvWVmbqP6R9LeceMD3At4TEPL/O72rz9fE9W+57vvF6z8FErcC/gkwwLsmJBjgzTzwHc/6
+J0YCvh38npjA//npvX0SeKuffWxq/dMi8aDQ1/XkPz69d3W9s1NXkf5vuOZ/6nF8SWZGaaYvsoO7
+Y+g1yXC1r782drLd/7fS+yDAb9DlL42Kdz6x+yXeetV7pdRlZnsNH/ZqpfvLDKNo9W+30iiy2cpj
+q/LZza63YThMLjbi1VCsq01HrBdf+e0DZsNdfOWuV9txOVDk1+hpEMq1H+zInr3/5gdFMOxlr9PF
+fgvi9RZ0K13Tm+PZwbGDLrsLfo07RxGvFw188fytfUQR5GdXvvaszQFzheR9kvdH455RWv/SM646
+nN6xBzMWwjOTeHxymTF6sd1Nuvv/ixdh7B/2H7EB6Mu7plz76tUv5PpA9QicS4+6NkzdNfQDYiO+
+j17p13V6HwuObe1nfXYYcv2ePWztqeAzSmo9uqXvhMUmiOw55RkpHsJ8ZWVeW7DXVcArEucqF/Z7
+Xv66h6RfvuhH47Vf6ddVh9P7wK0l41KJkJ6scu1pz7e/xKD8r3/3L7edrwiV6UxwlYzYZrv8ZY+X
+e9GI1O97SSFe596tLS+ve0V5XM0OHqljP5ReEZUXqX/31nYYli65uPeRzC/psro2yr/5f/7VdrFu
+++Z+kVw8U1KQ3Ybrs2aYJztcncwLUqBvdlzl3ivbtz3Q49pzUrosHrYDqn4EE7w+8K/Re0CxRczl
+C+YyH48rMvnZOwOsl//r7/83DzsakTM6ypW5bgM6dBtbkV67/mLjdZ/I8KS3o8MvhZ+NxFLPU9jE
+9/5ED3gqWcb+/rOubqlY6eX1EAEeW2DH1sfrNGTUM5Tdda/u4gf3z3yKyuWZGWy7zy4/tIfs2W4S
+vTRflwJ7q+1S0qjscNIzc9WgfGq9GQKSsZQ9lLuvSGM3mClSwJRsu/r9FzqpljB2eXG9XHxngN01
+BmHaeA5B0xa5cls+oMRo9gm2MfrEvbcNme7cErMtgzhSvHtfk24qL7Exw2tiu6/0HoXc2+ITtV3q
+eCoqopttUmqAxfhRt3CkK8annGBm1NqTbrqpbnhEdGAw6ecj+dZ7U/P08njewCe7+EaJbnpE0OMv
+Xoc+5xCz22psIQl6HBrIOL+GmKBuplnoXI/+TSOB0XpsQMTT9cSNsZMXq6ZPnFfS1sH5IoLXjHEG
+6ImSvZP9GNjUjwTb7UIaQE5IymwPjsFPya0eGdVYxmq55tERkciG7nUAtgyfJ2yzb0OXDOxx1u6e
+7CRjP910ME6PZNKt3RgWkdb9I4v+C8706K5dvbBEN7/3w4BQzt/+7AcTlTzO0+2i1Y+ABct5iLnB
+wSMf8GnWio+tF4uq1XPkBCGVfi5gn/iNSQcT7bFAXxm7c3634M9IqxJGzN4mdp+K1xH/JxvnS9oG
+7Pl6l3RFFcjWjj4xqm2UcBsGtOA1gSI4dfSjy+kdf/UjbXpN5M4ASWSXXr6Jlq6CtVUssrF72FpO
+HrxqbNnDtVZardQWBScsPfF0mxnl4cHLxeeSSQhNdYjULt6qeAh42wVUph4po1uhSFUdDepl4lS9
+kugW0+aOp7TrcH897XCINvYrWz0LNwZXkpDS5CtGt0qdfSKTJK9KsPOQxXxszNEHvzPPE337nAd6
+G3clcHbgtWOOPrgd0/SJQniCSzoeeILph4B4jhc6X7sK7irAOsPE2U/9LILWGsu6sC5RgaUJoiWk
+grdXBcr6eI/kDK3QRGhxKrGHPbvY0Fh5IywJIe9E1d6C6HpuGwANJmJTHV0Xjlfo8A56grpuE3kq
+IboaEECat7dX0dhWXAxMqIsnRtfu2eP8QpGoU3Q5kGXT29GO1pyxhipKYzL6BEpM2HByCVEK5wKi
+fUYD1+xEpsbky2AC/1plCxrV1qJYZYN1RZeFtqzYKkhdvVhVj98Uo+hqJPWSriklFoxWvfJ3mgoI
+1LXuKn+4jllt4MutH7vBl2AeMT+4maYMH4BBP8DAF2aNy22sMPpEIU+/YycaQyVZWB5+SR8MG0wh
+/fOcKSn7mUbiE6E8A2ZXaK9K+oQmA69ZnMhRvHBvvfjvU5hutvU5mLj3r1sMKZIbXRD5YumJNDYw
+VVScjBrNsJ27nHL2/AU8ucwP1PYqKw1zKbBPLDWj9PM/MSGRmdKECNRWWU+LYwG8zl+eCll6urTX
+Z5EQU8NE6jghBtWLHLtY36azi8hNIXUc4Ay1T37suXU2BkLpzONFGTQYKpYOvexq6ucO9cmPcwo9
+vj89kVLx5JFMtMX+x6TjK82/8wKFuYt1yWSZAs9s5lp/N4uETmnQIm/IiArpaTCLpDQOt+7qrGOk
+Pk8OWIPJesh6H9UBypVaG3VdqdUzpVIS0uxzti0gKOvqjSvVM9FyKpAMpXFeq5cyLZk8JcphJpXs
+qJpp0529497Svs4xNWqtmOrADS/V6/ZBH7s90nekXcfAbhaKm0IyANOmnjyJg1EyrkuF/sphMfT7
+dGvFJ/kp+BzFJ8VVoevy+CxURyKTmHfJJptPxcxrBXi7NkkGfkJZyeWpKgpwOtRcX0iWUPEkmWHM
+Sh/p2OUTl7Z1VdbWWGujhlOuFGGat763ODW+/Nc//4XDfOCP/ywjHwpFZNS2ncrMIScke+VuC44s
+SRDxE0G7JZC6WJTdYYfJw45ba3FytpteHTNvEbyb2TZWS2CO4VTi6WQ65ZGMss9L6ODOjZc9g70M
+r+5/m8hwb3fJYrIx1Qss1lcnkKUwJ9uBwD0D9NpJ/hqp82Zgnj4/nk/IiiNaAAAMGElEQVQ/SVa2
+BRX/dgnhBaQtjo21sF+9v37uoKpRiqulaZrdGlhbFF5Mnmgr+CJWo/zDP3zhcDwgzJhmjtOE1YbW
+xjx7Nm4vUy5iXrNOVpK5aPaat45InRcFS2kcVGym0PP1LGHkJ0Lg6QS5+HKQtdUbiFMlnzBAzs4E
+Oe/PztnuldLTFbc3MTuT7D2Gg8F2OKM7cCxYNnVTa6iqDu6Uhqdv7xmgqWcMhQAZz9LADrsk6MCX
+3ZTe8in2Lu0xVlJ8MYk7XpJkSvHUsVq9IoNId5P34pUCMmHJx1+pIEo5nWFtFbPPLGfj9z99IqNY
+XTg/emZNynD4cODDxyM09Yfsjj7rel4Aa0qrXhGkpM35g0bSdz+9W2QbdGfkJ5SyBN4QPM17S8zc
+//hlsuZ235QgZ18t3S7uvonXwtbdB9LVgg9iTr6ius6W0eiYHM07E7D7CFpIoq6SuszYTFqtOvBP
+B8BdtW1q6xkDpIleB8mP3/Vzm70U7UqrC8uy8vj4yLo2UsqU+QPT4Rjq2xCZMJTyuIJU5bw8sJ6V
+uijHIoiuWFvIyTjezWB+qM10nEilICkjJZNTF/9ewKmlhlEJ459UiuudWCk9CWWLAehW92ao7adY
+JCzHEMeqT1e1GeScyLnsPJbbhs+6roMBhnNkl0W8lwI5u1g0bQGewhOaEi0l2lp3DCDjlFEzobY0
+mG6zVNSLWmp26TtqPuy8dG3DO60D0ujTMMV30tQLb2/99+8SIhlTZVkqy7KyBgBsTVlX5bSekDUx
+TQdySV7Cx5TyeDagkbRRz5V6rnw8uE6jLcyTMJfMGeV8PvFJP3D36RMyTV7BowOiENu5RSeiitGU
+s3upwN2U7MrI7F59MnumsnWbG/DNDxnX9oHq146j6NOGiPvq6UBv77DZp5L3QSylUEoJ9eeSYjBY
+gLOeAbzfQ3ALQWiWNo9qL3NLT0SN85CGP6M7zRzQP3X7ehvdWsmbG2CoR1cpqi1K5hhmLgl878Bd
++CJenQyEx8dH7pczCyeOdx+ZD1NIC6V8e3hEMIoYWhvSFOqEzZk5+3pc10ouE/M0YQqPDw/U9Zsf
+ay7Jz7e18Bf4gTiODYbjCIhyb5nC3vO25+TU0XekaAOjIATxDAQmctjQ/lF3GO29es4A+cXASkfA
+zz4br8A0e7zQ1cL+mv6dI/dMi82uvFMRFgwPNuoXjXI6zU1bsW0MtmJQNiyZPU4eB1HhOKGUmVIk
+MECvONrPJ3IGf3g48fnzF+5XoeUjp6WOotSYUE6PD+7VmzINqCvULFhJSPGBXmvjwMQ0HWjaWB8f
+WJcFslGSr3DMnjDAEG+7XcVkE4kDJU9+bGxfFiGybRwUOao90R1Hjpa8471YQ47iDZ0R+mSC2+Y9
+x38/YV06qOrmE+hM0RplmmJSoiKXPq2E7sy6VSUpZSLlgo3aAbAdPuk7nL0UXl+5ao2WrNfHcqUw
+9lGeqreNNkvCDPyEkVBdOxwgYQksy8r9cs+6VD+XAT+McTmdedRHv06Eous5TvCeyKSwTRMlZ7Q1
+1tUo04G1Kt8eTs59BT4eP3I4zsyTF3gMqDl2CfvK75ZBkoRZRs3NlXHk65gYGV6PXnDaiy02lvPJ
+fWlPzMG+0nv5Nt98WtdKrSsO3KaxsvqEdTOwq42uKvr38+SVyfpGStM2VuC2rxEWBEKZilsiqZds
+0YFHcumFL8OCwrdyexXRfgj4JqU6E0OtUVpnB3p7eVgJ5jb13/UXJuRcBiA2g3k+8Pf/4u+pVnhc
+4edfPvN4Prv7XxLl7//570lJuJsmDvPEMWeOU2Hu7lKU03mhiXKXoMwTRQpaM3qCZVHM3NkjsUEk
+5k6OHngRhVdoVJqtkUNjY2Vb1/XqJ2sOy8LhEk0amjZ1sm2mSFTZdj95q43afOK8juFzF7MNzLCX
+Fv3vvqXsFeIltqFj1alvvGzeQrfdvXx7xc9x05g0rxCaW9/H6PZeZ/YAeuHFG5XWbetj6w6cnZQS
+sThHIVReDjd0LpTsm2y5TExlIqUyVKtI4vHUOJ8fkbpCXRDLgFD+z//jfyeLg7UiQjJlPZ/RuvDh
+7gOqjf/+5z9xbpl8PDDPMzkXHh9PfDs/UNfKspxptYbv3/uak5DFQYypUptbB5a3otIS7J76RlBs
+IVuohGmamQ8z6VDIs4MiF/19ZaUhAcCQ4zycIjJc1ZsHcL8Tt/9s/7nBOGdi1DoMSfRENAfT+sGP
+4Q+xbjZur9ZcIvU+O04psdGGe0fFJ0vbFg+Ri6vWMjk4TWG+eb2CiZz8XMFpmiilkPNEyf7uEk35
++vWeb9/u+fbtG/dfP/P15y+084lsldzB7x9++uCDXTK0xun+gVM9Y9r49NMfKVPh68NXvtzf85ef
+P5MPBz7+8ROfPnxAtFHXSl1XX3Wx/dl9Al28+05hA1ZI6xgowT1SKckwg7biEjlq7h1Ih5kyz2Mw
+uu7vk7enbR8iYbqtnv1vn249P6UmMVXdCrFtU2kDje4UyqE6Wq3oWsfWr5t8Dgib+gLxVd6dReGm
+Doy430J+AopDTXVV5c9OJGZEQvXSd14Jk+8UPoAT377d8/DwyPl0YjmfmDMcP92NeyJCcRcmFDHW
+trKc72nriXma+fjhjuOHO3763e/4fP/AL7985e7DJ/7w+9/z4fcfOMyTm22Gl4yvEQGEr+Zu4xL6
+EluABe2OGDb36dg63nc8fA2W3feQSw4uL8M+7lVI9n59N+/E9RzdTHN07D6pOL+3r+7Wxm6i9tCy
+wRLe9v3pM0mEMk2Ukl1UN8Pq5uMvqTBPMx8+3IFArQtN6zDjnAli3Nreb+BYqEvGHh301PGUEJnA
+fJWfzgun05nT45n1vLCsKw/39zzcP7gkNyWnzFwKH3+680M8p9mtlSSUuwRYYz2faKczhcrvf/eB
+n373Ex/uZswaRYRjKdRcOH995E//5U/88tc/+7Gw88SUy/BY5bRxbEJ23g9DNaMtud4M0NMPfkqS
+46Rpt7tLLtQ4Ot4AWsXOK71IY/fPC7DWlfN54fHxkdPpxHI+4/sEB99D23yxgNCaUgPZt4jeIRw7
+7tPY1MHQ/3tpsPNbNK3hCu/RP3A4Tvz06RN//F/+wNGPAaMUoRRH6yI+6W72EsEblfPpzLrWceBm
+fw23mHl71wa1GWttLMvCcq60dUVrxVrFaoVWyQKHnDlMhcOxcLwrTJOQkh9PLyQK50ea+une1iqH
+krj7cOAwF+6/feb+4cS3r1+gKcc8YWvjy1+/sP5ckSJMpXh5tuQFkqdSfHVMLqpTD1ZsjaZrhJnt
+RW/shfeYPrUIcUpjFaTsnsReZk4iyNPdrJlaG+u68PD4yOnxkfP5jCqkNNH3d12sxy6geQCJInGC
+mwa2KORA5l0k06VZOHC6N9EnqrrHbW3D1CV5ubyffveJf/7lxN3dgZTgeNdLxZfALVH4ymBdK6fT
+ifv7e5azH6zpSD4/ZYIwstaItmpxKJWZ1xnOZpQEx2nmeDdzkMachcOUmA6JMqedOxqESvn5559B
+3NlSpsw0FdZ15cuf/sRff/7Cl6/fWGslpcLh8JHDlMllAsksrfLt8cz5fPJTQqOMasrCVKbhh6+t
+siyLmyr4d9PsIhRkB7R27xGaVkphPhxi1dumUpJ7uj5+/MA8Hyj5wKHMlA8/MU9LTIx79GqIe6NB
+ctQsKXtou4IlC4dWIVnz84xbG0ywOa0kzEDzg69scpv7rCxL8nORTVnOynp+5Pz4V3LxyfaS8cEA
+klwNmfm27bKwLAvn8wKkkKLTYACXet6+PEDwRMqJacq+A4tSMhyK8HEW7grMqVKkkbtbJW3xBx3M
+lNN5+c85y78nzczJV3NbKqeHRz5//oVfvnxDRDgePjLPPvDSo06ssa6Nx8czy7r6nneEMnWwBrCu
+rqdqM4TM8XDgcNBR/LC1xlrX4aevq6+ylHOUXK9MUwlg11BTkmQOd0qWg8cxHDJ5yhEEkjFNHjjT
+Xc9xFmPK7meaxDeYLEEyRSKAQMQi7UroNYs3f7tilraQb3VQhoHV2EYPHCA0hDMkR/bn08ThbmUu
+k593pMpijaUqy3KKBaJkSZT5SM5GlpACWSkpM01CKYmDQZqCIVKmhNdwKsphShwPmbtZKSQmqrc7
+etPd2niP/vP/AAyBfHNJXSmFAAAAAElFTkSuQmCC
+"
+ height="129"
+ width="128" />
+ </g>
+</svg>
diff --git a/demos/mobile/qtbubblelevel/icons/qtbl_icon.png b/demos/mobile/qtbubblelevel/icons/qtbl_icon.png
new file mode 100644
index 0000000..780fbb4
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/icons/qtbl_icon.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/icons/xpm/qtbubblelevel.xpm b/demos/mobile/qtbubblelevel/icons/xpm/qtbubblelevel.xpm
new file mode 100644
index 0000000..19f3c2f
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/icons/xpm/qtbubblelevel.xpm
@@ -0,0 +1,1783 @@
+/* XPM */
+static char * qtbubblelevel_xpm[] = {
+"64 64 1716 2",
+" c None",
+". c #BBD2A8",
+"+ c #BBD1A8",
+"@ c #BFD3A5",
+"# c #C0D2AA",
+"$ c #A4B594",
+"% c #94A488",
+"& c #B2C3A5",
+"* c #A5B694",
+"= c #A6B893",
+"- c #A7B993",
+"; c #A8BA93",
+"> c #A6B891",
+", c #A7B992",
+"' c #A7B792",
+") c #A7B896",
+"! c #A8B997",
+"~ c #A9BA98",
+"{ c #ABBC99",
+"] c #AABB99",
+"^ c #AABB98",
+"/ c #A8B996",
+"( c #A9BA97",
+"_ c #ADBC94",
+": c #ACBA95",
+"< c #ABB895",
+"[ c #ADBC9A",
+"} c #B6C3A5",
+"| c #95A285",
+"1 c #A9BA99",
+"2 c #BDD4AA",
+"3 c #AFC897",
+"4 c #AFC898",
+"5 c #AFC797",
+"6 c #B4C994",
+"7 c #B4C799",
+"8 c #97A981",
+"9 c #839570",
+"0 c #8C9E7A",
+"a c #7B8C65",
+"b c #7E9167",
+"c c #7D9268",
+"d c #7E9268",
+"e c #7E926A",
+"f c #82966E",
+"g c #859972",
+"h c #889B74",
+"i c #8CA07A",
+"j c #8FA37D",
+"k c #91A47E",
+"l c #93A680",
+"m c #94A881",
+"n c #93A781",
+"o c #95A983",
+"p c #96AA83",
+"q c #94A882",
+"r c #94A880",
+"s c #94A780",
+"t c #93A47A",
+"u c #90A079",
+"v c #8D9C77",
+"w c #8B9A78",
+"x c #98A787",
+"y c #879576",
+"z c #9CAE89",
+"A c #B1CA9A",
+"B c #B1C999",
+"C c #A7BF8A",
+"D c #A8C18A",
+"E c #A8C18B",
+"F c #A8C08A",
+"G c #ACC286",
+"H c #ACC08A",
+"I c #93A677",
+"J c #7A8C63",
+"K c #7A8D62",
+"L c #778A5D",
+"M c #7C905F",
+"N c #799162",
+"O c #7A9163",
+"P c #799063",
+"Q c #7B9363",
+"R c #7C9464",
+"S c #7C9465",
+"T c #819869",
+"U c #849C6D",
+"V c #89A071",
+"W c #8DA478",
+"X c #90A77C",
+"Y c #94AB80",
+"Z c #96AD82",
+"` c #97AE83",
+" . c #96AE83",
+".. c #98AD82",
+"+. c #99AF84",
+"@. c #9AB085",
+"#. c #99B085",
+"$. c #98AE83",
+"%. c #97AD81",
+"&. c #96A97D",
+"*. c #91A378",
+"=. c #8C9F76",
+"-. c #879973",
+";. c #879875",
+">. c #819271",
+",. c #96AA80",
+"'. c #AAC38C",
+"). c #A9C28C",
+"!. c #A7C189",
+"~. c #A8C189",
+"{. c #A2BB80",
+"]. c #A2BB82",
+"^. c #A1BA81",
+"/. c #A4BD83",
+"(. c #A3BD82",
+"_. c #A5BC7D",
+":. c #A4B980",
+"<. c #8CA06F",
+"[. c #798B5F",
+"}. c #788B5E",
+"|. c #7A8D5D",
+"1. c #7D935F",
+"2. c #7A9661",
+"3. c #7C9762",
+"4. c #7C9763",
+"5. c #819B66",
+"6. c #829D68",
+"7. c #829D66",
+"8. c #819C65",
+"9. c #849F68",
+"0. c #86A16A",
+"a. c #87A26C",
+"b. c #8CA674",
+"c. c #8FA979",
+"d. c #92AD7D",
+"e. c #95AF7F",
+"f. c #96B080",
+"g. c #97B180",
+"h. c #98B282",
+"i. c #9AB383",
+"j. c #9AB483",
+"k. c #99B282",
+"l. c #97B080",
+"m. c #96AF7F",
+"n. c #93A879",
+"o. c #8DA375",
+"p. c #889D72",
+"q. c #81966D",
+"r. c #7E926B",
+"s. c #7B8E6A",
+"t. c #94A97C",
+"u. c #A4BD84",
+"v. c #A3BC82",
+"w. c #A1BA82",
+"x. c #A2BB83",
+"y. c #A3BB84",
+"z. c #A5BD86",
+"A. c #A5BD85",
+"B. c #A6BC7F",
+"C. c #A5BA83",
+"D. c #90A274",
+"E. c #7D9165",
+"F. c #7E9266",
+"G. c #7E9262",
+"H. c #809662",
+"I. c #7E9C61",
+"J. c #819E64",
+"K. c #83A166",
+"L. c #88A56B",
+"M. c #89A76C",
+"N. c #89A769",
+"O. c #8BA96B",
+"P. c #8CAB6B",
+"Q. c #8FAD74",
+"R. c #92AF79",
+"S. c #95B27C",
+"T. c #97B57E",
+"U. c #98B67E",
+"V. c #9AB880",
+"W. c #9CB982",
+"X. c #9CBA83",
+"Y. c #9DBA83",
+"Z. c #9BB881",
+"`. c #99B67F",
+" + c #98B57E",
+".+ c #96B27D",
+"++ c #93AB79",
+"@+ c #8CA574",
+"#+ c #879F70",
+"$+ c #829A6D",
+"%+ c #80976D",
+"&+ c #7D946C",
+"*+ c #95AC7D",
+"=+ c #A4BC85",
+"-+ c #A3BA84",
+";+ c #A3BC84",
+">+ c #A4BC88",
+",+ c #A4BC89",
+"'+ c #A6BE8B",
+")+ c #A5BE8A",
+"!+ c #A7BC83",
+"~+ c #A8BC88",
+"{+ c #94A77B",
+"]+ c #85976F",
+"^+ c #869870",
+"/+ c #83966B",
+"(+ c #859A69",
+"_+ c #84A365",
+":+ c #88A869",
+"<+ c #8CAC6D",
+"[+ c #90B071",
+"}+ c #91B172",
+"|+ c #91B170",
+"1+ c #91B26D",
+"2+ c #91B26E",
+"3+ c #91B16E",
+"4+ c #90B16C",
+"5+ c #93B370",
+"6+ c #95B376",
+"7+ c #96B47A",
+"8+ c #99B87E",
+"9+ c #9CBA80",
+"0+ c #9BBA80",
+"a+ c #9EBD82",
+"b+ c #9FBE83",
+"c+ c #A0BF84",
+"d+ c #9DBB81",
+"e+ c #9BBA7F",
+"f+ c #9AB97E",
+"g+ c #98B67D",
+"h+ c #93AD79",
+"i+ c #8DA874",
+"j+ c #87A271",
+"k+ c #849E6F",
+"l+ c #849E72",
+"m+ c #80996F",
+"n+ c #96AE80",
+"o+ c #A5BD8A",
+"p+ c #A3BB88",
+"q+ c #A7BF8C",
+"r+ c #A6BE8C",
+"s+ c #A8C08E",
+"t+ c #A8C08D",
+"u+ c #A8C08B",
+"v+ c #A8BE8B",
+"w+ c #95AA80",
+"x+ c #899C7A",
+"y+ c #8B9F78",
+"z+ c #879C71",
+"A+ c #879E71",
+"B+ c #8AA86E",
+"C+ c #8EAD70",
+"D+ c #92B274",
+"E+ c #94B776",
+"F+ c #94B875",
+"G+ c #93B872",
+"H+ c #93B973",
+"I+ c #97B976",
+"J+ c #96B976",
+"K+ c #98B976",
+"L+ c #98BB77",
+"M+ c #97B97A",
+"N+ c #99BA7D",
+"O+ c #9ABB7E",
+"P+ c #9BBD80",
+"Q+ c #9EBF82",
+"R+ c #9FC082",
+"S+ c #9FC183",
+"T+ c #A1C284",
+"U+ c #A0C184",
+"V+ c #A3BF88",
+"W+ c #A3C086",
+"X+ c #A3C087",
+"Y+ c #9FBC82",
+"Z+ c #9EBC80",
+"`+ c #9EBB80",
+" @ c #9AB77C",
+".@ c #92AF78",
+"+@ c #8DA87A",
+"@@ c #89A279",
+"#@ c #869F74",
+"$@ c #8CA378",
+"%@ c #889D73",
+"&@ c #9AB084",
+"*@ c #A7BF8D",
+"=@ c #A5BD8B",
+"-@ c #A6BE87",
+";@ c #A6BF87",
+">@ c #A5BF87",
+",@ c #A7BF89",
+"'@ c #A6C087",
+")@ c #93AB7E",
+"!@ c #8A9E7D",
+"~@ c #8FA67B",
+"{@ c #849D6D",
+"]@ c #88A072",
+"^@ c #8BA971",
+"/@ c #8FAF73",
+"(@ c #92B675",
+"_@ c #94BA74",
+":@ c #92BC71",
+"<@ c #91BE6D",
+"[@ c #94BE71",
+"}@ c #96BC78",
+"|@ c #97BD78",
+"1@ c #96BD78",
+"2@ c #98BF7A",
+"3@ c #99BF7A",
+"4@ c #9CC27E",
+"5@ c #9BC17D",
+"6@ c #9DC380",
+"7@ c #9EC480",
+"8@ c #9EC380",
+"9@ c #A1C185",
+"0@ c #A1C282",
+"a@ c #9DBE7E",
+"b@ c #9DBE7D",
+"c@ c #9CBD7B",
+"d@ c #97B875",
+"e@ c #92B273",
+"f@ c #8CA97B",
+"g@ c #88A17C",
+"h@ c #879E74",
+"i@ c #8DA074",
+"j@ c #9BB081",
+"k@ c #A7C089",
+"l@ c #A5BE88",
+"m@ c #A6BF86",
+"n@ c #93AF6E",
+"o@ c #94B06E",
+"p@ c #93B06E",
+"q@ c #93B070",
+"r@ c #95B16F",
+"s@ c #809B63",
+"t@ c #758F61",
+"u@ c #86A16B",
+"v@ c #6F8A50",
+"w@ c #728F58",
+"x@ c #729757",
+"y@ c #789E5B",
+"z@ c #7DA75D",
+"A@ c #7EAC5C",
+"B@ c #7EAE5A",
+"C@ c #81B259",
+"D@ c #81B25D",
+"E@ c #83B061",
+"F@ c #83B161",
+"G@ c #85B363",
+"H@ c #84B363",
+"I@ c #86B465",
+"J@ c #86B565",
+"K@ c #86B464",
+"L@ c #88B666",
+"M@ c #88B767",
+"N@ c #8BB468",
+"O@ c #8BB568",
+"P@ c #8BB567",
+"Q@ c #89B263",
+"R@ c #87B163",
+"S@ c #84AD5F",
+"T@ c #7EA759",
+"U@ c #7C9E59",
+"V@ c #78955F",
+"W@ c #728E5E",
+"X@ c #748F5A",
+"Y@ c #889F68",
+"Z@ c #7A905E",
+"`@ c #88A06A",
+" # c #97B472",
+".# c #97B372",
+"+# c #94B06F",
+"@# c #94B06D",
+"## c #7A994D",
+"$# c #7A9A4E",
+"%# c #799A4E",
+"&# c #799A4B",
+"*# c #607E3B",
+"=# c #537038",
+"-# c #6F8E4D",
+";# c #52712B",
+"># c #4D6D2C",
+",# c #4C752E",
+"'# c #537D32",
+")# c #598737",
+"!# c #5D8E38",
+"~# c #5E9337",
+"{# c #619838",
+"]# c #62993B",
+"^# c #62963B",
+"/# c #62973B",
+"(# c #64993D",
+"_# c #63993C",
+":# c #65993E",
+"<# c #659A3E",
+"[# c #649A3D",
+"}# c #669A40",
+"|# c #679B40",
+"1# c #679B3F",
+"2# c #6A9B3B",
+"3# c #6A9B3C",
+"4# c #6A9B3D",
+"5# c #67983C",
+"6# c #65953B",
+"7# c #5F9036",
+"8# c #59882F",
+"9# c #577B30",
+"0# c #517334",
+"a# c #4D6D30",
+"b# c #557533",
+"c# c #708C4B",
+"d# c #587037",
+"e# c #6B8647",
+"f# c #7C9C50",
+"g# c #719440",
+"h# c #719540",
+"i# c #71953F",
+"j# c #709441",
+"k# c #6F933D",
+"l# c #56792E",
+"m# c #496929",
+"n# c #6B8D45",
+"o# c #527528",
+"p# c #40631C",
+"q# c #406920",
+"r# c #436E21",
+"s# c #4A7826",
+"t# c #4F8129",
+"u# c #518729",
+"v# c #558C2A",
+"w# c #568E2B",
+"x# c #568D2B",
+"y# c #578F2B",
+"z# c #57902C",
+"A# c #59912D",
+"B# c #59912C",
+"C# c #59912E",
+"D# c #59902D",
+"E# c #5D9228",
+"F# c #5C9027",
+"G# c #5A8E2A",
+"H# c #5A8D2C",
+"I# c #56892B",
+"J# c #508226",
+"K# c #4A7B23",
+"L# c #476E21",
+"M# c #416721",
+"N# c #3F631E",
+"O# c #577A2F",
+"P# c #6A8A42",
+"Q# c #4A6529",
+"R# c #5D7C38",
+"S# c #709440",
+"T# c #6A913A",
+"U# c #6B923A",
+"V# c #6A923B",
+"W# c #699037",
+"X# c #507528",
+"Y# c #436724",
+"Z# c #678C41",
+"`# c #5E8533",
+" $ c #42671D",
+".$ c #3E631D",
+"+$ c #3F671D",
+"@$ c #456E20",
+"#$ c #4A7823",
+"$$ c #4C7D23",
+"%$ c #518325",
+"&$ c #528625",
+"*$ c #528923",
+"=$ c #548A24",
+"-$ c #558C26",
+";$ c #568D27",
+">$ c #568C25",
+",$ c #588B23",
+"'$ c #578924",
+")$ c #558626",
+"!$ c #538328",
+"~$ c #4E7D28",
+"{$ c #487625",
+"]$ c #437020",
+"^$ c #3D671B",
+"/$ c #3B621B",
+"($ c #436920",
+"_$ c #618538",
+":$ c #66883E",
+"<$ c #446126",
+"[$ c #597935",
+"}$ c #668E36",
+"|$ c #668E35",
+"1$ c #658D36",
+"2$ c #648C33",
+"3$ c #4B7225",
+"4$ c #416522",
+"5$ c #61873B",
+"6$ c #658B3B",
+"7$ c #52762D",
+"8$ c #3E5D1B",
+"9$ c #3D5E19",
+"0$ c #40641B",
+"a$ c #466E1E",
+"b$ c #48731E",
+"c$ c #4D7921",
+"d$ c #4F7F21",
+"e$ c #4F821F",
+"f$ c #518421",
+"g$ c #538622",
+"h$ c #538723",
+"i$ c #548722",
+"j$ c #548724",
+"k$ c #548723",
+"l$ c #558320",
+"m$ c #538122",
+"n$ c #517E24",
+"o$ c #4D7926",
+"p$ c #477326",
+"q$ c #416B22",
+"r$ c #3B661D",
+"s$ c #376117",
+"t$ c #39611C",
+"u$ c #50772D",
+"v$ c #63893A",
+"w$ c #60833A",
+"x$ c #405E25",
+"y$ c #547633",
+"z$ c #628A33",
+"A$ c #628A32",
+"B$ c #608833",
+"C$ c #638832",
+"D$ c #4E6E28",
+"E$ c #436023",
+"F$ c #608038",
+"G$ c #638835",
+"H$ c #5C8334",
+"I$ c #446720",
+"J$ c #375A16",
+"K$ c #3B5F1C",
+"L$ c #3F6420",
+"M$ c #42681E",
+"N$ c #486F1E",
+"O$ c #49761E",
+"P$ c #497A21",
+"Q$ c #4C7D21",
+"R$ c #4E8022",
+"S$ c #508122",
+"T$ c #518222",
+"U$ c #528423",
+"V$ c #518322",
+"W$ c #518324",
+"X$ c #518323",
+"Y$ c #4F811C",
+"Z$ c #50821B",
+"`$ c #50821D",
+" % c #50821F",
+".% c #508221",
+"+% c #4F811F",
+"@% c #4F8020",
+"#% c #517B21",
+"$% c #4F7921",
+"%% c #4C7522",
+"&% c #497122",
+"*% c #41691F",
+"=% c #3E651E",
+"-% c #385F19",
+";% c #355D11",
+">% c #436A1E",
+",% c #5C8132",
+"'% c #618535",
+")% c #5D7C33",
+"!% c #405C1F",
+"~% c #52732C",
+"{% c #618A33",
+"]% c #5D8630",
+"^% c #5E8630",
+"/% c #5E8530",
+"(% c #5C832F",
+"_% c #608330",
+":% c #4E6A28",
+"<% c #425B22",
+"[% c #5F7C35",
+"}% c #5E832E",
+"|% c #5D8432",
+"1% c #517829",
+"2% c #3B6016",
+"3% c #355917",
+"4% c #385C1C",
+"5% c #3D611B",
+"6% c #40661C",
+"7% c #426C1C",
+"8% c #42711E",
+"9% c #45751F",
+"0% c #487820",
+"a% c #4A7A20",
+"b% c #4C7C1F",
+"c% c #4D7E21",
+"d% c #4D7E22",
+"e% c #4B7E18",
+"f% c #4B7E17",
+"g% c #4B7E19",
+"h% c #4B7D1B",
+"i% c #4B7C1D",
+"j% c #497A1E",
+"k% c #49781D",
+"l% c #4B721F",
+"m% c #49701F",
+"n% c #466C1E",
+"o% c #3C611B",
+"p% c #3B601B",
+"q% c #365B16",
+"r% c #3E6516",
+"s% c #537929",
+"t% c #5E8230",
+"u% c #608031",
+"v% c #5A792F",
+"w% c #415B1A",
+"x% c #507027",
+"y% c #59812B",
+"z% c #577E2A",
+"A% c #5A7E2B",
+"B% c #496523",
+"C% c #3E561E",
+"D% c #5A7731",
+"E% c #597F29",
+"F% c #59812C",
+"G% c #577E29",
+"H% c #4C7322",
+"I% c #395D15",
+"J% c #335815",
+"K% c #355915",
+"L% c #375C17",
+"M% c #386018",
+"N% c #3B6717",
+"O% c #3E6B1A",
+"P% c #416E1A",
+"Q% c #43711C",
+"R% c #46731B",
+"S% c #47751A",
+"T% c #48761C",
+"U% c #48771D",
+"V% c #467716",
+"W% c #467614",
+"X% c #467617",
+"Y% c #467518",
+"Z% c #457318",
+"`% c #43711A",
+" & c #416E19",
+".& c #42681D",
+"+& c #3F651B",
+"@& c #3C611A",
+"#& c #3A5F1A",
+"$& c #385C19",
+"%& c #345817",
+"&& c #395E1A",
+"*& c #4D7425",
+"=& c #5A8031",
+"-& c #5A7E2C",
+";& c #5C7D2D",
+">& c #57752C",
+",& c #3D5817",
+"'& c #4C6C24",
+")& c #59812A",
+"!& c #567E28",
+"~& c #557D28",
+"{& c #537B27",
+"]& c #567A27",
+"^& c #466120",
+"/& c #3B541B",
+"(& c #57742E",
+"_& c #567C26",
+":& c #567D28",
+"<& c #537C22",
+"[& c #537A24",
+"}& c #486E1E",
+"|& c #375D14",
+"1& c #315612",
+"2& c #305415",
+"3& c #325916",
+"4& c #355E14",
+"5& c #386217",
+"6& c #3A6417",
+"7& c #3E6819",
+"8& c #3F6A18",
+"9& c #416C17",
+"0& c #436E1A",
+"a& c #446F1B",
+"b& c #436F1B",
+"c& c #456F1C",
+"d& c #456F1D",
+"e& c #426F16",
+"f& c #436F16",
+"g& c #426D16",
+"h& c #416D19",
+"i& c #406A18",
+"j& c #3C6619",
+"k& c #395D1A",
+"l& c #355A17",
+"m& c #325714",
+"n& c #325614",
+"o& c #385D1B",
+"p& c #496E29",
+"q& c #557C2D",
+"r& c #567C2D",
+"s& c #557927",
+"t& c #58792A",
+"u& c #547128",
+"v& c #3B5615",
+"w& c #496920",
+"x& c #557E28",
+"y& c #517923",
+"z& c #527A24",
+"A& c #517924",
+"B& c #507623",
+"C& c #547724",
+"D& c #435F1D",
+"E& c #3A531A",
+"F& c #55722C",
+"G& c #537923",
+"H& c #537A25",
+"I& c #517822",
+"J& c #527A22",
+"K& c #507822",
+"L& c #486E1F",
+"M& c #395E15",
+"N& c #2F5311",
+"O& c #2F5412",
+"P& c #315813",
+"Q& c #335A15",
+"R& c #365D16",
+"S& c #375F15",
+"T& c #396015",
+"U& c #3B6214",
+"V& c #3C6416",
+"W& c #3D6517",
+"X& c #3F6719",
+"Y& c #3F6716",
+"Z& c #3D6616",
+"`& c #3C6415",
+" * c #3A6217",
+".* c #395F17",
+"+* c #385E17",
+"@* c #345818",
+"#* c #325615",
+"$* c #2D510F",
+"%* c #2E530F",
+"&* c #395E18",
+"** c #486D26",
+"=* c #51762E",
+"-* c #52782A",
+";* c #527828",
+">* c #547726",
+",* c #547626",
+"'* c #516F25",
+")* c #395313",
+"!* c #45661E",
+"~* c #527A23",
+"{* c #4D751F",
+"]* c #4D751E",
+"^* c #4C7320",
+"/* c #517421",
+"(* c #405C1A",
+"_* c #375017",
+":* c #516E28",
+"<* c #4F741F",
+"[* c #4E7523",
+"}* c #4C7424",
+"|* c #4D7521",
+"1* c #4D751D",
+"2* c #486F1F",
+"3* c #3B6017",
+"4* c #2F5411",
+"5* c #2C5011",
+"6* c #2C500F",
+"7* c #305511",
+"8* c #315611",
+"9* c #335810",
+"0* c #345A0F",
+"a* c #355B11",
+"b* c #355B12",
+"c* c #375D13",
+"d* c #375D12",
+"e* c #355B10",
+"f* c #345A12",
+"g* c #335812",
+"h* c #315512",
+"i* c #2F5413",
+"j* c #2E5212",
+"k* c #2D5210",
+"l* c #2C510D",
+"m* c #30550F",
+"n* c #3C6219",
+"o* c #466D20",
+"p* c #4C7324",
+"q* c #4D7325",
+"r* c #4C7325",
+"s* c #4E7324",
+"t* c #4F7321",
+"u* c #517224",
+"v* c #4E6C22",
+"w* c #36500F",
+"x* c #42631A",
+"y* c #4A721C",
+"z* c #4A711B",
+"A* c #4A701D",
+"B* c #4D711E",
+"C* c #3C5A16",
+"D* c #334D12",
+"E* c #4D6B23",
+"F* c #4A6F1A",
+"G* c #4A701E",
+"H* c #4A7024",
+"I* c #4A701F",
+"J* c #4A7119",
+"K* c #487017",
+"L* c #4B721C",
+"M* c #476E1E",
+"N* c #40661F",
+"O* c #385A1D",
+"P* c #2E5112",
+"Q* c #2D500F",
+"R* c #2B500B",
+"S* c #2C500B",
+"T* c #2E530B",
+"U* c #2E520B",
+"V* c #2E520C",
+"W* c #2D520B",
+"X* c #2F540D",
+"Y* c #30540E",
+"Z* c #30540D",
+"`* c #2F530D",
+" = c #2E510B",
+".= c #2C4F0B",
+"+= c #2C500D",
+"@= c #2D5010",
+"#= c #2C4E11",
+"$= c #2B4F10",
+"%= c #305510",
+"&= c #395E17",
+"*= c #43691F",
+"== c #476E20",
+"-= c #476E1D",
+";= c #49701B",
+">= c #4A711D",
+",= c #4A6F22",
+"'= c #497020",
+")= c #4B701D",
+"!= c #4E701F",
+"~= c #4B6920",
+"{= c #324E0C",
+"]= c #3F6116",
+"^= c #49721B",
+"/= c #476F19",
+"(= c #466E18",
+"_= c #476F1A",
+":= c #476E19",
+"<= c #385E0E",
+"[= c #2E5406",
+"}= c #446B18",
+"|= c #436B15",
+"1= c #456D18",
+"2= c #476D1B",
+"3= c #476F18",
+"4= c #476E1F",
+"5= c #446A21",
+"6= c #3D621A",
+"7= c #385D14",
+"8= c #30550C",
+"9= c #2D5109",
+"0= c #2A4F05",
+"a= c #284D09",
+"b= c #294D0C",
+"c= c #294D0A",
+"d= c #294D0B",
+"e= c #2B4F0D",
+"f= c #294F08",
+"g= c #294D08",
+"h= c #294E07",
+"i= c #284D07",
+"j= c #325612",
+"k= c #416816",
+"l= c #446C19",
+"m= c #476E1A",
+"n= c #476D19",
+"o= c #466F18",
+"p= c #486F19",
+"q= c #436917",
+"r= c #2E5304",
+"s= c #3A600E",
+"t= c #416913",
+"u= c #406812",
+"v= c #3C640E",
+"w= c #426A14",
+"x= c #436B14",
+"y= c #426A17",
+"z= c #42681B",
+"A= c #41671A",
+"B= c #3D6316",
+"C= c #385E10",
+"D= c #2C520C",
+"E= c #2B500A",
+"F= c #2E530D",
+"G= c #2E5409",
+"H= c #31560C",
+"I= c #3A5F14",
+"J= c #3D6317",
+"K= c #40661A",
+"L= c #42691C",
+"M= c #3B630E",
+"N= c #3E6610",
+"O= c #3F6710",
+"P= c #3F6711",
+"Q= c #3E6714",
+"R= c #3F6617",
+"S= c #3D6415",
+"T= c #406718",
+"U= c #406618",
+"V= c #3E6616",
+"W= c #3E6515",
+"X= c #3B6212",
+"Y= c #3B6111",
+"Z= c #3D6314",
+"`= c #3D6214",
+" - c #3D6412",
+".- c #3E6413",
+"+- c #406715",
+"@- c #3E6713",
+"#- c #3F6714",
+"$- c #406614",
+"%- c #406811",
+"&- c #3D650F",
+"*- c #3B630D",
+"=- c #3B630F",
+"-- c #3B6211",
+";- c #3D6414",
+">- c #3E6514",
+",- c #3C6312",
+"'- c #3D650C",
+")- c #3D650D",
+"!- c #3D640C",
+"~- c #3D650E",
+"{- c #3E660E",
+"]- c #3E660D",
+"^- c #3E660F",
+"/- c #3A620C",
+"(- c #3B620D",
+"_- c #3B620F",
+":- c #3B610B",
+"<- c #3B630A",
+"[- c #3B630B",
+"}- c #375F09",
+"|- c #375F0A",
+"1- c #375F08",
+"2- c #375F07",
+"3- c #375F0B",
+"4- c #345C06",
+"5- c #345C07",
+"6- c #335C07",
+"7- c #355C07",
+"8- c #355C05",
+"9- c #355C04",
+"0- c #355C06",
+"a- c #355A09",
+"b- c #355B0A",
+"c- c #355B09",
+"d- c #355B06",
+"e- c #355D06",
+"f- c #335C06",
+"g- c #2E5704",
+"h- c #305804",
+"i- c #305806",
+"j- c #305906",
+"k- c #305704",
+"l- c #305805",
+"m- c #325605",
+"n- c #335705",
+"o- c #335605",
+"p- c #325604",
+"q- c #345806",
+"r- c #355807",
+"s- c #335706",
+"t- c #335704",
+"u- c #335505",
+"v- c #325606",
+"w- c #345906",
+"x- c #335805",
+"y- c #325903",
+"z- c #325B01",
+"A- c #325B02",
+"B- c #315A02",
+"C- c #2F5800",
+"D- c #305901",
+"E- c #305900",
+"F- c #335503",
+"G- c #355305",
+"H- c #355404",
+"I- c #2D5601",
+"J- c #2E5702",
+"K- c #2F5703",
+"L- c #305904",
+"M- c #2F5804",
+"N- c #315502",
+"O- c #325603",
+"P- c #315503",
+"Q- c #315602",
+"R- c #305503",
+"S- c #315504",
+"T- c #305404",
+"U- c #325704",
+"V- c #315704",
+"W- c #325502",
+"X- c #305602",
+"Y- c #315900",
+"Z- c #315901",
+"`- c #305701",
+" ; c #2E5700",
+".; c #2F5700",
+"+; c #2E5600",
+"@; c #315500",
+"#; c #335501",
+"$; c #335500",
+"%; c #737E40",
+"&; c #737D40",
+"*; c #717D3E",
+"=; c #727C3F",
+"-; c #727D40",
+";; c #747B3F",
+">; c #757C40",
+",; c #73793D",
+"'; c #71793D",
+"); c #72793D",
+"!; c #71793C",
+"~; c #737A3E",
+"{; c #71783C",
+"]; c #70773B",
+"^; c #71773C",
+"/; c #757C3F",
+"(; c #747B3E",
+"_; c #737C3C",
+":; c #737D39",
+"<; c #737D3A",
+"[; c #727B39",
+"}; c #707B38",
+"|; c #717B38",
+"1; c #717B37",
+"2; c #717A36",
+"3; c #CAAE84",
+"4; c #C9AE83",
+"5; c #C7AB80",
+"6; c #C3A77D",
+"7; c #C4A97D",
+"8; c #C6AA80",
+"9; c #C5A97E",
+"0; c #C9AA80",
+"a; c #CAAA81",
+"b; c #C9A980",
+"c; c #C6A67D",
+"d; c #C6A57C",
+"e; c #C8A87F",
+"f; c #C9AA81",
+"g; c #C7A77E",
+"h; c #C3A37A",
+"i; c #BF9F76",
+"j; c #C1A178",
+"k; c #C3A379",
+"l; c #C2A179",
+"m; c #C0A077",
+"n; c #C2A279",
+"o; c #C09F77",
+"p; c #C0A177",
+"q; c #C4A47B",
+"r; c #C6A67C",
+"s; c #C5A67C",
+"t; c #CBAB82",
+"u; c #CCAB81",
+"v; c #CCAB82",
+"w; c #CAAB81",
+"x; c #C8A77E",
+"y; c #C5A57C",
+"z; c #C7A67D",
+"A; c #C7A87F",
+"B; c #C9A97F",
+"C; c #C9A87F",
+"D; c #C4A37B",
+"E; c #C4A478",
+"F; c #C2A273",
+"G; c #C3A375",
+"H; c #C4A475",
+"I; c #C0A172",
+"J; c #C1A171",
+"K; c #C1A173",
+"L; c #C1A373",
+"M; c #C2A374",
+"N; c #C2A373",
+"O; c #CC9F6B",
+"P; c #D0A370",
+"Q; c #D0A36F",
+"R; c #CB9E6B",
+"S; c #CDA06C",
+"T; c #CCA06C",
+"U; c #CE9C69",
+"V; c #CC9A67",
+"W; c #C99765",
+"X; c #CB9966",
+"Y; c #C79664",
+"Z; c #C49260",
+"`; c #C89764",
+" > c #CA9965",
+".> c #C89765",
+"+> c #C79563",
+"@> c #C2915E",
+"#> c #C08F5C",
+"$> c #C3925F",
+"%> c #BF8F5B",
+"&> c #BD8B59",
+"*> c #C3915F",
+"=> c #C69462",
+"-> c #C89664",
+";> c #CB9A67",
+">> c #CB9968",
+",> c #CB9B67",
+"'> c #CD9C69",
+")> c #CD9B68",
+"!> c #CE9D6A",
+"~> c #CE9C6A",
+"{> c #CA9866",
+"]> c #C69562",
+"^> c #C1905D",
+"/> c #C2905E",
+"(> c #C69461",
+"_> c #CA9966",
+":> c #C59461",
+"<> c #C5935F",
+"[> c #C28F59",
+"}> c #C3915A",
+"|> c #C7945E",
+"1> c #C5935D",
+"2> c #C08E58",
+"3> c #BC8853",
+"4> c #BB8654",
+"5> c #BB8655",
+"6> c #BA8655",
+"7> c #BC8A4B",
+"8> c #C1904F",
+"9> c #BF8D4D",
+"0> c #C19050",
+"a> c #C29050",
+"b> c #BE8C4C",
+"c> c #C28D4E",
+"d> c #C18A4C",
+"e> c #BD8649",
+"f> c #BD8749",
+"g> c #BB8547",
+"h> c #B78142",
+"i> c #B88244",
+"j> c #B68042",
+"k> c #B98244",
+"l> c #BB8447",
+"m> c #BC8648",
+"n> c #BA8446",
+"o> c #BE874A",
+"p> c #BD8648",
+"q> c #B68041",
+"r> c #B98445",
+"s> c #BA8445",
+"t> c #B88245",
+"u> c #B98344",
+"v> c #BE8749",
+"w> c #C08A4C",
+"x> c #BF894B",
+"y> c #BE894B",
+"z> c #C0894B",
+"A> c #BF884A",
+"B> c #BA8546",
+"C> c #B78143",
+"D> c #B88345",
+"E> c #BA8346",
+"F> c #B78144",
+"G> c #BA8345",
+"H> c #BB8546",
+"I> c #BB8446",
+"J> c #BE884A",
+"K> c #BD8546",
+"L> c #BC8342",
+"M> c #BD8443",
+"N> c #C08646",
+"O> c #BB8342",
+"P> c #B67C3B",
+"Q> c #AA702F",
+"R> c #A76830",
+"S> c #A4622F",
+"T> c #A3622F",
+"U> c #B78145",
+"V> c #C58E52",
+"W> c #BF874B",
+"X> c #BC8347",
+"Y> c #B98345",
+"Z> c #B88344",
+"`> c #B88146",
+" , c #B98146",
+"., c #B98045",
+"+, c #B98046",
+"@, c #BB8348",
+"#, c #BA8046",
+"$, c #B97E44",
+"%, c #BB7F45",
+"&, c #B87D43",
+"*, c #B87C42",
+"=, c #B67B41",
+"-, c #B5793E",
+";, c #B3783E",
+">, c #B2773C",
+",, c #B07539",
+"', c #AD7236",
+"), c #AD7136",
+"!, c #AA6E33",
+"~, c #AD7237",
+"{, c #AE7336",
+"], c #AD7135",
+"^, c #B67B3F",
+"/, c #B87E41",
+"(, c #B67C3F",
+"_, c #B77C40",
+":, c #B77D3F",
+"<, c #B67D41",
+"[, c #B87F42",
+"}, c #B98043",
+"|, c #BA8144",
+"1, c #BF8449",
+"2, c #BD8248",
+"3, c #BF8349",
+"4, c #BE8348",
+"5, c #BB8145",
+"6, c #B67C40",
+"7, c #B4793C",
+"8, c #B77B3F",
+"9, c #BA7E42",
+"0, c #BC8044",
+"a, c #BB7F43",
+"b, c #BC8145",
+"c, c #B97D41",
+"d, c #B6783A",
+"e, c #B67636",
+"f, c #B67738",
+"g, c #B97A3B",
+"h, c #BD7D3F",
+"i, c #B9783B",
+"j, c #AE6E31",
+"k, c #AB6330",
+"l, c #A95E2F",
+"m, c #A95C2D",
+"n, c #A6733B",
+"o, c #BD874F",
+"p, c #C48852",
+"q, c #B98044",
+"r, c #BD8A4B",
+"s, c #C39252",
+"t, c #C59557",
+"u, c #C59457",
+"v, c #C49255",
+"w, c #C79256",
+"x, c #C99257",
+"y, c #C38B51",
+"z, c #C58A51",
+"A, c #C48853",
+"B, c #C48851",
+"C, c #C38752",
+"D, c #C18650",
+"E, c #BD814B",
+"F, c #BA7F48",
+"G, c #B97E46",
+"H, c #B87D45",
+"I, c #B47941",
+"J, c #B57A42",
+"K, c #B2773F",
+"L, c #B37840",
+"M, c #B87D41",
+"N, c #BB8044",
+"O, c #BE8347",
+"P, c #BF8448",
+"Q, c #BA7F43",
+"R, c #B27C3E",
+"S, c #B47E40",
+"T, c #B58042",
+"U, c #B68142",
+"V, c #B68143",
+"W, c #B98346",
+"X, c #C18551",
+"Y, c #C28651",
+"Z, c #C0844E",
+"`, c #BD8149",
+" ' c #BC8147",
+".' c #B57A3E",
+"+' c #BB7E43",
+"@' c #BF8045",
+"#' c #C28449",
+"$' c #BF8247",
+"%' c #C08348",
+"&' c #BD7F40",
+"*' c #BD803A",
+"=' c #BC7F3D",
+"-' c #BE8140",
+";' c #BB7E3F",
+">' c #B4763A",
+",' c #AE6F34",
+"'' c #B06E35",
+")' c #B67239",
+"!' c #B26F36",
+"~' c #7F5123",
+"{' c #9C6A3D",
+"]' c #B2794B",
+"^' c #B27541",
+"/' c #B87B44",
+"(' c #BE864A",
+"_' c #C28D4D",
+":' c #C18C49",
+"<' c #BC8643",
+"[' c #BC8441",
+"}' c #BE8141",
+"|' c #C08243",
+"1' c #C18343",
+"2' c #BF8041",
+"3' c #BC8144",
+"4' c #BD8244",
+"5' c #BD8144",
+"6' c #BC8143",
+"7' c #BB8042",
+"8' c #B97E42",
+"9' c #BA7F47",
+"0' c #BD8249",
+"a' c #C0854D",
+"b' c #C2874F",
+"c' c #C38850",
+"d' c #C78C51",
+"e' c #C88D51",
+"f' c #C4894D",
+"g' c #C08549",
+"h' c #BD8246",
+"i' c #BB8144",
+"j' c #B77D41",
+"k' c #BE8448",
+"l' c #BE8446",
+"m' c #BD8348",
+"n' c #C0844F",
+"o' c #C18550",
+"p' c #BE824B",
+"q' c #BF844A",
+"r' c #C1874B",
+"s' c #C18749",
+"t' c #C08546",
+"u' c #BF8145",
+"v' c #C08246",
+"w' c #C08245",
+"x' c #C48649",
+"y' c #C4864A",
+"z' c #C48646",
+"A' c #C38742",
+"B' c #C58946",
+"C' c #CA8D4C",
+"D' c #C18447",
+"E' c #B7793D",
+"F' c #B07237",
+"G' c #B27641",
+"H' c #B67A48",
+"I' c #B27644",
+"J' c #6C4321",
+"K' c #744522",
+"L' c #8F5933",
+"M' c #96592D",
+"N' c #A0612F",
+"O' c #AF7137",
+"P' c #BD8245",
+"Q' c #BF8C4D",
+"R' c #BF8A4B",
+"S' c #BA8043",
+"T' c #C18649",
+"U' c #C38549",
+"V' c #C38647",
+"W' c #C08444",
+"X' c #BD8141",
+"Y' c #BC803F",
+"Z' c #BD7F3F",
+"`' c #BE8142",
+" ) c #BC8142",
+".) c #BB8045",
+"+) c #B87D42",
+"@) c #C2874B",
+"#) c #C1864A",
+"$) c #B2773B",
+"%) c #B6783D",
+"&) c #B07136",
+"*) c #B07036",
+"=) c #B3743A",
+"-) c #B5763B",
+";) c #B7783D",
+">) c #B7793F",
+",) c #B47742",
+"') c #B77C45",
+")) c #B77C43",
+"!) c #BA7F44",
+"~) c #BD8345",
+"{) c #BD8344",
+"]) c #BA8040",
+"^) c #BA7D3E",
+"/) c #B67A3A",
+"() c #B47638",
+"_) c #B87B3C",
+":) c #BB7D3F",
+"<) c #BA7C3F",
+"[) c #B97C3B",
+"}) c #B67937",
+"|) c #B37636",
+"1) c #B5773A",
+"2) c #AD6F34",
+"3) c #A96B32",
+"4) c #A4662E",
+"5) c #986132",
+"6) c #A16E42",
+"7) c #A06C41",
+"8) c #583012",
+"9) c #633515",
+"0) c #76401E",
+"a) c #8C4E26",
+"b) c #9A5A2A",
+"c) c #AE6F37",
+"d) c #B3763A",
+"e) c #AC7C34",
+"f) c #B18038",
+"g) c #B17D37",
+"h) c #AD7630",
+"i) c #AA722C",
+"j) c #A8702A",
+"k) c #A96D2B",
+"l) c #AF6E35",
+"m) c #B37339",
+"n) c #B6753C",
+"o) c #B9793E",
+"p) c #BB7A42",
+"q) c #BD7F44",
+"r) c #BD8445",
+"s) c #C3884A",
+"t) c #C48A4B",
+"u) c #C58B4C",
+"v) c #C78C4E",
+"w) c #CA8F53",
+"x) c #C98E52",
+"y) c #C78C50",
+"z) c #C68B4F",
+"A) c #C58A4E",
+"B) c #C8884D",
+"C) c #C5854A",
+"D) c #C28248",
+"E) c #C07E45",
+"F) c #BE7D43",
+"G) c #BB7A40",
+"H) c #BE7E45",
+"I) c #C0854C",
+"J) c #C2874C",
+"K) c #C08648",
+"L) c #C28849",
+"M) c #C18745",
+"N) c #BC823F",
+"O) c #BD803F",
+"P) c #BB7E3D",
+"Q) c #B77A3A",
+"R) c #B87B3B",
+"S) c #B67939",
+"T) c #B57837",
+"U) c #B47739",
+"V) c #BA7C40",
+"W) c #B97A42",
+"X) c #B0723B",
+"Y) c #955621",
+"Z) c #824C21",
+"`) c #814F27",
+" ! c #835129",
+".! c #5F3210",
+"+! c #6E3D19",
+"@! c #804722",
+"#! c #905128",
+"$! c #945626",
+"%! c #A16530",
+"&! c #A76E36",
+"*! c #B57B3D",
+"=! c #BD8243",
+"-! c #BD8042",
+";! c #BE7D40",
+">! c #C07E41",
+",! c #C47F43",
+"'! c #C57F45",
+")! c #C17D47",
+"!! c #C17F48",
+"~! c #C07D46",
+"{! c #BF7D46",
+"]! c #BC7943",
+"^! c #B8753F",
+"/! c #AE7535",
+"(! c #AF7535",
+"_! c #B17737",
+":! c #B37939",
+"<! c #AF7635",
+"[! c #A76D2D",
+"}! c #A66C2E",
+"|! c #A66B2F",
+"1! c #A3682C",
+"2! c #A06529",
+"3! c #A4692D",
+"4! c #A96E32",
+"5! c #A76C30",
+"6! c #A86C31",
+"7! c #A3672B",
+"8! c #A2662A",
+"9! c #A16528",
+"0! c #A16529",
+"a! c #A66A2E",
+"b! c #A76C31",
+"c! c #AD7335",
+"d! c #B07636",
+"e! c #B07734",
+"f! c #AE7530",
+"g! c #AD732E",
+"h! c #AF722E",
+"i! c #AA6E2A",
+"j! c #A76A27",
+"k! c #AA6D2A",
+"l! c #A86B2A",
+"m! c #AB6D2F",
+"n! c #A6682D",
+"o! c #A06229",
+"p! c #A66731",
+"q! c #A96A35",
+"r! c #A96A37",
+"s! c #9D6237",
+"t! c #7F451D",
+"u! c #7F451C",
+"v! c #9B693F",
+"w! c #A36E43",
+"x! c #9C6136",
+"y! c #9F6234",
+"z! c #9C5F2F",
+"A! c #8C5521",
+"B! c #AA7640",
+"C! c #AF743F",
+"D! c #A86A36",
+"E! c #A2632E",
+"F! c #A2602D",
+"G! c #A6612E",
+"H! c #A6602D",
+"I! c #A25B27",
+"J! c #A15E20",
+"K! c #A05D1E",
+"L! c #A36121",
+"M! c #A25F20",
+"N! c #9D5B1C",
+"O! c #A26021",
+"P! c #AC6D2D",
+"Q! c #B17836",
+"R! c #B87F3C",
+"S! c #BB823F",
+"T! c #BE8543",
+"U! c #BE8542",
+"V! c #C08744",
+"W! c #C28749",
+"X! c #C3884D",
+"Y! c #CB9054",
+"Z! c #CC9155",
+"`! c #CE9357",
+" ~ c #CB9457",
+".~ c #CA9356",
+"+~ c #C89153",
+"@~ c #C48D4F",
+"#~ c #C48D50",
+"$~ c #C1894C",
+"%~ c #BC8244",
+"&~ c #BF8545",
+"*~ c #BA803E",
+"=~ c #B57C37",
+"-~ c #B67D36",
+";~ c #B87F38",
+">~ c #BA7E38",
+",~ c #B97D37",
+"'~ c #B57933",
+")~ c #B67A34",
+"!~ c #BD813B",
+"~~ c #C1853F",
+"{~ c #C18443",
+"]~ c #C6884D",
+"^~ c #CB8D52",
+"/~ c #CD8E56",
+"(~ c #CD8E58",
+"_~ c #C0814D",
+":~ c #AA6B39",
+"<~ c #925222",
+"[~ c #8A481A",
+"}~ c #8E4C1D",
+"|~ c #AE7243",
+"1~ c #AC6F3F",
+"2~ c #9C5D2B",
+"3~ c #B27341",
+"4~ c #B37745",
+"5~ c #7F4717",
+"6~ c #996333",
+"7~ c #B48046",
+"8~ c #BC864C",
+"9~ c #BE864C",
+"0~ c #C0874D",
+"a~ c #C1874E",
+"b~ c #BF864D",
+"c~ c #C0844A",
+"d~ c #BD813F",
+"e~ c #BA7D3C",
+"f~ c #BB7F3D",
+"g~ c #BC803E",
+"h~ c #C38644",
+"i~ c #C38A49",
+"j~ c #C48F4D",
+"k~ c #C99353",
+"l~ c #CD9656",
+"m~ c #CD9756",
+"n~ c #C48E4E",
+"o~ c #B98342",
+"p~ c #B78045",
+"q~ c #BA8149",
+"r~ c #B9834B",
+"s~ c #B37D47",
+"t~ c #AE7942",
+"u~ c #AC7741",
+"v~ c #AB7943",
+"w~ c #AC7A44",
+"x~ c #AC7942",
+"y~ c #AA7842",
+"z~ c #A97641",
+"A~ c #AC7944",
+"B~ c #A97640",
+"C~ c #A7713B",
+"D~ c #A9733C",
+"E~ c #BF884F",
+"F~ c #C99356",
+"G~ c #C99553",
+"H~ c #CB9653",
+"I~ c #CB9751",
+"J~ c #CC9351",
+"K~ c #C48D4B",
+"L~ c #C08746",
+"M~ c #C08848",
+"N~ c #C28A4B",
+"O~ c #C38A4C",
+"P~ c #C1884D",
+"Q~ c #BC844E",
+"R~ c #AF7844",
+"S~ c #A46A38",
+"T~ c #9C602E",
+"U~ c #945320",
+"V~ c #97531F",
+"W~ c #A35F26",
+"X~ c #B16B31",
+"Y~ c #B56F34",
+"Z~ c #A86332",
+"`~ c #A6632F",
+" { c #AC6933",
+".{ c #A96933",
+"+{ c #91521F",
+"@{ c #854718",
+"#{ c #8D4F25",
+"${ c #875221",
+"%{ c #85511F",
+"&{ c #84501E",
+"*{ c #8B5625",
+"={ c #925E2D",
+"-{ c #94602E",
+";{ c #8C5826",
+">{ c #895623",
+",{ c #8F5B28",
+"'{ c #8F5C29",
+"){ c #8E5B28",
+"!{ c #8C5725",
+"~{ c #925E2C",
+"{{ c #94612F",
+"]{ c #93602D",
+"^{ c #966331",
+"/{ c #A06E3B",
+"({ c #9E6A38",
+"_{ c #8B5727",
+":{ c #885325",
+"<{ c #845225",
+"[{ c #855428",
+"}{ c #84562B",
+"|{ c #7F532A",
+"1{ c #82562F",
+"2{ c #86562E",
+"3{ c #85542C",
+"4{ c #84532B",
+"5{ c #825129",
+"6{ c #7D4C24",
+"7{ c #77461E",
+"8{ c #6B3912",
+"9{ c #633110",
+"0{ c #653310",
+"a{ c #7B4A22",
+"b{ c #89582C",
+"c{ c #956634",
+"d{ c #9F6F3C",
+"e{ c #9E6F39",
+"f{ c #986A36",
+"g{ c #8A5B28",
+"h{ c #825322",
+"i{ c #865728",
+"j{ c #89592D",
+"k{ c #8C5C30",
+"l{ c #8C5D33",
+"m{ c #8A5D32",
+"n{ c #8A5D34",
+"o{ c #8E5D31",
+"p{ c #9A6232",
+"q{ c #AB6A31",
+"r{ c #B56E2F",
+"s{ c #BC7631",
+"t{ c #BF7B34",
+"u{ c #BF7B35",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+". . . . . . + @ # $ % & * = - ; ; > , , ' ) ) ) ) ! ~ { { ] ^ / ( / ^ { { { { { { { { { ( ( ( ( _ : < [ } | 1 2 2 2 . . . . . . ",
+"3 4 4 4 4 4 5 6 7 8 9 0 a b c d d d d d d e e e f g h i j k l m m n o p p p p p p p p p q r m s t u v w x y z A A B 5 4 4 4 4 5 ",
+"C D D D E E F G H I J K L M N O P Q R R R S S S T U V W X Y Z ` ...+.@.@.@.@.@.@.@.@.#.$. .` %.&.*.=.-.;.>.,.'.'.).!.D ~.E E F ",
+"{.].].^././.(._.:.<.[.}.|.1.2.3.4.5.6.6.7.7.7.8.9.0.a.b.c.d.e.f.g.h.i.j.j.j.j.j.j.j.j.j.k.g.l.m.n.o.p.q.r.s.t.u.u.v.w.].].]./.].",
+"x.y.y.y.z.z.A.B.C.D.E.F.G.H.I.J.K.L.M.M.N.N.N.N.N.O.P.Q.R.S.T.U.V.W.X.Y.Y.Y.Y.Y.Y.Y.Y.X.Z.`. +.+++@+#+$+%+&+*+z.z.=+-+y.-+;+z.u.",
+">+,+,+,+'+'+)+!+~+{+]+^+/+(+_+:+<+[+}+}+|+1+2+3+4+3+5+6+7+8+9+0+a+b+c+c+c+c+c+c+c+c+c+c+d+e+f+g+h+i+j+k+l+m+n+'+'+o+p+,+p+o+'+'+",
+"q+q+q+r+s+s+t+u+v+w+x+y+z+A+B+C+D+E+F+G+H+I+I+I+J+K+L+M+N+O+P+Q+R+S+T+T+T+T+T+T+U+V+W+X+Y+Z+`+ @.@+@@@#@$@%@&@t+t+*@=@r+=@*@s+*@",
+"-@;@;@;@;@;@>@,@'@)@!@~@{@]@^@/@(@_@:@<@[@}@|@1@2@3@3@3@3@3@3@4@4@5@6@7@7@7@7@7@8@9@T+0@a@b@c@d@e@f@g@h@n.i@j@!.!.!.!.!.k@l@m@;@",
+"n@o@o@o@o@o@p@q@r@s@t@u@v@w@x@y@z@A@B@C@D@E@F@E@G@G@G@G@G@G@H@I@J@K@L@M@M@M@M@M@L@N@O@P@Q@R@S@T@U@V@W@X@Y@Z@`@ # # # # #.#+#@#p@",
+"##$#$#$#$#$#%#%#&#*#=#-#;#>#,#'#)#!#~#{#]#^#/#/#(#(#(#(#(#(#_#:#<#[#}#|#|#|#|#|#1#2#3#4#5#6#7#8#9#0#a#b#c#d#e#f#f#f#f#f#f#$#$#$#",
+"g#h#h#h#h#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y#z#A#A#A#A#A#A#A#A#A#B#C#C#C#C#C#C#D#E#F#G#H#I#J#K#L#M#N#O#P#Q#R#h#h#h#h#h#h#h#h#S#",
+"T#U#U#U#U#U#U#V#W#X#Y#Z#`# $.$+$@$#$$$%$&$*$=$-$;$;$;$;$;$;$;$;$;$;$;$;$;$;$;$;$>$,$'$)$!$~${$]$^$/$($_$:$<$[$U#U#U#U#U#U#U#U#U#",
+"}$}$}$}$}$}$|$1$2$3$4$5$6$7$8$9$0$a$b$c$d$e$f$g$h$i$j$j$j$j$j$j$j$k$k$k$k$k$k$k$g$l$m$n$o$p$q$r$s$t$u$v$w$x$y$}$}$}$}$}$}$}$}$}$",
+"z$A$z$z$z$z$A$B$C$D$E$F$G$H$I$J$K$L$M$N$O$P$Q$R$S$T$U$V$W$W$W$W$W$X$Y$Z$`$ %.%+%@%#%$%%%&%*%=%-%;%>%,%'%)%!%~%z$z$z$z$z$z$z$A${%",
+"]%^%^%^%^%^%/%(%_%:%<%[%}%|%1%2%3%4%5%6%7%8%9%0%a%b%c%c%d%d%d%d%d%c%e%f%g%h%i%j%k%l%m%n%6%o%p%q%r%s%t%u%v%w%x%^%^%^%^%^%^%^%^%^%",
+"y%y%y%y%y%y%y%z%A%B%C%D%E%F%G%H%I%J%K%L%M%N%O%P%Q%R%S%T%U%U%U%U%U%U%V%W%X%Y%Z%`% &.&+&@&#&$&%&&&*&=&-&;&>&,&'&y%y%y%y%y%y%y%)&F%",
+"!&!&!&!&!&!&~&{&]&^&/&(&_&:&<&[&}&|&1&2&3&4&5&6&7&8&9&0&a&a&b&c&d&c&e&f&g&h&i&7&j&K$k&l&m&n&o&p&q&r&s&t&u&v&w&!&!&!&!&!&!&!&!&x&",
+"y&z&z&z&z&z&A&B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q&R&S&T&U&V&W&W&W&X&X&X&Y&Z&`& *.*+*R&@*#*$*%*&***=*-*;*>*,*'*)*!*z&z&z&z&z&z&z&z&~*",
+"{*{*{*{*{*{*]*^*/*(*_*:*<*[*}*|*1*{*2*3*4*5*6*7*8*9*0*a*b*b*a*c*|&|&d*e*f*g*h*i*j*k*l*m*n*o*p*q*r*s*t*u*v*w*x*{*{*{*{*{*{*{*{*{*",
+"y*y*y*y*y*y*z*A*B*C*D*E*F*G*H*I*J*K*L*M*N*O*P*Q*R*S*T*U*V*V*W*X*Y*Z*`* =.=+=@=#=$=%=&=*===-=;=>=,='=)=!=~={=]=y*y*y*y*y*y*y*y*^=",
+"/=/=/=/=/=/=(=_=:=<=[=}=|=1=2=/=3=3=3=/=4=5=6=7=8=9=0=a=b=c=d=e=e=e=f=g=h=i=S*j=+*k=l=m=:=n=/=3=_=_=o=p=q=r=s=/=/=/=/=/=/=/=/=/=",
+"|=|=|=|=|=|=|=t=|=u=v=t=w=w=|=|=|=|=|=x=y=z=z=z=A=B=C=9*m*D=E=F=F=V*G=H=e*I=J=K=L=|=|=|=|=|=|=|=|=|=|=|=t=M=N=|=|=|=|=|=|=|=|=|=",
+"O=P=P=P=P=P=P=P=P=w=u=P=N=P=P=P=P=P=P=O=Q=R=r%S=T=U=V=R=W=X=Y=Z=Z=`= -.-+-+-@-#-$-%-u=u=N=P=P=P=P=P=P=P=P=u=P=P=P=P=P=P=P=P=P=P=",
+"v=&-&-&-&-&-&-&-N=N=*-&-*-&-&-&-&-&-&-&-=-Y=X=--;->-,-v='-)-!-~-{-{-{-]-^-~-~-~-)-&-N=&-&-&-&-&-&-&-&-&-&-/-v=&-&-&-&-&-&-&-&-v=",
+"*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-(-_-_-_-_-_-_-:-<-<-<-<-<-<-<-[-[-[-[-[-[-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-",
+"}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-|-|-|-|-|-|-1-1-1-1-1-1-2-|-3-3-3-3-3-|-1-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-",
+"4-5-5-5-5-5-6-7-7-7-7-7-7-7-7-7-7-7-7-7-8-8-8-8-8-8-9-0-0-0-0-0-0-8-a-b-b-b-b-b-c-d-7-7-7-7-7-7-7-7-7-7-7-7-d-e-e-4-4-4-f-0-7-0-",
+"g-h-i-j-k-l-l-m-n-n-o-o-o-p-q-r-q-q-q-q-s-t-n-n-n-n-n-u-o-o-u-n-n-n-n-s-s-s-s-s-v-q-r-q-q-w-w-x-o-n-n-n-n-o-y-z-A-B-C-D-E-F-G-H-",
+"I-J-K-L-L-L-M-N-O-O-P-P-P-N-t-n-t-Q-O-O-R-S-S-T-p-U-U-N-P-P-R-O-O-O-O-O-O-O-O-O-N-t-n-t-V-U-U-W-O-O-O-O-O-O-X-Y-Z-`- ;.;+;@;#;$;",
+"%;&;*;=;%;%;-;;;>;>;,;';);!;~;;;~;{;!;!;{;~;~;);];{;^;!;);););/;>;>;>;>;>;>;>;>;(;;;;;;;;;;;;;~;>;>;>;>;>;>;_;:;<;[;};|;|;1;1;2;",
+"3;4;5;6;7;8;9;0;a;a;b;c;d;e;a;f;0;g;h;i;j;k;l;j;m;n;o;p;q;r;s;e;a;t;u;v;v;w;0;b;x;s;y;e;g;z;A;e;A;B;b;C;y;D;E;F;G;H;I;J;K;L;M;N;",
+"O;P;Q;O;R;S;T;U;V;W;X;Y;Z;`; >.>W;+>@>#>$>Z;%>&>%>*>$>@>=>->->;>>>,>'>'>)>!>~>{>]>=>]>*>^>/>$>$>(>`;_>W;:>(><>[>}>|>1>2>3>4>5>6>",
+"7>8>9>0>a>b>b>c>d>e>f>g>h>i>j>k>l>m>n>g>o>p>i>q>g>r>i>g>s>t>u>n>v>w>x>x>y>z>A>B>C>D>g>E>C>F>G>H>g>g>I>p>J>f>K>L>M>N>O>P>Q>R>S>T>",
+"U>V>W>X>I>Y>Z>`> ,.,+,@,#,$,%,&,*,=,-,;,;,>,,,',),!,~,{,],,,^,/,(,_,:,<,[,},|,|,|,1,2,3,4,5,6,7,8,9,0,a,b,c,d,e,f,g,h,i,j,k,l,m,",
+"n,o,p,%,q,r,s,t,u,v,w,x,y,z,A,A,B,C,D,E,F,G,H,I,J,K,L,*,M,N,O,P,Q,_,R,S,T,U,V,F>W,X,Y,Z,`, '/,.'+'@'#'$'%'$'&'*'='-';'>',''')'!'",
+"~'{']'^'/'('_':'<'['}'|'1'2'3'4'5'4'6'7'8'9'0'0'a'b'c'd'e'f'g'P,O,h'i'j'6,Q,k'l'm'n'o'p'q'r's't'u'v'w'v'x'y'z'A'B'C'D'E'F'G'H'I'",
+"J'K'L'M'N'O'P'b>Q'R'E>S'T'U'V'W'X'Y'Z'`' )b,.)+)_,h'O,@)#)h'M,$),,^,%)&)*)=)-);)>),)')))!)~){)])^)/)()_):)<)[)})|)1)2)3)4)5)6)7)",
+"8)9)0)a)b)c)d)e)f)g)h)i)j)k)l)m)m)n)o)p)q)r)t's)t)u)v)w)x)y)y)f'z)A)B)C)D)E)F)G)H)`,I)J)K)L)M)N)O)P)Q)R)R)S)T)|)U)V)W)X)Y)Z)`) !",
+".!+!@!#!$!%!&!*!=!-!;!>!,!'!)!!!~!{!]!^!=)/!(!_!:!<![!}!|!1!2!3!4!5!',6!7!8!9!0!a!b!5!c!d!e!f!g!h!i!i!j!k!k!l!m!n!o!p!q!r!s!t!u!",
+"v!w!x!y!z!A!B!C!D!E!F!G!H!I!J!K!L!M!N!O!P!Q!R!S!T!U!V!W!X!e'x)Y!Z!`! ~.~+~@~c>#~$~h'%~&~*~=~-~;~>~,~'~)~!~~~{~]~^~/~(~_~:~<~[~}~",
+"|~1~2~3~4~5~6~7~8~9~0~a~b~c~d~e~f~='g~h~i~j~k~l~m~n~o~p~q~r~r~s~t~u~v~w~x~y~z~A~B~C~D~E~F~G~H~I~J~K~L~M~N~O~P~Q~R~S~T~U~V~W~X~Y~",
+"Z~`~ {.{+{@{#{${%{&{*{={-{;{>{,{'{){!{;{~{{{]{^{/{({~{_{:{<{[{}{|{1{2{3{4{5{6{7{8{9{0{a{b{c{d{e{f{g{h{i{j{k{l{m{n{o{p{q{r{s{t{u{"};
diff --git a/demos/mobile/qtbubblelevel/main.cpp b/demos/mobile/qtbubblelevel/main.cpp
new file mode 100644
index 0000000..eb66e25
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/main.cpp
@@ -0,0 +1,135 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtDeclarative>
+#include <QtGui>
+#include <QAccelerometer>
+
+#include "accelerometerfilter.h"
+#include "settings.h"
+#include "taskswitcher.h"
+
+// Lock orientation in Symbian
+#ifdef Q_OS_SYMBIAN
+ #include <eikenv.h>
+ #include <eikappui.h>
+ #include <aknenv.h>
+ #include <aknappui.h>
+#endif
+
+QTM_USE_NAMESPACE
+
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+#ifdef Q_OS_SYMBIAN
+ // Lock orientation to landscape in Symbian
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAP_IGNORE(
+ if (appUi)
+ appUi->SetOrientationL(CAknAppUi::EAppUiOrientationLandscape);
+ )
+#endif
+
+ //! [0]
+ QDeclarativeView view;
+ view.setSource(QUrl("qrc:/qml/BubbleLevel.qml"));
+ view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
+ //! [0]
+
+ // ![1]
+ Settings settings;
+
+ QAccelerometer sensor;
+ AccelerometerFilter filter;
+ sensor.addFilter(&filter);
+ //! [1]
+
+ //! [2]
+ QObject *rootObject = dynamic_cast<QObject*>(view.rootObject());
+
+ // Associate Qt / QML signals and slots
+ QObject::connect(rootObject, SIGNAL(saveCorrectionAngle(const QVariant&)),
+ &settings, SLOT(saveCorrectionAngle(const QVariant&)));
+
+ QObject::connect(&filter, SIGNAL(rotationChanged(const QVariant&)),
+ rootObject, SLOT(handleRotation(const QVariant&)));
+
+ QObject::connect(&settings, SIGNAL(correctionAngle(const QVariant&)),
+ rootObject, SLOT(setCorrectionAngle(const QVariant&)));
+
+ QObject::connect((QObject*)view.engine(), SIGNAL(quit()),
+ &app, SLOT(quit()));
+ //! [2]
+
+ //! [3]
+#ifdef Q_WS_MAEMO_5
+ TaskSwitcher taskSwitcher;
+
+ QObject::connect(rootObject, SIGNAL(minimizeApplication()),
+ &taskSwitcher, SLOT(minimizeApplication()));
+
+ // Show the task switcher button
+ rootObject->setProperty("taskSwitcherVisible", true);
+#endif
+ //! [3]
+
+ //! [4]
+ // Read correction factor from permanent storage and emit it to QML side
+ settings.loadAndEmitCorrectionAngle();
+
+ // Begin measuring of the accelerometer sensor
+ sensor.start();
+ //! [4]
+
+ //! [5]
+#if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR)
+ view.setGeometry(QApplication::desktop()->screenGeometry());
+ view.showFullScreen();
+#else
+ view.setGeometry((QRect(100, 100, 800, 480)));
+ view.show();
+#endif
+ //! [5]
+
+ return app.exec();
+}
diff --git a/demos/mobile/qtbubblelevel/qml/BubbleLevel.qml b/demos/mobile/qtbubblelevel/qml/BubbleLevel.qml
new file mode 100644
index 0000000..237b662
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/BubbleLevel.qml
@@ -0,0 +1,225 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: bubbleLevel
+
+ //! [0]
+ // Signaled when task switcher button is pressed
+ signal minimizeApplication()
+
+ // Signaled when correction angle is saved
+ signal saveCorrectionAngle(variant angle)
+
+ // These functions are used as Qt slots
+ function handleRotation(deg) {
+ horTube.rawangle = deg
+ }
+
+ function setCorrectionAngle(deg) {
+ horTube.angleconstant = deg
+ }
+
+ // Used to show the task switcher button in Maemo targets
+ property alias taskSwitcherVisible: taskSwitcher.visible
+ //! [0]
+
+ anchors.fill: parent
+ source: "images/board.png"
+ smooth: true
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: sign.frontSide = true
+ }
+
+ Button {
+ id: taskSwitcher
+
+ anchors {
+ left: parent.left
+ right: horTube.left
+ verticalCenter: horTube.verticalCenter
+ margins: (parent.width - (horTube.x + horTube.width)) / 4
+ }
+
+ height: width
+ source: "images/taskswitcher.png"
+ mouseAreaScale: 2
+ onClicked: bubbleLevel.minimizeApplication()
+ visible: false
+ }
+
+ Button {
+ id: exitButton
+
+ anchors {
+ left: horTube.right
+ right: parent.right
+ verticalCenter: horTube.verticalCenter
+ margins: (parent.width - (horTube.x + horTube.width)) / 4
+ }
+
+ height: width
+ source: "images/exit.png"
+ mouseAreaScale: 2
+ onClicked: Qt.quit()
+ }
+
+ //! [1]
+ Tube {
+ id: horTube
+
+ property real rawangle: 0
+ property real angleconstant: 0
+
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: parent.width * 0.775; height: parent.height * 0.15625
+ deg: rawangle - angleconstant
+ }
+ //! [1]
+
+ Flipable {
+ id: sign
+
+ property bool frontSide: true
+
+ x: parent.width * 0.185; y: parent.height * 0.669
+ width: parent.width * 0.63; height: parent.height * 0.258
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: sign.frontSide = !sign.frontSide
+ z: -1
+ }
+
+ transform: Rotation {
+
+ origin.x: sign.width / 2; origin.y: sign.height / 2
+ axis.x: 1; axis.y: 0; axis.z: 0
+ angle: sign.frontSide ? 0 : 180
+
+ Behavior on angle {
+ RotationAnimation {
+ direction: RotationAnimation.Clockwise
+ easing.type: Easing.InOutCubic; duration: 300
+ }
+ }
+ }
+
+ front: Image {
+ anchors.fill: parent
+ source: "images/signwithtext.png"
+ smooth: true
+ }
+
+ back: Image {
+ anchors.fill: parent
+ source: "images/signblank.png"
+ smooth: true
+
+ Text {
+ id: oldValue
+
+ anchors {
+ left: parent.left; leftMargin: parent.width * 0.10
+ right: saveButton.left; rightMargin: 10
+ verticalCenter: parent.verticalCenter
+ }
+
+ text: "Place the device on a level surface and tap Calibrate."
+ color: "#302020"
+ wrapMode: Text.WordWrap
+ font { bold: false; pixelSize: Math.min(parent.width, parent.height) * 0.19 }
+ }
+
+ Button {
+ id: saveButton
+
+ anchors {
+ right: parent.right; rightMargin: parent.width * 0.09
+ verticalCenter: parent.verticalCenter
+ }
+
+ width: parent.width * 0.25; height: parent.height * 0.65
+ border { width: 2; color: "#555555" }
+ radius: 10
+
+ onClicked: {
+ horTube.angleconstant = horTube.rawangle
+ saveCorrectionAngle(horTube.angleconstant)
+ }
+
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#999999" }
+ GradientStop { position: 0.2; color: "#BBBBBB" }
+ GradientStop { position: 0.8; color: "#BBBBBB" }
+ GradientStop { position: 1.0; color: "#999999" }
+ }
+
+ Text {
+ anchors.centerIn: parent
+ color: "#302020"
+ text: "Calibrate"
+ font { bold: true; pixelSize: parent.width * 0.15 }
+ smooth: true
+ }
+ }
+ }
+ }
+
+ Button {
+ anchors {
+ left: sign.right
+ right: parent.right
+ verticalCenter: sign.verticalCenter
+ margins: (parent.width - (sign.x + sign.width)) / 4
+ }
+
+ height: width
+ source: "images/calibbutton.png"
+ mouseAreaScale: 2
+ smooth: true
+
+ onClicked: sign.frontSide = !sign.frontSide
+ }
+}
diff --git a/demos/mobile/qtbubblelevel/qml/Button.qml b/demos/mobile/qtbubblelevel/qml/Button.qml
new file mode 100644
index 0000000..213ee1b
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/Button.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: button
+
+ property alias source: image.source
+ property alias mouseAreaScale: mouseArea.scale
+
+ signal clicked
+
+ width: 50; height: 50
+ color: "transparent"
+
+ Behavior on scale { NumberAnimation { duration: 50 } }
+
+ Image {
+ id: image
+
+ anchors.fill: parent
+ smooth: true
+ }
+
+ MouseArea {
+ id: mouseArea
+
+ anchors.fill: parent
+ onClicked: { button.clicked() }
+ onEntered: { button.scale = 0.9 }
+ onExited: { button.scale = 1.0 }
+ }
+}
diff --git a/demos/mobile/qtbubblelevel/qml/Tube.qml b/demos/mobile/qtbubblelevel/qml/Tube.qml
new file mode 100644
index 0000000..f39c9d6
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/Tube.qml
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+//! [0]
+Item {
+ id: tube
+
+ property real deg
+
+ Image {
+ id: bubble
+
+ property real center: tube.width / 2
+ property real bubbleCenter: bubble.width / 2
+
+ function calX() {
+ var newX = center + tube.deg / -20 * center
+
+ if((newX - bubbleCenter) < 0) {
+ return 0
+ }
+ else if((newX + bubbleCenter) > tube.width) {
+ return tube.width - 2 * bubbleCenter
+ }
+
+ return newX - bubbleCenter;
+ }
+
+ x: calX()
+ width: 0.16129032 * parent.width; height: 0.66666667 * parent.height
+ source: "images/bubble.png"
+ smooth: true
+ }
+
+ Image {
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: 0.36451613 * parent.width; height: 0.66666667 * parent.height
+ source: "images/scale.png"
+ }
+
+ Image {
+ width: parent.width; height: 0.32 * parent.height
+ opacity: 0.8
+ source: "images/reflection.png"
+ }
+}
+//! [0]
diff --git a/demos/mobile/qtbubblelevel/qml/images/board.png b/demos/mobile/qtbubblelevel/qml/images/board.png
new file mode 100644
index 0000000..aaed8d0
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/images/board.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/qml/images/bubble.png b/demos/mobile/qtbubblelevel/qml/images/bubble.png
new file mode 100644
index 0000000..e73be9e
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/images/bubble.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/qml/images/calibbutton.png b/demos/mobile/qtbubblelevel/qml/images/calibbutton.png
new file mode 100644
index 0000000..5f84dad
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/images/calibbutton.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/qml/images/exit.png b/demos/mobile/qtbubblelevel/qml/images/exit.png
new file mode 100644
index 0000000..64a6163
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/images/exit.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/qml/images/reflection.png b/demos/mobile/qtbubblelevel/qml/images/reflection.png
new file mode 100644
index 0000000..093781e
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/images/reflection.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/qml/images/scale.png b/demos/mobile/qtbubblelevel/qml/images/scale.png
new file mode 100644
index 0000000..c75b21e
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/images/scale.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/qml/images/signblank.png b/demos/mobile/qtbubblelevel/qml/images/signblank.png
new file mode 100644
index 0000000..03b53cc
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/images/signblank.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/qml/images/signwithtext.png b/demos/mobile/qtbubblelevel/qml/images/signwithtext.png
new file mode 100644
index 0000000..be9c050
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/images/signwithtext.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/qml/images/taskswitcher.png b/demos/mobile/qtbubblelevel/qml/images/taskswitcher.png
new file mode 100644
index 0000000..89ff7a1
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/images/taskswitcher.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/qtbubblelevel.pro b/demos/mobile/qtbubblelevel/qtbubblelevel.pro
new file mode 100644
index 0000000..8646308
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qtbubblelevel.pro
@@ -0,0 +1,61 @@
+# Copyright (c) 2011 Nokia Corporation.
+
+QT += core gui declarative
+CONFIG += mobility
+MOBILITY += sensors
+
+TARGET = qtbubblelevel
+TEMPLATE = app
+
+VERSION = 1.2.0
+
+HEADERS += taskswitcher.h \
+ accelerometerfilter.h \
+ settings.h
+
+SOURCES += main.cpp \
+ taskswitcher.cpp \
+ accelerometerfilter.cpp
+
+OTHER_FILES += qml/*.qml \
+ qml/images/*.png
+
+RESOURCES = resources.qrc
+
+maemo5 {
+ BINDIR = /opt/usr/bin
+ DATADIR = /usr/share
+ DEFINES += DATADIR=\\\"$$DATADIR\\\" \
+ PKGDATADIR=\\\"$$PKGDATADIR\\\"
+ INSTALLS += target \
+ desktop \
+ iconxpm \
+ icon26 \
+ icon40 \
+ icon64
+
+ target.path = $$BINDIR
+ desktop.path = $$DATADIR/applications/hildon
+ desktop.files += $${TARGET}.desktop
+
+ iconxpm.path = $$DATADIR/pixmap
+ iconxpm.files += icons/xpm/qtbubblelevel.xpm
+
+ icon26.path = $$DATADIR/icons/hicolor/26x26/apps
+ icon26.files += icons/26x26/qtbubblelevel.png
+
+ icon40.path = $$DATADIR/icons/hicolor/40x40/apps
+ icon40.files += icons/40x40/qtbubblelevel.png
+
+ icon64.path = $$DATADIR/icons/hicolor/64x64/apps
+ icon64.files += icons/64x64/qtbubblelevel.png
+}
+
+symbian {
+ TARGET = QtBubbleLevel
+
+ # To lock the application to landscape orientation
+ LIBS += -lcone -leikcore -lavkon
+
+ ICON = icons/bubblelevel.svg
+}
diff --git a/demos/mobile/qtbubblelevel/resources.qrc b/demos/mobile/qtbubblelevel/resources.qrc
new file mode 100644
index 0000000..8f57e82
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/resources.qrc
@@ -0,0 +1,16 @@
+<RCC>
+ <qresource prefix="/">
+ <file>qml/BubbleLevel.qml</file>
+ <file>qml/Tube.qml</file>
+ <file>qml/Button.qml</file>
+ <file>qml/images/taskswitcher.png</file>
+ <file>qml/images/exit.png</file>
+ <file>qml/images/board.png</file>
+ <file>qml/images/bubble.png</file>
+ <file>qml/images/scale.png</file>
+ <file>qml/images/reflection.png</file>
+ <file>qml/images/signwithtext.png</file>
+ <file>qml/images/calibbutton.png</file>
+ <file>qml/images/signblank.png</file>
+ </qresource>
+</RCC>
diff --git a/demos/mobile/qtbubblelevel/settings.h b/demos/mobile/qtbubblelevel/settings.h
new file mode 100644
index 0000000..2096637
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/settings.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SETTINGS_H
+#define SETTINGS_H
+
+#include <QtCore>
+
+class Settings : public QObject
+{
+ Q_OBJECT
+
+public:
+ void loadAndEmitCorrectionAngle() {
+ QSettings settings("Nokia corp", "QtBubbleLevel");
+ emit correctionAngle(settings.value("CorrectionAngle", "0.0f"));
+ }
+
+signals:
+ void correctionAngle(const QVariant &angle);
+
+public slots:
+ void saveCorrectionAngle(const QVariant &angle) {
+ QSettings settings("Nokia corp", "QtBubbleLevel");
+ settings.setValue("CorrectionAngle", angle);
+ }
+};
+
+#endif // SETTINGS_H
diff --git a/demos/mobile/qtbubblelevel/taskswitcher.cpp b/demos/mobile/qtbubblelevel/taskswitcher.cpp
new file mode 100644
index 0000000..5a3a9fb
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/taskswitcher.cpp
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "taskswitcher.h"
+
+// Task Switcher for maemo
+#ifdef Q_WS_MAEMO_5
+ #include <QtDBus/QtDBus>
+#endif
+
+
+void TaskSwitcher::minimizeApplication()
+{
+ //! [0]
+ #ifdef Q_WS_MAEMO_5
+ // Uses DBus to minimize application in Maemo
+ QDBusConnection connection = QDBusConnection::sessionBus();
+ QDBusMessage message =
+ QDBusMessage::createSignal("/","com.nokia.hildon_desktop",
+ "exit_app_view");
+ connection.send(message);
+ #endif
+ //! [0]
+}
diff --git a/demos/mobile/qtbubblelevel/taskswitcher.h b/demos/mobile/qtbubblelevel/taskswitcher.h
new file mode 100644
index 0000000..f7966d3
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/taskswitcher.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef TASKSWITCHER_H
+#define TASKSWITCHER_H
+
+#include <QObject>
+
+class TaskSwitcher : public QObject
+{
+ Q_OBJECT
+
+public slots:
+ void minimizeApplication();
+};
+
+#endif // TASKSWITCHER_H
diff --git a/demos/mobile/quickhit/Button.qml b/demos/mobile/quickhit/Button.qml
new file mode 100644
index 0000000..05ad78d
--- /dev/null
+++ b/demos/mobile/quickhit/Button.qml
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ width: 30
+ height: 30
+ smooth: true
+
+ property string buttonPath // for example "qrc:/gfx/exit.png"
+ property int buttonId: 0
+
+ signal btnClicked(int buttonId)
+
+ property bool animationEnabled: true
+
+ Image {
+ id: image
+ anchors.fill: parent
+ source: buttonPath
+ fillMode: Image.PreserveAspectFit
+ smooth: true
+ }
+
+ SequentialAnimation {
+ id:anim
+ PropertyAction { target: image; property: "scale"; value:"0.7"}
+ PauseAnimation { duration: 200 }
+ PropertyAction { target: image; property: "scale"; value:"1.0"}
+ }
+
+ Timer {
+ id: buttonPressedTimer
+ interval: 300; running: false; repeat: false
+ onTriggered: btnClicked(buttonId)
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ if (animationEnabled && !anim.running) {
+ anim.restart()
+ }
+ buttonPressedTimer.restart()
+ }
+ }
+
+}
diff --git a/demos/mobile/quickhit/Game.js b/demos/mobile/quickhit/Game.js
new file mode 100644
index 0000000..40db422
--- /dev/null
+++ b/demos/mobile/quickhit/Game.js
@@ -0,0 +1,180 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+var levelPlugin = null
+
+// ---------------------------------------------------------------------------
+// hideMissiles
+function hideMissiles() {
+ missile_1.stop()
+ missile_1.opacity = 0;
+
+ missile_2.stop()
+ missile_2.opacity = 0;
+
+ missile_3.stop()
+ missile_3.opacity = 0;
+
+ missile_4.stop()
+ missile_4.opacity = 0;
+
+ missile_5.stop()
+ missile_5.opacity = 0;
+
+ enemy_missile_1.opacity = 0;
+ enemy_missile_2.opacity = 0;
+}
+
+// ---------------------------------------------------------------------------
+// GameOver
+function gameOver() {
+
+ // Stop GameEngine timers
+ GameEngine.enableEngineTimer(false)
+
+ // Delete loaded plugin level
+ deleteLevel()
+
+ // Hiding
+ myShip.opacity = 0
+ btnPause.opacity = 0
+}
+
+// ---------------------------------------------------------------------------
+// Pause game
+function pauseGame(doPause) {
+ missile_1.pause(doPause)
+ missile_2.pause(doPause)
+ missile_3.pause(doPause)
+ missile_4.pause(doPause)
+ missile_5.pause(doPause)
+ enemy_missile_1.pause(doPause)
+ enemy_missile_2.pause(doPause)
+
+ if (doPause) {
+ btnPause.opacity = 0
+ } else {
+ btnPause.opacity = 1
+ }
+
+ GameEngine.pauseLevel(doPause)
+}
+
+// ---------------------------------------------------------------------------
+// Fire your missile
+function fireMissile(aXpox, aFromYpos, aToYpos) {
+ if (missile_1.opacity<1) {
+ missile_1.fire(aXpox,aFromYpos,aToYpos)
+ }
+ else if (missile_2.opacity<1) {
+ missile_2.fire(aXpox,aFromYpos,aToYpos)
+ }
+ else if (missile_3.opacity<1) {
+ missile_3.fire(aXpox,aFromYpos,aToYpos)
+ }
+ else if (missile_4.opacity<1) {
+ missile_4.fire(aXpox,aFromYpos,aToYpos)
+ }
+ else if (missile_5.opacity<1) {
+ missile_5.fire(aXpox,aFromYpos,aToYpos)
+ }
+}
+
+// ---------------------------------------------------------------------------
+// Fire enemy missile
+function fireEnemyMissile(aXpox, aFromYpos, aToYpos) {
+ if (enemy_missile_1.opacity==0) {
+ enemy_missile_1.enemyFire(aXpox,aFromYpos,aToYpos)
+ }
+ else if (enemy_missile_2.opacity==0) {
+ enemy_missile_2.enemyFire(aXpox,aFromYpos,aToYpos)
+ }
+}
+
+// ---------------------------------------------------------------------------
+// Create level QML component
+function createLevel() {
+ console.log("Creating level "+LevelPlugin.qmlRootPath()+"Level.qml")
+ var levelComponent = Qt.createComponent("file:/"+LevelPlugin.qmlRootPath()+"Level.qml");
+ if (levelComponent.status == Component.Ready) {
+ if (levelPlugin) {
+ deleteLevel()
+ }
+ levelPlugin = levelComponent.createObject(levelId);
+ if (levelPlugin != null) {
+ console.log("Level created")
+ } else {
+ console.log("Can not create level")
+ messageBox.showErrorMessage("ERROR: Can not create level!",6000)
+ return 1
+ }
+ } else {
+ console.log("Can not find level, error:"+levelComponent.errorString())
+ messageBox.showErrorMessage("ERROR: Can not find level!",6000)
+ return 1
+ }
+
+ missile_1.createGraphicsForLevel()
+ missile_1.setToDefaultPos()
+ missile_2.createGraphicsForLevel()
+ missile_2.setToDefaultPos()
+ missile_3.createGraphicsForLevel()
+ missile_3.setToDefaultPos()
+ missile_4.createGraphicsForLevel()
+ missile_4.setToDefaultPos()
+ missile_5.createGraphicsForLevel()
+ missile_5.setToDefaultPos()
+ enemy_missile_1.createGraphicsForLevel()
+ enemy_missile_2.createGraphicsForLevel()
+ myShip.createGraphicsForLevel()
+
+ return 0
+}
+
+// ---------------------------------------------------------------------------
+// Delete level
+function deleteLevel() {
+ if (levelPlugin) {
+ GameEngine.clearQmlObjects()
+ levelPlugin.destroy()
+
+ }
+ levelPlugin = null;
+}
diff --git a/demos/mobile/quickhit/Game.qml b/demos/mobile/quickhit/Game.qml
new file mode 100644
index 0000000..ab62a72
--- /dev/null
+++ b/demos/mobile/quickhit/Game.qml
@@ -0,0 +1,439 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "Game.js" as GameScript
+
+Item {
+ id: gameArea
+ width: 360; height: 640 // NOTE: have to exists some default sizes
+ anchors.fill: parent
+ objectName: "gameArea"
+
+
+ // Who win, you or computer
+ property bool gameOverProperty: false
+
+ // for info message to user
+ property variant messageBox
+
+ // Level activated signal for Qt side to load activated level
+ signal levelActivated(int index)
+
+ // Pause whole game, if level is loaded
+ function pauseGame() {
+ if (GameScript.levelPlugin) {
+ GameScript.pauseGame(true)
+ myShip.focus = false
+ btnPause.opacity = 0
+ menu.showPauseMenu()
+ }
+ }
+
+ // Qt side call this for QML take new level into use
+ function levelReadyForCreation() {
+ // Hide menu
+ menu.hideMenu()
+ // Show message
+ message.showMessage("Loading Level...",2000)
+ // Wait before create level
+ levelCreationTimer.restart()
+ }
+
+ // Fires ememy missile. Function is called from Qt side
+ function fireEnemyMissile(aXpox, aFromYpos, aToYpos) {
+ GameScript.fireEnemyMissile(aXpox, aFromYpos, aToYpos)
+ }
+
+ // Game Over handling. Function is called from Qt side
+ function gameOver(youWin) {
+ // Stop GameEngine timers
+ GameEngine.enableEngineTimer(false)
+ gameOverProperty = youWin
+ GameScript.hideMissiles()
+ gameOverTimer.restart()
+ //GameEngine.vibra()
+ }
+
+ // End game and show menu
+ function endGame(showMessage) {
+ backgroundPic.opacity = 1
+ // Stop GameEngine timers
+ GameEngine.enableEngineTimer(false)
+ // Do game over
+ GameScript.gameOver()
+ GameScript.hideMissiles()
+ // Clear GameEngine QML objects
+ GameEngine.clearQmlObjects()
+ myShip.opacity = 0
+ myShip.focus = false
+ btnPause.opacity = 0
+ idMainLogo.opacity = 1
+ menu.showLevelMenu()
+ if (showMessage) {
+ message.showMessage("Game End",2000)
+ }
+ }
+
+ // Timer for level creationing
+ Timer {
+ id: levelCreationTimer
+ interval: 1000; running: false; repeat: false
+ onTriggered: {
+ btnPause.opacity = 1
+ myShip.opacity = 1
+ myShip.focus = true
+ // Create new level
+ var ret = GameScript.createLevel()
+ if (ret==0) {
+ backgroundPic.opacity = 0
+ // Find QML object for GameEngine
+ GameEngine.findQmlObjects()
+ // Enable GameEngine timer
+ GameEngine.enableEngineTimer(true)
+ } else {
+ // Level cannot be created!
+ endGame(false)
+ }
+ }
+ }
+
+ // Timer for game over
+ Timer {
+ id: gameOverTimer
+ interval: 1500; running: false; repeat: false
+ onTriggered: {
+ backgroundPic.opacity = 1
+ idMainLogo.opacity = 1
+ // Do game over
+ GameScript.gameOver()
+ // Clear GameEngine QML objects
+ GameEngine.clearQmlObjects()
+ menu.showLevelMenu()
+ if (gameOverProperty) {
+ GameEngine.playInternalSound(4)
+ message.showMessage("Game Over, You win!",2000)
+ } else {
+ GameEngine.playInternalSounds(3,3)
+ message.showMessage("Game Over, You lose",2000)
+ }
+ }
+ }
+
+ // Menu signal to slot connections
+ Connections {
+ target: menu
+ // Level selected
+ onLevelSelected: {
+ // Stop bigship animation
+ bigShipAnim.stop()
+ bigShip.opacity = 0
+ // Hide logo
+ idMainLogo.opacity = 0
+ // Signal level activated
+ gameArea.levelActivated(levelIndex)
+ }
+ // Level resumed selected
+ onResumeSelected: {
+ menu.hideMenu()
+ GameScript.pauseGame(false)
+ myShip.focus = true
+ }
+ }
+
+ // This component creation completed
+ Component.onCompleted: {
+ // Show main Level selection menu
+ menu.showLevelMenu()
+
+ // Start big ship animation
+ bigShipAnim.restart()
+
+ // Set variable
+ messageBox = message
+
+ // Play game start sound
+ GameEngine.gameStartSound()
+
+ // Fade splash screen
+ fadeAnim.restart()
+ // Rotate splash logo
+ rotAnim.restart()
+ }
+
+
+ // Background image for the game
+ Image {
+ id: backgroundPic
+ z:1
+ source: "qrc:/gfx/background2.png"
+ fillMode: Image.PreserveAspectCrop
+ smooth: true
+ anchors.fill: parent
+ }
+
+ Image {
+ id: bigShip
+ source: "qrc:/gfx/bigship.png"
+ z:1.5
+ smooth: true
+ x: width * -1
+ y: parent.height * 0.55
+ }
+ SequentialAnimation {
+ id: bigShipAnim;
+ NumberAnimation {target:bigShip; property:"x"; to:gameArea.width; easing.type: Easing.Linear; duration: 80000 }
+ PropertyAction {target:bigShip; properties: "opacity"; value: 0}
+ }
+
+
+ // Enemies grid
+ Item {
+ // This is general level QML plaseholder
+ // Into this is level QML created in createLevel()
+ id:levelId
+ anchors.fill: parent
+ z:2
+ }
+
+ Image {
+ id: idMainLogo
+ z:19
+ source: "qrc:/gfx/quickhit_logo.png"
+ smooth: true
+ anchors.horizontalCenter: gameArea.horizontalCenter
+ y:gameArea.height / 10 * 1
+ }
+
+ // Game menu
+ Menu {
+ z:20
+ id:menu
+ width: gameArea.width / 5 * 4
+ height: gameArea.height / 10 * 4
+ anchors.verticalCenter: gameArea.verticalCenter
+ anchors.horizontalCenter: gameArea.horizontalCenter
+ }
+
+ // My ship
+ MyShip {
+ z:10
+ id: myShip
+ opacity: 0
+ }
+
+ // Mouse area of your ship
+ MouseArea {
+ //anchors.fill: parent
+ width: parent.width
+ height: myShip.height
+ x:0
+ y:gameArea.height - myShip.height
+
+ drag.target: myShip
+ drag.axis: Drag.XAxis
+ drag.minimumX: 0
+ drag.maximumX: gameArea.width - myShip.width
+
+ property int startPos: 0
+ property int dragCount: 0
+
+ onPressed: {
+ startPos = mouseX
+ dragCount = 0
+ }
+ onPositionChanged: {
+ //dragCount = Math.abs(mouseX-startPos)
+ }
+ onReleased: {
+ //if (dragCount<20) {
+ myShip.fire()
+ //}
+ }
+ }
+
+ // Pause button
+ Button {
+ id: btnSound
+ z:12
+ //animationEnabled: false
+ anchors.top: parent.top
+ anchors.topMargin: 10
+ buttonPath: "qrc:/gfx/soundOn.png"
+ buttonId: 4
+ width: gameArea.width / 10
+ height: gameArea.width / 10
+ x: gameArea.width - width - 15
+ opacity: 1
+ Connections {
+ target: btnSound
+ onBtnClicked: {
+ if (btnSound.buttonId==4) {
+ // Sound off
+ btnSound.buttonPath = "qrc:/gfx/soundOff.png"
+ btnSound.buttonId = 5
+ GameEngine.enableSounds(false)
+ } else {
+ // Sound on
+ btnSound.buttonPath = "qrc:/gfx/soundOn.png"
+ btnSound.buttonId = 4
+ GameEngine.enableSounds(true)
+ }
+ }
+ }
+ }
+
+ // Pause button
+ Button {
+ id: btnPause
+ z:13
+ anchors.top: parent.top
+ anchors.topMargin: 10
+ buttonPath: "qrc:/gfx/pause.png"
+ buttonId: 3
+ width: gameArea.width / 10
+ height: gameArea.width / 10
+ x: gameArea.width - width - btnPause.width - 15*2
+ opacity: 0
+ Connections {
+ target: btnPause
+ onBtnClicked: {
+ GameScript.pauseGame(true)
+ myShip.focus = false
+ btnPause.opacity = 0
+ menu.showPauseMenu()
+ }
+ }
+ }
+
+
+ // Hidden missiles ready for to be launched
+ Missile {
+ z:3
+ id: missile_1
+ x:0
+ y:10
+ }
+ Missile {
+ z:4
+ id: missile_2
+ x: 20
+ y:10
+ }
+ Missile {
+ z:5
+ id: missile_3
+ x: 40
+ y:10
+ }
+ Missile {
+ z:6
+ id: missile_4
+ x: 60
+ y:10
+ }
+ Missile {
+ z:7
+ id: missile_5
+ x: 80
+ y:10
+ }
+ Missile {
+ z:8
+ objectName: "enemy_missile"
+ id: enemy_missile_1
+ enemyMissile: true
+ }
+ Missile {
+ z:9
+ objectName: "enemy_missile"
+ id: enemy_missile_2
+ enemyMissile: true
+ }
+
+ // Messages to the user
+ Message {
+ id: message
+ z:21
+ }
+
+
+ // Splach screen
+ Rectangle {
+ id: blackFace
+ x:-2
+ y:0
+ width: parent.width + 2
+ height: parent.height
+ z:100
+ color: "black"
+ opacity: 1
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ mouse.accepted = true
+ fadeAnim.stop()
+ blackFace.opacity = 0
+ }
+ }
+
+ Image {
+ id: idLogo
+ source: "qrc:/gfx/quickhit_logo.png"
+ smooth: true
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ opacity: 0
+ }
+ NumberAnimation { id: rotAnim; target: idLogo; property: "rotation"; to: 20; duration: 9000 }
+
+ }
+ // Splach screen animation
+ SequentialAnimation {
+ id: fadeAnim
+ PauseAnimation {duration: 1000 }
+ NumberAnimation {target: idLogo; property: "opacity"; from: 0; to: 1; duration: 2000 }
+ PauseAnimation {duration: 2000 }
+ NumberAnimation {target: idLogo; property: "opacity"; from: 1; to: 0; duration: 2000 }
+ NumberAnimation {target: blackFace; property: "opacity"; from: 1; to: 0; duration: 2000 }
+ }
+
+}
diff --git a/demos/mobile/quickhit/InvSounds.cpp b/demos/mobile/quickhit/InvSounds.cpp
new file mode 100644
index 0000000..7342ba2
--- /dev/null
+++ b/demos/mobile/quickhit/InvSounds.cpp
@@ -0,0 +1,189 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "InvSounds.h"
+#include <QDir>
+#include <QDebug>
+
+using namespace GE;
+
+CInvSounds::CInvSounds(QObject *parent) : QObject( parent )
+{
+ m_musicInstance = 0;
+ m_sounds = 0;
+ m_internalSounds = 0;
+ m_soundCount = 0;
+ m_internalSoundCount = 0;
+
+ enableSounds(true);
+
+ m_audioOut = new AudioOut( this, &m_mixer );
+
+ enableInternalSounds();
+}
+
+void CInvSounds::enableSounds(bool enable)
+{
+ if (enable)
+ m_mixer.setGeneralVolume(0.2f);
+ else
+ m_mixer.setGeneralVolume(0);
+}
+
+void CInvSounds::enableInternalSounds()
+{
+ disableInternalSounds();
+
+ // Application internal sounda
+ m_internalSoundPaths.append(":/sound/menu1.wav");
+ m_internalSoundPaths.append(":/sound/menu2.wav");
+ m_internalSoundPaths.append(":/sound/gamestart.wav");
+ m_internalSoundPaths.append(":/sound/gameover.wav");
+ m_internalSoundPaths.append(":/sound/youwin.wav");
+
+ m_internalSoundCount = m_internalSoundPaths.count();
+ m_internalSounds = new CAudioBuffer*[m_internalSoundCount];
+
+ // Load general application sounds
+ for (int ff=0; ff<m_internalSoundPaths.count(); ff++) {
+ m_internalSounds[ff] = CAudioBuffer::loadWav(m_internalSoundPaths[ff]);
+ }
+}
+
+void CInvSounds::enableSounds(QStringList sounds)
+{
+ disableSounds();
+
+ // Sounds from the level
+ m_soundPaths = sounds;
+ m_soundCount = sounds.count();
+ m_sounds = new CAudioBuffer*[m_soundCount];
+ // Load level sounds
+ for (int f=0; f<m_soundPaths.count(); f++) {
+ m_sounds[f] = CAudioBuffer::loadWav(m_soundPaths[f]);
+ }
+
+}
+
+void CInvSounds::disableInternalSounds()
+{
+ for (int f=0; f<m_internalSoundCount; f++) {
+ if (m_internalSounds[f]) {
+ delete m_internalSounds[f];
+ }
+ }
+ delete [] m_internalSounds;
+ m_internalSoundCount = 0;
+ m_internalSoundPaths.clear();
+
+ m_musicInstance = 0;
+}
+
+void CInvSounds::disableSounds()
+{
+ for (int f=0; f<m_soundCount; f++) {
+ if (m_sounds[f]) {
+ delete m_sounds[f];
+ }
+ }
+ delete [] m_sounds;
+ m_sounds = 0;
+ m_soundCount = 0;
+ m_soundPaths.clear();
+
+ m_musicInstance = 0;
+}
+
+CInvSounds::~CInvSounds() {
+ if (m_audioOut) {
+ delete m_audioOut;
+ m_audioOut = 0;
+ }
+
+ disableSounds();
+ disableInternalSounds();
+}
+
+
+void CInvSounds::beginMusicOn() {
+ m_musicInstance = (GE::CAudioBufferPlayInstance*)m_mixer.addAudioSource( new GE::CAudioBufferPlayInstance( m_sounds[0] ) );
+ m_musicInstance->setLoopTimes(-1);
+}
+
+
+void CInvSounds::beginMusicOff() {
+ if (!m_musicInstance) return;
+ m_musicInstance->setLoopTimes(0); // stop when finished
+ m_musicInstance = 0;
+};
+
+
+void CInvSounds::playSound(int index) {
+ if (index < m_soundCount && index > -1) {
+ m_sounds[index]->playWithMixer( m_mixer );
+ }
+}
+
+void CInvSounds::playSounds(int index, int count)
+{
+ if (index < m_soundCount && index > -1) {
+ CAudioBufferPlayInstance* i = m_sounds[index]->playWithMixer( m_mixer );
+ i->setLoopTimes(count);
+ }
+}
+
+void CInvSounds::playInternalSound(int index) {
+ if (index < m_internalSoundCount && index > -1) {
+ m_internalSounds[index]->playWithMixer( m_mixer );
+ }
+}
+
+void CInvSounds::playInternalSounds(int index, int count)
+{
+ if (index < m_internalSoundCount && index > -1) {
+ CAudioBufferPlayInstance* i = m_internalSounds[index]->playWithMixer( m_mixer );
+ i->setLoopTimes(count);
+ }
+}
+
+void CInvSounds::gameStartSound() {
+ CAudioBufferPlayInstance* i = m_internalSounds[2]->playWithMixer( m_mixer );
+ i->setLoopTimes(2);
+};
diff --git a/demos/mobile/quickhit/InvSounds.h b/demos/mobile/quickhit/InvSounds.h
new file mode 100644
index 0000000..65422f2
--- /dev/null
+++ b/demos/mobile/quickhit/InvSounds.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef __CINVSOUNDS__
+#define __CINVSOUNDS__
+
+#include <QObject>
+#include <QStringList>
+
+#include "ga_src/GEAudioBuffer.h"
+#include "ga_src/GEAudioOut.h"
+
+class CInvSounds : public QObject
+{
+ Q_OBJECT
+
+public:
+ CInvSounds(QObject *parent);
+ ~CInvSounds();
+
+ void enableInternalSounds();
+ void enableSounds(QStringList sounds);
+ void disableInternalSounds();
+ void disableSounds();
+
+ void beginMusicOn();
+ void beginMusicOff();
+
+ void enableSounds(bool enable);
+
+
+ void gameStartSound();
+
+public slots:
+ void playSound(int index);
+ void playSounds(int index, int count);
+ void playInternalSound(int index);
+ void playInternalSounds(int index, int count);
+
+protected:
+ QStringList m_soundPaths;
+ QStringList m_internalSoundPaths;
+ GE::CAudioBufferPlayInstance *m_musicInstance;
+ GE::CAudioMixer m_mixer;
+ GE::AudioOut *m_audioOut;
+
+ GE::CAudioBuffer **m_sounds;
+ int m_soundCount;
+
+ GE::CAudioBuffer **m_internalSounds;
+ int m_internalSoundCount;
+};
+
+#endif
diff --git a/demos/mobile/quickhit/Menu.qml b/demos/mobile/quickhit/Menu.qml
new file mode 100644
index 0000000..cf2351e
--- /dev/null
+++ b/demos/mobile/quickhit/Menu.qml
@@ -0,0 +1,163 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "Game.js" as GameScript
+
+
+Rectangle {
+ id: menu
+
+ Text {
+ id: title
+ smooth: true
+ anchors.bottom: menu.top
+ anchors.horizontalCenter: menu.horizontalCenter
+ color: "red"
+ font.pixelSize: gameArea.width / 12
+ font.bold: true
+ horizontalAlignment: Text.AlignHCenter
+ }
+
+ border.color: "black"
+ border.width: 2
+ radius: 8
+ smooth: true
+ opacity: 0 // transparent by default
+
+ color: "black"
+// gradient: Gradient {
+// GradientStop { position: 0.0; color: "white" }
+// GradientStop { position: 1.0; color: "black" }
+// }
+
+ // Signals
+ signal levelSelected(int levelIndex)
+ signal resumeSelected()
+
+ // Show level menu
+ function showLevelMenu() {
+ menuData.clear()
+ title.text = "Select Your Level"
+ var plugins = GameEngine.pluginList()
+ for (var i = 0; i < plugins.length; i++) {
+ menuData.append({"name": plugins[i],"type":"0"})
+ }
+ menuData.append({"name": "About","type":"4"})
+ menuData.append({"name": "Exit","type":"1"})
+ menu.opacity = 0.8
+ listView.focus = true
+ }
+
+ function showPauseMenu() {
+ menuData.clear()
+ title.text = "Resume level?"
+ menuData.append({"name": "Resume","type":"2"})
+ menuData.append({"name": "End Game","type":"3"})
+ menu.opacity = 0.8
+ listView.focus = true
+ }
+
+ // Hide menu
+ function hideMenu() {
+ menu.opacity = 0
+ listView.focus = false
+ }
+
+ function menuItemSelected(index, type) {
+ switch (type) {
+ case "0": {
+ // Level selection
+ menu.levelSelected(index)
+ break;
+ }
+ case "1": {
+ // Exit
+ Qt.quit()
+ break;
+ }
+ case "2": {
+ // Resume
+ menu.resumeSelected()
+ break;
+ }
+ case "3": {
+ // End Game
+ gameArea.endGame()
+ break;
+ }
+ case "4": {
+ // Show about
+ gameArea.messageBox.showInfoMessage()
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ }
+
+ ListModel {
+ id: menuData
+ }
+
+ ListView {
+ id: listView
+ clip: true
+ anchors.fill: parent
+ keyNavigationWraps: true
+
+ function doSelect() {
+ menu.menuItemSelected(listView.currentIndex,menuData.get(listView.currentIndex).type)
+ }
+
+ model: menuData
+
+ delegate: MenuItem {
+ id: menuItem
+ selectedItem: menuItem.ListView.isCurrentItem ? true : false
+ onItemSelected: {
+ listView.currentIndex = model.index
+ listView.doSelect()
+ }
+
+ }
+ }
+}
diff --git a/demos/mobile/quickhit/MenuItem.qml b/demos/mobile/quickhit/MenuItem.qml
new file mode 100644
index 0000000..58557ac
--- /dev/null
+++ b/demos/mobile/quickhit/MenuItem.qml
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Text {
+ id: menuItem
+ text: name
+ color: "white"
+ opacity: 1
+ font.family: "Calibri"
+ font.pixelSize: menu.width / 8
+ x: (parent.width - width )/ 2
+
+ property bool selectedItem: false
+ property int type
+
+ signal itemSelected()
+
+ transform: Rotation { id:rotationId; origin.x:width/2; origin.y:height/2; axis { x: 1; y: 0; z: 0 } angle: 0 }
+ SequentialAnimation {
+ id: toRotateRightAndCenterAnim
+ PropertyAnimation { target: rotationId; easing.type: Easing.Linear;
+ properties: "angle"; from: 0; to: 180; duration: 300 }
+ PropertyAction { target: menuItem; property: "color"; value:"red"}
+ PropertyAnimation { target: rotationId; easing.type: Easing.Linear;
+ properties: "angle"; from: 180; to: 360; duration: 300 }
+ PropertyAction { target: menuItem; property: "color"; value:"white"}
+ }
+
+ function selectItem(doSelect) {
+ if (!toRotateRightAndCenterAnim.running) {
+ GameEngine.playInternalSound(0)
+ toRotateRightAndCenterAnim.restart()
+ if (doSelect) {
+ GameEngine.playInternalSound(1)
+ selectionTimer.restart()
+ }
+ }
+ }
+
+ Timer {
+ id: selectionTimer
+ interval: 1000; running: false; repeat: false
+ onTriggered: menuItem.itemSelected()
+ }
+
+ MouseArea {
+ id: mouseArea;
+ anchors.fill: parent
+ onClicked: {
+ selectItem(true)
+ }
+ }
+
+ Keys.onSpacePressed: { selectItem(true) }
+ Keys.onSelectPressed: { selectItem(true) }
+ Keys.onEnterPressed: { selectItem(true) }
+ Keys.onReleased: {
+ if (event.key == Qt.Key_Down || event.key == Qt.Key_Up) {
+ selectItem(false)
+ }
+ event.accepted = false
+ }
+}
+
diff --git a/demos/mobile/quickhit/Message.qml b/demos/mobile/quickhit/Message.qml
new file mode 100644
index 0000000..1498203
--- /dev/null
+++ b/demos/mobile/quickhit/Message.qml
@@ -0,0 +1,147 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: message
+ border.color: "black"
+ border.width: 1
+ radius: 8
+ smooth: true
+ opacity: 0 // transparent = 0 by default
+ color: "black"
+
+ property string txt
+ property int animSpeed
+
+ function showMessage(text,speed) {
+ message.border.color = "black"
+ message.y = 50
+ message.width = gameArea.width / 5 * 4
+ message.height = gameArea.height / 8 * 1
+ txt = text
+ animSpeed = speed
+ message.opacity = 1
+ messageText.font.pixelSize = parent.width / 14
+ messageAnim.restart()
+ }
+
+ function showErrorMessage(text,speed) {
+ message.border.color = "red"
+ message.y = 50
+ message.width = gameArea.width / 5 * 4
+ message.height = gameArea.height / 8 * 1
+ txt = text
+ animSpeed = speed
+ message.opacity = 1
+ messageText.font.pixelSize = parent.width / 14
+ messageAnim.restart()
+ }
+
+ function showInfoMessage() {
+ message.border.color = "white"
+ txt = "<a href=\"https://projects.forum.nokia.com/quickhit\">QuickHit</a>" +
+ "<p>" +
+ "Forum Nokia <br>" +
+ "Qt Quick Game Example <br>" +
+ "</p>" +
+ "<p>" +
+ "Sounds were loaded from freesound.org under Creative Commons Sampling Plus 1.0 license.<br>" +
+ "</p>" +
+ "<p>" +
+ "Sounds were created by these nicknames:<br>" +
+ "HardPCM<br>" +
+ "Matt_G<br>" +
+ "klankbeeld<br>" +
+ "steveygos93<br>" +
+ "joe93barlow<br>" +
+ "ljudman<br>" +
+ "Jovica<br>" +
+ "patchen<br>" +
+ "nthompson<br>" +
+ "</p>"
+
+ animSpeed = 9000
+ message.opacity = 1
+ message.y = 10
+ message.height = gameArea.height - message.y - 10
+ message.width = gameArea.width - 20
+
+ messageText.font.pixelSize = parent.width / 16
+ messageAnim.restart()
+ }
+
+ //gradient: Gradient {
+ // GradientStop { position: 0.0; color: "white" }
+ // GradientStop { position: 1.0; color: "black" }
+ //}
+
+ SequentialAnimation {
+ id: messageAnim
+ PropertyAnimation {
+ target: message; properties: "x";
+ from: message.width*-1; to: gameArea.width; duration: animSpeed; easing.type: Easing.OutInExpo}
+ PropertyAction { target: message; properties: "opacity"; value: 0 }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ messageAnim.stop()
+ message.opacity = 0
+ }
+ }
+
+ Text {
+ id: messageText
+ anchors.fill: parent
+ anchors.margins: 10
+ text: txt
+ wrapMode: Text.WordWrap
+ color: "white"
+ font.family: "Calibri"
+ font.pixelSize: parent.width / 14
+ font.bold: true
+ onLinkActivated: {
+ GameEngine.openLink(link)
+ }
+ }
+}
diff --git a/demos/mobile/quickhit/Missile.qml b/demos/mobile/quickhit/Missile.qml
new file mode 100644
index 0000000..80efa6e
--- /dev/null
+++ b/demos/mobile/quickhit/Missile.qml
@@ -0,0 +1,143 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: missile
+ objectName: "missile"
+ opacity: 0 // transparent by default
+
+ property int fromYpos
+ property int toYpos
+ property variant myMissileSize
+ property bool enemyMissile: false
+ property int defaultX: 0
+ property int defaultY: 0
+
+ function storeDefaultPos() {
+ defaultX = missile.x
+ defaultY = missile.y
+ }
+
+ function setToDefaultPos() {
+ missile.x = defaultX
+ missile.y = defaultY
+ opacity = 0.5
+ }
+
+ function createGraphicsForLevel() {
+ missile.myMissileSize = LevelPlugin.graphSize(LevelPlugin.pathToMissilePic())
+ missile.height = myMissileSize.height;
+ missile.width = myMissileSize.width;
+ if (missile.enemyMissile) {
+ missileImage.source = "file:/"+LevelPlugin.pathToEnemyMissilePic()
+ } else {
+ missileImage.source = "file:/"+LevelPlugin.pathToMissilePic()
+ }
+ }
+
+ // Execute fire!
+ function fire(aXpox, aFromYpos, aToYpos) {
+ missile.x = aXpox - missile.width / 2
+ missile.y = aFromYpos
+ missile.fromYpos = aFromYpos
+ missile.toYpos = aToYpos
+ missile.opacity = 1
+ GameEngine.playSound(2) // NOTE: 3 for your missile sound
+ flying.restart()
+ }
+
+ // Enemy fires!
+ function enemyFire(aXpox, aFromYpos, aToYpos) {
+ missile.x = aXpox - missile.width / 2
+ missile.y = aFromYpos
+ missile.fromYpos = aFromYpos
+ missile.toYpos = aToYpos
+ missile.opacity = 1
+ GameEngine.playSound(3) // NOTE: 3 for enemy missile sound
+ flyingEnemy.restart()
+ }
+
+ // Stop missile
+ function stop() {
+ flying.stop()
+ }
+
+ // Pause missile
+ function pause(doPause) {
+ if (doPause) {
+ flying.pause()
+ flyingEnemy.pause()
+ } else {
+ flying.resume()
+ flyingEnemy.resume()
+ }
+ }
+
+ Component.onCompleted: {
+ if (!enemyMissile) {
+ storeDefaultPos()
+ setToDefaultPos()
+ }
+ }
+
+ // Animates missile flying to the target
+ SequentialAnimation {
+ id: flying
+ PropertyAnimation {target: missile; properties: "y";
+ from: fromYpos; to: toYpos; duration: 2000; easing.type: Easing.InCubic }
+ //PropertyAction {target: missile; properties: "opacity"; value: 0}
+ ScriptAction { script: setToDefaultPos() }
+ }
+
+ SequentialAnimation {
+ id: flyingEnemy
+ PropertyAnimation {target: missile; properties: "y";
+ from: fromYpos; to: toYpos; duration: 2000; easing.type: Easing.InCubic }
+ PropertyAction {target: missile; properties: "opacity"; value: 0}
+ }
+
+ Image {
+ id: missileImage
+ smooth: true
+ }
+}
+
diff --git a/demos/mobile/quickhit/MyShip.qml b/demos/mobile/quickhit/MyShip.qml
new file mode 100644
index 0000000..3bcc822
--- /dev/null
+++ b/demos/mobile/quickhit/MyShip.qml
@@ -0,0 +1,184 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "Game.js" as GameScript
+
+Item {
+ id: myShip
+ objectName: "myShip"
+
+ property variant myShipSize
+ property int originalY
+
+ // Fires missile if exists
+ function fire() {
+ if (myShip.opacity==1) {
+ GameScript.fireMissile(myShip.x+myShip.width/2,myShip.y,myShip.height*-1)
+ if (myShip.y+myShip.height < gameArea.height+5) {
+ goDownAnim.restart()
+ }
+ }
+ }
+
+ function createGraphicsForLevel() {
+ myShip.myShipSize = LevelPlugin.graphSize(LevelPlugin.pathToMyShipPic())
+ myShip.height = myShipSize.height
+ myShip.width = myShipSize.width
+ image.source = "file:/"+LevelPlugin.pathToMyShipPic()
+ myShip.y = gameArea.height - myShip.height - 10
+ originalY = myShip.y
+ myShip.x = (gameArea.width - myShip.width)/ 2
+ }
+
+ Image {
+ id: image
+ smooth: true
+ }
+
+ Keys.onSpacePressed: { fire() }
+ Keys.onSelectPressed: { fire() }
+ Keys.onRightPressed: {
+ if (myShip.x < (gameArea.width - myShip.width - 20)) {
+ toRightAnim.restart()
+ }
+ }
+ Keys.onLeftPressed: {
+ if (myShip.x > 20) {
+ toLeftAnim.restart()
+ }
+ }
+
+ // To right animation
+ PropertyAnimation { id: toRightAnim; target: myShip; easing.type: Easing.OutQuint;
+ properties: "x"; from: myShip.x; to: myShip.x + 20; duration: 500 }
+
+ // To left animation
+ PropertyAnimation { id: toLeftAnim; target: myShip; easing.type: Easing.OutQuint;
+ properties: "x"; from: myShip.x; to: myShip.x - 20; duration: 500 }
+
+ // Go down on fire animation
+ SequentialAnimation {
+ id: goDownAnim
+ NumberAnimation { target: myShip; property:"y"; from: myShip.y; to: myShip.y+5;
+ easing.type: Easing.Linear; duration: 200 }
+ NumberAnimation { target: myShip; property:"y"; from: myShip.y; to: originalY;
+ easing.type: Easing.Linear; duration: 200 }
+ }
+
+
+ /*
+ MouseArea {
+ anchors.fill: parent
+ drag.target: myShip
+ drag.axis: Drag.XAxis
+ drag.minimumX: 0
+ drag.maximumX: gameArea.width - myShip.width
+ onReleased: {
+ fire()
+ }
+ }
+ */
+
+
+ /*
+ property bool isAutoRepeat: false
+ Keys.onPressed: {
+ if (event.key == Qt.Key_Right) {
+ if (event.isAutoRepeat) {
+ isAutoRepeat = true
+ toRightAnim.restart()
+ } else {
+ isAutoRepeat = false
+ toRotateRightAndCenterAnim.restart()
+ }
+ event.accepted = true
+ }
+ else if (event.key == Qt.Key_Left) {
+ if (event.isAutoRepeat) {
+ isAutoRepeat = true
+ toLeftAnim.restart()
+ } else {
+ isAutoRepeat = false
+ toRotateLeftAndCenterAnim.restart()
+ }
+ event.accepted = true
+ }
+ }
+
+ Keys.onReleased: {
+ if (isAutoRepeat) {
+ toRotateRightAndCenterAnim.stop()
+ toRotateLeftAndCenterAnim.stop()
+ } else {
+ toRotateCenter.restart()
+ }
+ event.accepted = true
+ }
+
+ // Rotation on movement animation
+ transform: Rotation { id:rotationId; origin.x: width/2; origin.y: height/2; axis { x: 0; y: 1; z: 0 } angle: 0 }
+ SequentialAnimation {
+ id: toRotateRightAndCenterAnim
+ PropertyAnimation { target: rotationId; easing.type: Easing.Linear;
+ properties: "angle"; from: 0; to: 30; duration: 100 }
+ PropertyAnimation { target: myShip; easing.type: Easing.OutQuint;
+ properties: "x"; from: myShip.x; to: myShip.x + 20; duration: 500 }
+ PropertyAnimation { target: rotationId; easing.type: Easing.Linear;
+ properties: "angle"; to: 0; duration: 100 }
+ }
+ SequentialAnimation {
+ id: toRotateLeftAndCenterAnim
+ PropertyAnimation { target: rotationId; easing.type: Easing.Linear;
+ properties: "angle"; from: 0; to: -30; duration: 100 }
+ PropertyAnimation { target: myShip; easing.type: Easing.OutQuint;
+ properties: "x"; from: myShip.x; to: myShip.x - 20; duration: 500 }
+ PropertyAnimation { target: rotationId; easing.type: Easing.Linear;
+ properties: "angle"; to: 0; duration: 100 }
+ }
+ PropertyAnimation { id: toRotateRight; target: rotationId; easing.type: Easing.Linear;
+ properties: "angle"; from: 0; to: 30; duration: 100 }
+ PropertyAnimation { id: toRotateCenter; target: rotationId; easing.type: Easing.Linear;
+ properties: "angle"; to: 0; duration: 100 }
+ PropertyAnimation { id: toRotateLeft; target: rotationId; easing.type: Easing.Linear;
+ properties: "angle"; from: 0; to: -30; duration: 100 }
+*/
+
+}
diff --git a/demos/mobile/quickhit/debian/changelog b/demos/mobile/quickhit/debian/changelog
new file mode 100644
index 0000000..226e172
--- /dev/null
+++ b/demos/mobile/quickhit/debian/changelog
@@ -0,0 +1,11 @@
+quickhit (1.1.0) unstable; urgency=low
+
+ * First version
+
+ -- Antonio Aloisio <antonio.aloisio@nokia.com> Wed, 5 Jan 2011 10:05:04 +0200
+
+quickhit (1.0.0) unstable; urgency=low
+
+ * First version
+
+ -- Antonio Aloisio <antonio.aloisio@nokia.com> Tue, 19 Oct 2010 10:05:04 +0200
diff --git a/demos/mobile/quickhit/debian/compat b/demos/mobile/quickhit/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/demos/mobile/quickhit/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/demos/mobile/quickhit/debian/control b/demos/mobile/quickhit/debian/control
new file mode 100644
index 0000000..7253285
--- /dev/null
+++ b/demos/mobile/quickhit/debian/control
@@ -0,0 +1,11 @@
+Source: quickhit
+Section: user/games
+Priority: extra
+Maintainer: Antonio Aloisio <antonio.aloisio@nokia.com>
+Standards-Version: 3.7.2
+
+Package: quickhit
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: QuickHit
+ Qt Quick Game example
diff --git a/demos/mobile/quickhit/debian/copyright b/demos/mobile/quickhit/debian/copyright
new file mode 100644
index 0000000..b0aadaf
--- /dev/null
+++ b/demos/mobile/quickhit/debian/copyright
@@ -0,0 +1,8 @@
+This is quickhit, written and maintained by Forum Nokia Antonio Aloisio <antonio.aloisio@nokia.com>
+on Tue, 19 Oct 2010 10:05:04 +0200
+
+
+Copyright Holder: Nokia (c) 2010
+
+License:
+
diff --git a/demos/mobile/quickhit/debian/dirs b/demos/mobile/quickhit/debian/dirs
new file mode 100644
index 0000000..80507f1
--- /dev/null
+++ b/demos/mobile/quickhit/debian/dirs
@@ -0,0 +1,2 @@
+usr/bin
+usr/share/applications/hildon
diff --git a/demos/mobile/quickhit/debian/postinst b/demos/mobile/quickhit/debian/postinst
new file mode 100644
index 0000000..79fb6dd
--- /dev/null
+++ b/demos/mobile/quickhit/debian/postinst
@@ -0,0 +1,5 @@
+#!/bin/sh -e
+
+gtk-update-icon-cache -f /usr/share/icons/hicolor
+
+exit 0
diff --git a/demos/mobile/quickhit/debian/rules b/demos/mobile/quickhit/debian/rules
new file mode 100644
index 0000000..b485428
--- /dev/null
+++ b/demos/mobile/quickhit/debian/rules
@@ -0,0 +1,91 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+APPNAME := quickhit
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ $(MAKE)
+ #docbook-to-man debian/$(APPNAME).sgml > $(APPNAME).1
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ $(MAKE) clean
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/$(APPNAME).
+ $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/$(APPNAME) install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+# dh_install
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+ # dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+ dh_makeshlibs
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/demos/mobile/quickhit/freesound.org.licence.txt b/demos/mobile/quickhit/freesound.org.licence.txt
new file mode 100644
index 0000000..8714ea0
--- /dev/null
+++ b/demos/mobile/quickhit/freesound.org.licence.txt
@@ -0,0 +1,24 @@
+
+Sounds were loaded from www.freesound.org under Creative Commons Sampling Plus 1.0 license.
+
+Sounds were created by these nicknames: HardPCM, Matt_G, klankbeeld, steveygos93, joe93barlow, ljudman, Jovica, patchen, nthompson
+
+78677__joe93barlow__strike2.wav
+47251__nthompson__rocket.wav
+3378__patchen__Rhino_03.wav
+3258__Jovica__Dronetail_02.wav
+30351__Matt_G__Space_Fighter_Pass.wav
+32954__HardPCM__Chip054.wav
+32985__HardPCM__Alarm001.wav
+33245__ljudman__grenade.wav
+78678__joe93barlow__swing0.wav
+80401__steveygos93__Explosion2.wav
+109438__klankbeeld__intro_brass_01.wav
+
+
+
+
+
+
+
+
diff --git a/demos/mobile/quickhit/ga_src/GEAudioBuffer.cpp b/demos/mobile/quickhit/ga_src/GEAudioBuffer.cpp
new file mode 100644
index 0000000..7da9219
--- /dev/null
+++ b/demos/mobile/quickhit/ga_src/GEAudioBuffer.cpp
@@ -0,0 +1,391 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QDebug>
+#include <math.h>
+#include "GEAudioBuffer.h"
+
+using namespace GE;
+
+
+struct SWavHeader {
+ char chunkID[4];
+ unsigned int chunkSize;
+ char format[4];
+
+ unsigned char subchunk1id[4];
+ unsigned int subchunk1size;
+ unsigned short audioFormat;
+ unsigned short nofChannels;
+ unsigned int sampleRate;
+ unsigned int byteRate;
+
+ unsigned short blockAlign;
+ unsigned short bitsPerSample;
+
+ unsigned char subchunk2id[4];
+ unsigned int subchunk2size;
+
+};
+
+CAudioBuffer::CAudioBuffer() {
+ m_data = 0;
+ m_dataLength = 0;
+ m_sampleFunction = 0;
+};
+
+
+CAudioBuffer::~CAudioBuffer() {
+ reallocate(0);
+}
+
+void CAudioBuffer::reallocate( int length ) {
+ if (m_data) delete [] ((char*)m_data);
+ m_dataLength = length;
+ if (m_dataLength>0) {
+ m_data = new char[ m_dataLength ];
+ } else m_data = 0;
+};
+
+
+CAudioBuffer* CAudioBuffer::loadWav( QString fileName ) {
+ QFile *wavFile = new QFile( fileName );
+
+
+ if (wavFile->open(QIODevice::ReadOnly)) {
+ SWavHeader header;
+
+ wavFile->read( header.chunkID, 4 );
+ if (header.chunkID[0]!='R' || header.chunkID[1]!='I' || header.chunkID[2]!='F' || header.chunkID[3]!='F') return 0; // incorrect header
+
+ wavFile->read( (char*)&header.chunkSize,4 );
+ wavFile->read( (char*)&header.format,4 );
+
+ if (header.format[0]!='W' || header.format[1]!='A' || header.format[2]!='V' || header.format[3]!='E') return 0; // incorrect header
+
+ wavFile->read( (char*)&header.subchunk1id,4 );
+ if (header.subchunk1id[0]!='f' || header.subchunk1id[1]!='m' || header.subchunk1id[2]!='t' || header.subchunk1id[3]!=' ') return 0; // incorrect header
+
+ wavFile->read( (char*)&header.subchunk1size,4 );
+ wavFile->read( (char*)&header.audioFormat,2 );
+ wavFile->read( (char*)&header.nofChannels,2 );
+ wavFile->read( (char*)&header.sampleRate,4 );
+ wavFile->read( (char*)&header.byteRate,4 );
+ wavFile->read( (char*)&header.blockAlign,2 );
+ wavFile->read( (char*)&header.bitsPerSample,2 );
+
+ qDebug() << fileName << " opened";
+
+ while (1) {
+ if (wavFile->read( (char*)&header.subchunk2id,4 ) != 4) return 0;
+ if (wavFile->read( (char*)&header.subchunk2size,4 ) != 4) return 0;
+ //int deb_size = header.subchunk2size;
+ //char tes[4];
+ //memcpy(tes, header.subchunk2id, 4 );
+ //if (header.subchunk2id[0]!='d' || header.subchunk2id[1]!='a' || header.subchunk2id[2]!='t' || header.subchunk2id[3]!='a') return 0; // incorrect header
+ if (header.subchunk2id[0]=='d' && header.subchunk2id[1]=='a' && header.subchunk2id[2]=='t' && header.subchunk2id[3]=='a') break; // found the data, chunk
+ // this was not the data-chunk. skip it
+ if (header.subchunk2size<1) return 0; // error in file
+ char *unused = new char[header.subchunk2size];
+ wavFile->read( unused, header.subchunk2size );
+ delete [] unused;
+ }
+
+
+
+ // the data follows.
+ if (header.subchunk2size<1) return 0;
+
+ CAudioBuffer *rval = new CAudioBuffer;
+ rval->m_nofChannels = header.nofChannels;
+ rval->m_bitsPerSample = header.bitsPerSample;
+ rval->m_samplesPerSec = header.sampleRate;
+ rval->m_signedData = 0; // where to know this?
+ rval->reallocate( header.subchunk2size );
+
+ wavFile->read( (char*)rval->m_data, header.subchunk2size );
+
+ // choose a good sampling function.
+ rval->m_sampleFunction = 0;
+ if (rval->m_nofChannels==1) {
+ if (rval->m_bitsPerSample == 8) rval->m_sampleFunction = sampleFunction8bitMono;
+ if (rval->m_bitsPerSample == 16) rval->m_sampleFunction = sampleFunction16bitMono;
+ } else {
+ if (rval->m_bitsPerSample == 8) rval->m_sampleFunction = sampleFunction8bitStereo;
+ if (rval->m_bitsPerSample == 16) rval->m_sampleFunction = sampleFunction16bitStereo;
+ }
+
+ return rval;
+
+
+ } else {
+ qDebug() << fileName << " NOT opened";
+ return 0;
+ }
+
+ delete wavFile;
+};
+
+
+CAudioBuffer* CAudioBuffer::loadWav( FILE *wavFile ) {
+ // read the header.
+ SWavHeader header;
+ fread( header.chunkID, 4, 1, wavFile );
+ if (header.chunkID[0]!='R' || header.chunkID[1]!='I' || header.chunkID[2]!='F' || header.chunkID[3]!='F') return 0; // incorrect header
+
+ fread( &header.chunkSize, 4, 1, wavFile );
+ fread( header.format, 4, 1, wavFile );
+ if (header.format[0]!='W' || header.format[1]!='A' || header.format[2]!='V' || header.format[3]!='E') return 0; // incorrect header
+
+ fread( header.subchunk1id, 4, 1, wavFile );
+ if (header.subchunk1id[0]!='f' || header.subchunk1id[1]!='m' || header.subchunk1id[2]!='t' || header.subchunk1id[3]!=' ') return 0; // incorrect header
+
+ fread( &header.subchunk1size, 4, 1, wavFile );
+ fread( &header.audioFormat, 2, 1, wavFile );
+ fread( &header.nofChannels, 2, 1, wavFile );
+ fread( &header.sampleRate, 4, 1, wavFile );
+ fread( &header.byteRate, 4, 1, wavFile );
+
+ fread( &header.blockAlign, 2, 1, wavFile );
+ fread( &header.bitsPerSample, 2, 1, wavFile );
+
+ fread( header.subchunk2id, 4, 1, wavFile );
+ if (header.subchunk2id[0]!='d' || header.subchunk2id[1]!='a' || header.subchunk2id[2]!='t' || header.subchunk2id[3]!='a') return 0; // incorrect header
+ fread( &header.subchunk2size, 4, 1, wavFile );
+
+
+ // the data follows.
+ if (header.subchunk2size<1) return 0;
+
+ CAudioBuffer *rval = new CAudioBuffer;
+ rval->m_nofChannels = header.nofChannels;
+ rval->m_bitsPerSample = header.bitsPerSample;
+ rval->m_samplesPerSec = header.sampleRate;
+ rval->m_signedData = 0; // where to know this?
+ rval->reallocate( header.subchunk2size );
+
+ fread( rval->m_data, 1, header.subchunk2size, wavFile );
+
+
+
+ // choose a good sampling function.
+ rval->m_sampleFunction = 0;
+ if (rval->m_nofChannels==1) {
+ if (rval->m_bitsPerSample == 8) rval->m_sampleFunction = sampleFunction8bitMono;
+ if (rval->m_bitsPerSample == 16) rval->m_sampleFunction = sampleFunction16bitMono;
+ } else {
+ if (rval->m_bitsPerSample == 8) rval->m_sampleFunction = sampleFunction8bitStereo;
+ if (rval->m_bitsPerSample == 16) rval->m_sampleFunction = sampleFunction16bitStereo;
+ }
+
+ return rval;
+};
+
+
+
+AUDIO_SAMPLE_TYPE CAudioBuffer::sampleFunction8bitMono( CAudioBuffer *abuffer, int pos, int channel ) {
+ return (AUDIO_SAMPLE_TYPE)(((unsigned char*)(abuffer->m_data))[pos]-128)<<8;
+};
+
+AUDIO_SAMPLE_TYPE CAudioBuffer::sampleFunction16bitMono( CAudioBuffer *abuffer, int pos, int channel ) {
+ return (AUDIO_SAMPLE_TYPE)(((short*)(abuffer->m_data))[pos]);
+};
+
+AUDIO_SAMPLE_TYPE CAudioBuffer::sampleFunction8bitStereo( CAudioBuffer *abuffer, int pos, int channel ) {
+ return ((AUDIO_SAMPLE_TYPE)(((char*)(abuffer->m_data))[pos*abuffer->m_nofChannels + channel])<<8);
+};
+
+
+AUDIO_SAMPLE_TYPE CAudioBuffer::sampleFunction16bitStereo( CAudioBuffer *abuffer, int pos, int channel ) {
+ return (AUDIO_SAMPLE_TYPE)(((short*)(abuffer->m_data))[pos*abuffer->m_nofChannels + channel]);
+};
+
+CAudioBufferPlayInstance *CAudioBuffer::playWithMixer( CAudioMixer &mixer ) {
+ CAudioBufferPlayInstance *i = (CAudioBufferPlayInstance*)mixer.addAudioSource( new CAudioBufferPlayInstance( this ));
+ return i;
+};
+
+
+CAudioBufferPlayInstance::CAudioBufferPlayInstance() {
+ m_fixedPos = 0;
+ m_fixedInc = 0;
+ m_buffer = 0;
+ m_fixedLeftVolume = 4096;
+ m_fixedRightVolume = 4096;
+ m_destroyWhenFinished = true;
+ m_finished = false;
+};
+
+CAudioBufferPlayInstance::CAudioBufferPlayInstance( CAudioBuffer *startPlaying ) {
+ m_fixedPos = 0;
+ m_fixedInc = 0;
+ m_fixedLeftVolume = 4096;
+ m_fixedRightVolume = 4096;
+ m_destroyWhenFinished = true;
+ m_finished = false;
+ playBuffer( startPlaying, 1.0f, 1.0f );
+};
+
+void CAudioBufferPlayInstance::playBuffer( CAudioBuffer *startPlaying, float volume, float speed, int loopTimes ) {
+ m_buffer = startPlaying;
+ m_fixedLeftVolume = (int)(4096.0f*volume);
+ m_fixedRightVolume = m_fixedLeftVolume;
+ m_fixedPos = 0;
+ //m_fixedInc = ( startPlaying->getSamplesPerSec() * (int)(4096.0f*speed)) / AUDIO_FREQUENCY;
+ setSpeed( speed );
+ m_loopTimes = loopTimes;
+
+};
+
+CAudioBufferPlayInstance::~CAudioBufferPlayInstance() {
+
+};
+
+
+void CAudioBufferPlayInstance::stop() {
+ m_buffer = 0;
+ m_finished = true;
+};
+
+void CAudioBufferPlayInstance::setSpeed( float speed ) {
+ if (!m_buffer) return;
+ m_fixedInc = (int)( ((float)m_buffer->getSamplesPerSec() * 4096.0f*speed) / (float)AUDIO_FREQUENCY );
+};
+
+void CAudioBufferPlayInstance::setLeftVolume( float vol ) {
+ m_fixedLeftVolume = (int)(4096.0f*vol);
+};
+
+void CAudioBufferPlayInstance::setRightVolume( float vol ) {
+ m_fixedRightVolume = (int)(4096.0f*vol);
+};
+
+bool CAudioBufferPlayInstance::canBeDestroyed() {
+ if (m_finished==true &&
+ m_destroyWhenFinished==true) return true; else return false;
+};
+
+
+
+// Does not do any bound-checking. Must be checked before called.
+int CAudioBufferPlayInstance::mixBlock( AUDIO_SAMPLE_TYPE *target, int samplesToMix ) {
+ SAMPLE_FUNCTION_TYPE sampleFunction = m_buffer->getSampleFunction();
+ if (!sampleFunction) return 0; // unsupported sampletype
+ AUDIO_SAMPLE_TYPE *t_target = target+samplesToMix*2;
+ int sourcepos;
+ //int tempCounter = 0;
+
+ if (m_buffer->getNofChannels() == 2) { // stereo
+ while (target!=t_target) {
+ sourcepos = m_fixedPos>>12;
+ target[0] = (((((sampleFunction)( m_buffer, sourcepos, 0) * (4096-(m_fixedPos&4095)) + (sampleFunction)( m_buffer, sourcepos+1, 0) * (m_fixedPos&4095) ) >> 12) * m_fixedLeftVolume) >> 12);
+ target[1] = (((((sampleFunction)( m_buffer, sourcepos, 1) * (4096-(m_fixedPos&4095)) + (sampleFunction)( m_buffer, sourcepos+1, 1) * (m_fixedPos&4095) ) >> 12) * m_fixedRightVolume) >> 12);
+ m_fixedPos+=m_fixedInc;
+ target+=2;
+ //tempCounter++;
+ };
+ } else { // mono
+ int temp;
+ while (target!=t_target) {
+ sourcepos = m_fixedPos>>12;
+ temp = (((sampleFunction)( m_buffer, sourcepos, 0 ) * (4096-(m_fixedPos&4095)) + (sampleFunction)( m_buffer, sourcepos+1, 0 ) * (m_fixedPos&4095) ) >> 12);
+ target[0] = ((temp*m_fixedLeftVolume)>>12);
+ target[1] = ((temp*m_fixedRightVolume)>>12);
+ m_fixedPos+=m_fixedInc;
+ target+=2;
+ //tempCounter++;
+ };
+
+ };
+
+ return samplesToMix;
+};
+
+
+
+int CAudioBufferPlayInstance::pullAudio( AUDIO_SAMPLE_TYPE *target, int bufferLength ) {
+ if (!m_buffer) return 0; // no sample associated to mix..
+
+ int channelLength = ((m_buffer->getDataLength()) / (m_buffer->getNofChannels()*m_buffer->getBytesPerSample()))-2;
+
+ int samplesToWrite = bufferLength/2;
+ int amount;
+ int totalMixed = 0;
+
+
+ while (samplesToWrite>0) {
+ int samplesLeft = channelLength - (m_fixedPos>>12);
+ int maxMixAmount = (int)(((long long int)(samplesLeft)<<12) / m_fixedInc ); // This is how much we can mix at least
+ //int maxMixAmount = (int)((float)samplesLeft / ((float)m_fixedInc/4096.0f));
+ //if (maxMixAmount<1) maxMixAmount = 1; // NOTE, THIS MIGHT CAUSE PROBLEMS. NEEDS CHECKING
+ if (maxMixAmount>samplesToWrite) {
+ maxMixAmount=samplesToWrite;
+ }
+
+ if (maxMixAmount > 0) {
+ amount=mixBlock(target+totalMixed * 2, maxMixAmount);
+
+ if (amount == 0)
+ {
+ // Error!
+ break;
+ }
+
+ totalMixed+=amount;
+ } else {
+ amount = 0;
+ m_fixedPos = channelLength<<12;
+ }
+
+ // sample is ended,.. check the looping variables and see what to do.
+ if ((m_fixedPos>>12)>=channelLength) {
+ m_fixedPos -= (channelLength<<12);
+ if (m_loopTimes>0) m_loopTimes--;
+ if (m_loopTimes==0) {
+ stop();
+ return totalMixed;
+ }
+ }
+
+ samplesToWrite-=amount;
+ if (samplesToWrite<1) break;
+ };
+ return totalMixed*2;
+};
diff --git a/demos/mobile/quickhit/ga_src/GEAudioBuffer.h b/demos/mobile/quickhit/ga_src/GEAudioBuffer.h
new file mode 100644
index 0000000..5fe5f00
--- /dev/null
+++ b/demos/mobile/quickhit/ga_src/GEAudioBuffer.h
@@ -0,0 +1,137 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef __GE_IGA_AUDIOBUFFER__
+#define __GE_IGA_AUDIOBUFFER__
+
+#include <QFile>
+#include "GEInterfaces.h"
+
+
+namespace GE {
+
+ class CAudioBufferPlayInstance;
+ class CAudioBuffer; // forward declaration
+ typedef AUDIO_SAMPLE_TYPE(*SAMPLE_FUNCTION_TYPE)(CAudioBuffer *abuffer, int pos, int channel);
+
+ class CAudioBuffer { // container for a sound
+ public:
+ CAudioBuffer();
+ virtual ~CAudioBuffer();
+
+ static CAudioBuffer* loadWav( QString fileName );
+ static CAudioBuffer* loadWav( FILE *wavFile ); // support for stdio
+ void reallocate( int length );
+
+
+ inline void* getRawData() { return m_data; }
+ inline int getDataLength() { return m_dataLength; }
+
+ inline int getBytesPerSample() { return (m_bitsPerSample>>3); }
+ inline int getBitsPerSample() { return m_bitsPerSample; }
+ inline int getSamplesPerSec() { return m_samplesPerSec; }
+ inline short getNofChannels() { return m_nofChannels; }
+ inline SAMPLE_FUNCTION_TYPE getSampleFunction() { return m_sampleFunction; }
+
+
+ // static implementations of sample functions
+ static AUDIO_SAMPLE_TYPE sampleFunction8bitMono( CAudioBuffer *abuffer, int pos, int channel );
+ static AUDIO_SAMPLE_TYPE sampleFunction16bitMono( CAudioBuffer *abuffer, int pos, int channel );
+ static AUDIO_SAMPLE_TYPE sampleFunction8bitStereo( CAudioBuffer *abuffer, int pos, int channel );
+ static AUDIO_SAMPLE_TYPE sampleFunction16bitStereo( CAudioBuffer *abuffer, int pos, int channel );
+
+ CAudioBufferPlayInstance *playWithMixer( GE::CAudioMixer &mixer );
+
+ protected:
+ SAMPLE_FUNCTION_TYPE m_sampleFunction;
+ short m_nofChannels;
+ void *m_data;
+ int m_dataLength; // in bytes
+ short m_bitsPerSample;
+ bool m_signedData;
+ int m_samplesPerSec;
+ };
+
+
+
+ class CAudioBufferPlayInstance : public IAudioSource {
+ public:
+ CAudioBufferPlayInstance();
+ CAudioBufferPlayInstance( CAudioBuffer *start_playing );
+ virtual ~CAudioBufferPlayInstance();
+ void playBuffer( CAudioBuffer *startPlaying, float volume, float fixedSpeed, int loopTimes = 0 ); // looptimes -1 = loop forever
+
+ void setSpeed( float speed );
+ void setLeftVolume( float lvol );
+ void setRightVolume( float rvol );
+
+
+ inline void setLoopTimes( int ltimes ) { m_loopTimes = ltimes; }
+ void stop();
+
+
+
+ int pullAudio( AUDIO_SAMPLE_TYPE *target, int bufferLength );
+ bool canBeDestroyed();
+
+ bool isPlaying() { if (m_buffer) return true; else return false; }
+ inline bool isFinished() { return m_finished; }
+ inline bool destroyWhenFinished() { return m_destroyWhenFinished; }
+ inline void setDestroyWhenFinished( bool set ) { m_destroyWhenFinished = set; }
+
+ protected:
+ int mixBlock( AUDIO_SAMPLE_TYPE *target, int bufferLength );
+ bool m_finished;
+ bool m_destroyWhenFinished;
+ int m_fixedPos;
+ int m_fixedInc;
+
+ int m_fixedLeftVolume;
+ int m_fixedRightVolume;
+ int m_fixedCenter;
+ int m_loopTimes;
+ CAudioBuffer *m_buffer;
+ };
+
+};
+
+
+
+#endif
diff --git a/demos/mobile/quickhit/ga_src/GEAudioOut.cpp b/demos/mobile/quickhit/ga_src/GEAudioOut.cpp
new file mode 100644
index 0000000..73a765c
--- /dev/null
+++ b/demos/mobile/quickhit/ga_src/GEAudioOut.cpp
@@ -0,0 +1,144 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/qstring.h>
+#include <QAudioOutput>
+
+#include "GEAudioOut.h"
+
+using namespace GE;
+//using namespace QTM_NAMESPACE;
+
+/*
+#ifndef Q_OS_WIN32
+QTM_USE_NAMESPACE
+#endif
+*/
+
+const int CHANNELS = 2;
+const QString CODEC = "audio/pcm";
+const QAudioFormat::Endian BYTEORDER = QAudioFormat::LittleEndian;
+const QAudioFormat::SampleType SAMTYPE = QAudioFormat::SignedInt;
+
+
+
+AudioOut::AudioOut( QObject *parent, GE::IAudioSource *source ) : QThread(parent) { // qobject
+ m_source = source;
+ QAudioFormat format;
+ format.setFrequency(AUDIO_FREQUENCY);
+ format.setChannels(CHANNELS);
+ format.setSampleSize(AUDIO_SAMPLE_BITS);
+ format.setCodec(CODEC);
+ format.setByteOrder(BYTEORDER);
+ format.setSampleType(SAMTYPE);
+
+ QAudioDeviceInfo info(QAudioDeviceInfo::defaultOutputDevice());
+ if (!info.isFormatSupported(format))
+ format = info.nearestFormat(format);
+
+
+ m_audioOutput = new QAudioOutput(info,format);
+
+#ifdef Q_WS_MAEMO_5
+ m_audioOutput->setBufferSize(20000);
+ m_sendBufferSize = 5000;
+#else
+ m_audioOutput->setBufferSize(16000);
+ m_sendBufferSize = 4000;
+#endif
+
+ m_outTarget = m_audioOutput->start();
+
+
+ m_sendBuffer = new AUDIO_SAMPLE_TYPE[ m_sendBufferSize ];
+ m_samplesMixed = 0;
+
+ m_runstate=0;
+
+#ifndef Q_OS_SYMBIAN
+ start();
+#else
+ m_audioOutput->setNotifyInterval(5);
+ connect(m_audioOutput,SIGNAL(notify()),SLOT(audioNotify()));
+#endif
+
+};
+
+
+AudioOut::~AudioOut() {
+ if (m_runstate==0) m_runstate = 1;
+ if (QThread::isRunning() == false) m_runstate = 2;
+ while (m_runstate!=2) { msleep(50); } // wait until the thread is finished
+ m_audioOutput->stop();
+ delete m_audioOutput;
+ delete [] m_sendBuffer;
+};
+
+
+void AudioOut::audioNotify() {
+ tick();
+};
+
+void AudioOut::tick() {
+ // fill data to buffer as much as free space is available..
+ int samplesToWrite = m_audioOutput->bytesFree() / (CHANNELS*AUDIO_SAMPLE_BITS/8);
+ samplesToWrite*=2;
+
+ if (samplesToWrite > m_sendBufferSize) samplesToWrite = m_sendBufferSize;
+ if (samplesToWrite<=0) return;
+ int mixedSamples = m_source->pullAudio( m_sendBuffer, samplesToWrite );
+ m_outTarget->write( (char*)m_sendBuffer, mixedSamples*2 );
+
+};
+
+
+void AudioOut::run() {
+ if (!m_source) { m_runstate=2; return; }
+ int sleepTime = m_sendBufferSize * 340 / AUDIO_FREQUENCY;
+ if (sleepTime<2) sleepTime = 2;
+
+ while (m_runstate==0) {
+ tick();
+ msleep(sleepTime);
+ };
+ m_runstate = 2;
+};
+
+
diff --git a/demos/mobile/quickhit/ga_src/GEAudioOut.h b/demos/mobile/quickhit/ga_src/GEAudioOut.h
new file mode 100644
index 0000000..dc1f744
--- /dev/null
+++ b/demos/mobile/quickhit/ga_src/GEAudioOut.h
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef __GE_QTAUDIOOUT__
+#define __GE_QTAUDIOOUT__
+
+#include <QtCore/qobject.h>
+#include <QtCore/qfile.h>
+#include <QtMultimedia>
+#include <QtCore/qtimer.h>
+#include <QtCore/qstring.h>
+#include <QThread>
+
+#include "GEInterfaces.h"
+
+
+class QAudioOutput;
+
+namespace GE {
+
+
+
+ class AudioOut : public QThread {
+ Q_OBJECT
+
+ public:
+ AudioOut(QObject *parent, GE::IAudioSource *source);
+ virtual ~AudioOut();
+
+
+
+ private slots:
+ void audioNotify(); // for internal notify "solution"
+
+
+ protected:
+ void tick();
+ virtual void run(); // this is for the threaded mode only
+
+
+ qint64 m_samplesMixed;
+
+ QAudioOutput *m_audioOutput;
+ QIODevice *m_outTarget;
+ GE::IAudioSource *m_source;
+ int m_runstate;
+ AUDIO_SAMPLE_TYPE *m_sendBuffer;
+ int m_sendBufferSize;
+ };
+}
+
+#endif
diff --git a/demos/mobile/quickhit/ga_src/GEInterfaces.cpp b/demos/mobile/quickhit/ga_src/GEInterfaces.cpp
new file mode 100644
index 0000000..a71f738
--- /dev/null
+++ b/demos/mobile/quickhit/ga_src/GEInterfaces.cpp
@@ -0,0 +1,177 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <memory.h>
+#include "GEInterfaces.h"
+
+
+using namespace GE;
+
+/**
+ * CAudioSource
+ * common functionality
+ *
+ */
+IAudioSource::IAudioSource() {
+ m_next = 0;
+};
+
+IAudioSource::~IAudioSource() {
+
+
+};
+
+/**
+ * CAudioMixer
+ *
+ */
+CAudioMixer::CAudioMixer() {
+ m_sourceList = 0;
+ m_mixingBuffer = 0;
+ m_mixingBufferLength = 0;
+ m_fixedGeneralVolume = 4096;
+};
+
+
+CAudioMixer::~CAudioMixer() {
+ destroyList();
+ if (m_mixingBuffer) {
+ delete [] m_mixingBuffer;
+ m_mixingBuffer = 0;
+ };
+};
+
+void CAudioMixer::destroyList() {
+ m_mutex.lock();
+ IAudioSource *l = m_sourceList;
+ while (l) {
+ IAudioSource *n = l->m_next;
+ delete l;
+ l = n;
+ };
+ m_sourceList = 0;
+ m_mutex.unlock();
+};
+
+
+IAudioSource* CAudioMixer::addAudioSource( IAudioSource *source ) {
+ m_mutex.lock();
+ source->m_next = 0;
+ if (m_sourceList) {
+ IAudioSource *l = m_sourceList;
+ while (l->m_next) l = l->m_next;
+ l->m_next = source;
+ } else m_sourceList = source;
+ m_mutex.unlock();
+ return source;
+
+};
+
+
+bool CAudioMixer::removeAudioSource( IAudioSource *source ) {
+ return true;
+};
+
+void CAudioMixer::setGeneralVolume( float vol ) {
+ m_fixedGeneralVolume = (4096.0f*vol);
+};
+
+int CAudioMixer::pullAudio( AUDIO_SAMPLE_TYPE *target, int bufferLength ) {
+
+ if (!m_sourceList) return 0;
+
+ m_mutex.lock();
+
+
+ if (m_mixingBufferLength<bufferLength) {
+ if (m_mixingBuffer) delete [] m_mixingBuffer;
+ m_mixingBufferLength = bufferLength;
+ m_mixingBuffer = new AUDIO_SAMPLE_TYPE[ m_mixingBufferLength ];
+ };
+
+ memset( target, 0, sizeof( AUDIO_SAMPLE_TYPE ) * bufferLength );
+
+ AUDIO_SAMPLE_TYPE *t;
+ AUDIO_SAMPLE_TYPE *t_target;
+ AUDIO_SAMPLE_TYPE *s;
+
+ IAudioSource *prev = 0;
+ IAudioSource *l = m_sourceList;
+ while (l) {
+ IAudioSource *next = l->m_next;
+
+ // process l
+ int mixed = l->pullAudio( m_mixingBuffer, bufferLength );
+ if (mixed>0) {
+ // mix to main..
+ t = target;
+ t_target = t+mixed;
+ s = m_mixingBuffer;
+ while (t!=t_target) {
+ *t +=(((*s)*m_fixedGeneralVolume)>>12);
+ t++;
+ s++;
+ };
+ };
+
+
+
+ // autodestroy
+ if (l->canBeDestroyed() == true) { // NOTE, IS UNDER TESTING,... MIGHT CAUSE UNPREDICTABLE CRASHING WITH SOME USE CASES!!!
+ if (!prev)
+ m_sourceList = next;
+ else prev->m_next = next;
+ delete l;
+ l = 0;
+ };
+
+
+
+
+ prev = l;
+ l = next;
+ };
+ m_mutex.unlock();
+ return bufferLength;
+};
+
+
+
+
diff --git a/demos/mobile/quickhit/ga_src/GEInterfaces.h b/demos/mobile/quickhit/ga_src/GEInterfaces.h
new file mode 100644
index 0000000..7abd984
--- /dev/null
+++ b/demos/mobile/quickhit/ga_src/GEInterfaces.h
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef __GE_IGA_INTERFACES__
+#define __GE_IGA_INTERFACES__
+
+#include <QMutex>
+
+namespace GE {
+
+#define AUDIO_FREQUENCY 22050
+#define AUDIO_SAMPLE_TYPE short
+#define AUDIO_SAMPLE_BITS 16
+
+ class IAudioSource {
+ public:
+ IAudioSource();
+ virtual ~IAudioSource();
+
+ virtual int pullAudio( AUDIO_SAMPLE_TYPE *target, int bufferLength ) = 0;
+ virtual bool canBeDestroyed() { return false; }
+
+ IAudioSource *m_next; // for listing, do not touch if you dont know what you are doing.
+ };
+
+
+ class CAudioMixer : public IAudioSource {
+ public:
+ CAudioMixer();
+ virtual ~CAudioMixer();
+ void destroyList(); // destroy all the sources in the list
+
+
+ IAudioSource* addAudioSource( IAudioSource *s ); // add new audio source to the list
+ bool removeAudioSource( IAudioSource *s ); // remove an audio source from the list
+ int pullAudio( AUDIO_SAMPLE_TYPE *target, int bufferLength );
+ void setGeneralVolume( float vol );
+
+
+ protected:
+ QMutex m_mutex;
+ int m_fixedGeneralVolume;
+ AUDIO_SAMPLE_TYPE *m_mixingBuffer;
+ int m_mixingBufferLength;
+ IAudioSource *m_sourceList;
+ };
+
+};
+
+
+#endif
diff --git a/demos/mobile/quickhit/gameengine.cpp b/demos/mobile/quickhit/gameengine.cpp
new file mode 100644
index 0000000..99e7d53
--- /dev/null
+++ b/demos/mobile/quickhit/gameengine.cpp
@@ -0,0 +1,592 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "gameengine.h"
+#include "plugins/levelplugininterface.h"
+#include "InvSounds.h"
+
+#include <QDebug>
+#include <QTimerEvent>
+#include <QTime>
+#include <QDesktopServices>
+
+const int TIMER_SPEED = 80;
+
+GameEngine::GameEngine(QObject* parent)
+ :QObject(parent)
+{
+ m_timerId = 0;
+ m_doEnemyMissile = 1500 / TIMER_SPEED;
+ m_GameGml = 0;
+ m_gameLevel = 0;
+
+ clearQmlObjects();
+
+ // For random
+ QTime time = QTime::currentTime();
+ qsrand((uint)time.msec());
+
+ // Sound engine
+ m_soundEngine = new CInvSounds(this);
+
+ // Device profile
+ m_silent = false;
+
+#ifdef Q_OS_SYMBIAN
+ iVibrate = CHWRMVibra::NewL();
+#endif
+
+ // Get device profile, is it silent?
+#if defined Q_OS_SYMBIAN || defined Q_WS_MAEMO_5
+ m_systemDeviceInfo = new QSystemDeviceInfo(this);
+ QObject::connect(m_systemDeviceInfo,SIGNAL(currentProfileChanged(QSystemDeviceInfo::Profile)),this,
+ SLOT(currentProfileChanged(QSystemDeviceInfo::Profile)));
+ QSystemDeviceInfo::Profile p = m_systemDeviceInfo->currentProfile();
+ if (p == QSystemDeviceInfo::SilentProfile) {
+ m_silent = true;
+ }
+#endif
+
+}
+
+
+GameEngine::~GameEngine()
+{
+#ifdef Q_OS_SYMBIAN
+ delete iVibrate;
+#endif
+
+}
+
+void GameEngine::gameStartSound()
+{
+ if (!m_silent)
+ m_soundEngine->gameStartSound();
+}
+
+#if defined Q_OS_SYMBIAN || defined Q_WS_MAEMO_5
+void GameEngine::currentProfileChanged(QSystemDeviceInfo::Profile p)
+{
+ if (p == QSystemDeviceInfo::SilentProfile) {
+ enableSounds(QVariant(false));
+ } else {
+ enableSounds(QVariant(true));
+ }
+}
+#endif
+
+void GameEngine::enableSounds(QVariant enable)
+{
+ m_silent = !enable.toBool();
+
+ if (m_silent)
+ this->m_soundEngine->enableSounds(false);
+ else
+ this->m_soundEngine->enableSounds(true);
+
+}
+
+QVariant GameEngine::randInt(QVariant low, QVariant high)
+{
+ // Random number between low and high
+ return qrand() % ((high.toInt() + 1) - low.toInt()) + low.toInt();
+}
+
+void GameEngine::setGameLevel(LevelPluginInterface* level)
+{
+ // Set used game level
+ m_gameLevel = level;
+
+ if (m_gameLevel) {
+ // Set used sound from the level into sound engine
+ m_soundEngine->enableSounds(m_gameLevel->levelSounds());
+ // Invoke QML to take new level in use
+ QMetaObject::invokeMethod(m_GameGml, "levelReadyForCreation", Qt::AutoConnection);
+
+ m_doEnemyMissile = m_gameLevel->enemyFireSpeed().toInt() / TIMER_SPEED;
+ }
+}
+
+void GameEngine::setPluginList(QList<QPluginLoader*> plugins)
+{
+ m_pluginList = plugins;
+}
+
+QVariant GameEngine::pluginList()
+{
+ QStringList list;
+ QPluginLoader* loader;
+ foreach (loader,m_pluginList) {
+ QString s = loader->fileName();
+ s = s.mid(s.lastIndexOf("/")+1);
+ s = s.left(s.lastIndexOf("."));
+ s = s.toUpper();
+#ifdef Q_WS_MAEMO_5
+ if (s.contains("LIB")) {
+ s = s.right(s.length() - (s.indexOf("LIB")+3));
+ }
+#endif
+ list.append(s);
+ }
+ return QVariant(list);
+}
+
+void GameEngine::pauseLevel(QVariant doPause)
+{
+ bool enableTimer = !doPause.toBool();
+ enableEngineTimer(QVariant(enableTimer));
+ QMetaObject::invokeMethod(m_levelQml, "pause", Qt::AutoConnection,Q_ARG(QVariant, doPause));
+}
+
+
+void GameEngine::findQmlObjects()
+{
+ if (m_GameGml) {
+ qDebug() << "GameEngine::findQmlObjects()";
+
+ // Find Missiles objects
+ m_missileList.clear();
+ m_enemyMissileList.clear();
+ findMissiles(m_GameGml);
+
+ // Set QMLs
+ setLevelQml(m_GameGml->findChild<QObject*>("level"));
+ setEnemiesGridQml(m_GameGml->findChild<QObject*>("enemiesGrid"));
+ setMyShipQml(m_GameGml->findChild<QObject*>("myShip"));
+
+ // Find Enemies objects
+ m_enemyList.clear();
+ qDebug() << "GameEngine::findQmlObjects() find enemies from: level QML";
+ findEnemies(m_levelQml);
+
+
+ } else {
+ qDebug() << "GameEngine::findQmlObjects() rootObject NULL";
+ }
+}
+
+void GameEngine::clearQmlObjects()
+{
+ m_missileList.clear();
+ m_enemyMissileList.clear();
+ m_enemyList.clear();
+ m_levelQml = 0;
+ m_enemiesGridGml = 0;
+ m_myShipGml = 0;
+ //m_GameGml = 0; // NOTE: Do not delete this
+}
+
+
+void GameEngine::findMissiles(QObject *rootObject)
+{
+ if (rootObject) {
+ QObjectList list = rootObject->children();
+ QObject* item;
+ foreach (item,list) {
+ if (item->children().count()>0) {
+ findMissiles(item);
+ } else {
+ if (rootObject->objectName()=="missile") {
+ QDeclarativeItem* missile = static_cast<QDeclarativeItem*>(rootObject);
+ m_missileList.append(missile);
+ } else if (rootObject->objectName()=="enemy_missile") {
+ QDeclarativeItem* enemyMissile = static_cast<QDeclarativeItem*>(rootObject);
+ m_enemyMissileList.append(enemyMissile);
+ }
+ }
+ }
+ } else {
+ qDebug() << "GameEngine::findMissiles() rootObject NULL";
+ }
+}
+
+void GameEngine::findEnemies(QObject *rootObject)
+{
+ if (rootObject) {
+ QObjectList list = rootObject->children();
+ QObject* item;
+ foreach (item,list) {
+ if (item->children().count()>0 && item->objectName()!="enemy") {
+ //qDebug() << "Enemy children found from: " << item->objectName();
+ findEnemies(item);
+ } else {
+ if (item->objectName()=="enemy") {
+ //qDebug() << "Enemy child founds: " << item->objectName();
+ QDeclarativeItem* enemy = static_cast<QDeclarativeItem*>(item);
+ m_enemyList.append(enemy);
+ }
+ }
+ }
+ } else {
+ qDebug() << "GameEngine::findEnemies() rootObject NULL";
+ }
+}
+
+void GameEngine::setEnemiesGridQml(QObject* o)
+{
+ m_enemiesGridGml = static_cast<QDeclarativeItem*>(o);
+}
+
+void GameEngine::setMyShipQml(QObject* o)
+{
+ m_myShipGml = static_cast<QDeclarativeItem*>(o);
+}
+
+void GameEngine::setGameQml(QObject* o)
+{
+ m_GameGml = static_cast<QDeclarativeItem*>(o);
+}
+
+
+void GameEngine::timerEvent(QTimerEvent *e)
+{
+ if (e->timerId()==m_timerId) {
+ // Do hit test
+ doHitTest();
+
+ m_doEnemyMissile--;
+
+ if (m_gameLevel && m_doEnemyMissile<0) {
+ m_doEnemyMissile = m_gameLevel->enemyFireSpeed().toInt() / TIMER_SPEED;
+ // Do emeny missile launch
+ doEnemyMissile();
+ }
+ }
+}
+
+void GameEngine::enableEngineTimer(QVariant enable)
+{
+ if (m_gameLevel) {
+ if (m_timerId==0 && enable.toBool()) {
+ m_timerId = QObject::startTimer(TIMER_SPEED);
+ }
+ else if (m_timerId != 0 && !enable.toBool()) {
+ QObject::killTimer(m_timerId);
+ m_timerId = 0;
+ }
+ }
+}
+
+void GameEngine::selectVisibleEnemy(int& start, int& end)
+{
+ QDeclarativeItem* enemy = 0;
+ for (int i=0 ; i<m_enemyList.count() ; i++) {
+ enemy = m_enemyList[i];
+ if (enemy->opacity()==1) {
+ start = i;
+ break;
+ }
+ }
+ enemy = 0;
+ for (int e=m_enemyList.count()-1 ; e>0 ; e--) {
+ enemy = m_enemyList[e];
+ if (enemy->opacity()==1) {
+ end = e;
+ break;
+ }
+ }
+}
+
+void GameEngine::doEnemyMissile()
+{
+ QMutexLocker locker(&m_enemyListMutex);
+
+ QDeclarativeItem* missile = 0;
+ QDeclarativeItem* enemy = 0;
+
+ // Find free missile
+ foreach (missile, m_enemyMissileList) {
+ if (missile->opacity()==0){
+ // Random select enemy who fire
+ int start=0; int end=0;
+ selectVisibleEnemy(start,end);
+ int whoWillFire = randInt(QVariant(start),QVariant(end)).toInt();
+ if (m_enemyList.count() < whoWillFire+1)
+ break;
+
+ enemy = m_enemyList.at(whoWillFire);
+ if (enemy && enemy->opacity()==1) {
+ QPointF enemyP = enemy->pos();
+ if (m_enemiesGridGml) {
+ enemyP += m_enemiesGridGml->pos();
+ }
+ //qDebug() << "QMetaObject::invokeMethod() - fireEnemyMissile";
+ QMetaObject::invokeMethod(m_GameGml, "fireEnemyMissile", Qt::AutoConnection,
+ Q_ARG(QVariant, enemyP.x()+enemy->boundingRect().width()/4),
+ Q_ARG(QVariant, enemyP.y()+enemy->boundingRect().height()),
+ Q_ARG(QVariant, m_GameGml->boundingRect().height()));
+ }
+ break;
+ }
+ }
+}
+
+void GameEngine::doHitTest()
+{
+ QMutexLocker locker(&m_enemyListMutex);
+
+ QDeclarativeItem* missile = 0;
+ QDeclarativeItem* enemy = 0;
+
+ // No enemies?
+ if (m_enemyList.count()==0) {
+ enableEngineTimer(QVariant(false));
+ qDebug() << "No enemies left";
+ gameOver(true);
+ return;
+ }
+
+ if (!m_myShipGml) {
+ return;
+ }
+
+ // Check ship collision
+ if (m_myShipGml->opacity()==1) {
+ for (int e=0; e<m_enemyList.count(); e++) {
+ enemy = m_enemyList[e];
+ if (enemy->opacity()==0) {
+ break;
+ }
+ QPointF enemyP = enemy->pos();
+ if (m_enemiesGridGml) {
+ enemyP += m_enemiesGridGml->pos();
+ }
+ QRectF enemyR(enemyP,QSize(enemy->boundingRect().width(),enemy->boundingRect().height()));
+ // Collision?
+ if (enemyR.contains(m_myShipGml->pos())) {
+ enableEngineTimer(QVariant(false));
+
+ // Collision explosion
+ QPointF myP = m_myShipGml->pos();
+ playSound(1);
+ QMetaObject::invokeMethod(m_levelQml, "explode", Qt::AutoConnection,
+ Q_ARG(QVariant, myP.x()+m_myShipGml->boundingRect().width()/2),
+ Q_ARG(QVariant, myP.y()+m_myShipGml->boundingRect().height()));
+ m_myShipGml->setOpacity(0);
+
+ gameOver(false);
+ qDebug() << "Collision";
+ return;
+ }
+ // Enemy too deep?
+ else if (enemyR.bottomLeft().y() > m_myShipGml->pos().y()+m_myShipGml->pos().y()*0.1) {
+ enableEngineTimer(QVariant(false));
+
+ // Enemy too deep explosion
+ QPointF myP = m_myShipGml->pos();
+ playSound(1);
+ QMetaObject::invokeMethod(m_levelQml, "explode", Qt::AutoConnection,
+ Q_ARG(QVariant, myP.x()+m_myShipGml->boundingRect().width()/2),
+ Q_ARG(QVariant, myP.y()+m_myShipGml->boundingRect().height()));
+ m_myShipGml->setOpacity(0);
+
+ gameOver(false);
+ qDebug() << "Enemy too deep";
+ return;
+ }
+ }
+ }
+
+ // Check your missiles hit to enemies
+ foreach (missile, m_missileList) {
+ if (missile->opacity()==1){
+ for (int e=0; e<m_enemyList.count(); e++) {
+ enemy = m_enemyList[e];
+ if (enemy->opacity()<1) {
+ break;
+ }
+ QPointF missileP = missile->pos();
+ missileP.setX(missileP.rx() + missile->boundingRect().width()/2);
+
+ QPointF enemyP = enemy->pos();
+ if (m_enemiesGridGml) {
+ enemyP += m_enemiesGridGml->pos();
+ }
+
+ QRectF r(enemyP,QSize(enemy->boundingRect().width(),enemy->boundingRect().height()));
+ if (r.contains(missileP)) {
+ // Hit !
+ playSound(0);
+ //qDebug() << "QMetaObject::invokeMethod() - explode";
+ QMetaObject::invokeMethod(m_levelQml, "explode", Qt::AutoConnection,
+ Q_ARG(QVariant, enemyP.x()+enemy->boundingRect().width()/2),
+ Q_ARG(QVariant, enemyP.y()+enemy->boundingRect().height()));
+ missile->setOpacity(0);
+ //fastVibra();
+ if (m_enemiesGridGml) {
+ // Set transparent placeholder for enemy when using GridView
+ enemy->setProperty("source",QVariant("file:/"+m_gameLevel->pathToTransparentEnemyPic().toString()));
+ } else {
+ // Hide enemy after explode
+ enemy->setOpacity(0);
+ }
+
+ // Remove enemy from list
+ m_enemyList.removeAt(e);
+ e--;
+ }
+ enemy = 0;
+ }
+ }
+ }
+
+ // Check enemies missiles hit to you
+ if (m_myShipGml->opacity()==1) {
+ foreach (missile, m_enemyMissileList) {
+ if (missile->opacity()==1){
+ QPointF missileP = missile->pos();
+ missileP.setX(missileP.rx() + missile->boundingRect().width()/2);
+
+ QPointF myP = m_myShipGml->pos();
+
+ QRectF r(myP,QSize(m_myShipGml->boundingRect().width(),m_myShipGml->boundingRect().height()));
+ if (r.contains(missileP)) {
+ // Hit !
+ playSound(1);
+ //qDebug() << "QMetaObject::invokeMethod() - explode";
+ QMetaObject::invokeMethod(m_levelQml, "explode", Qt::AutoConnection,
+ Q_ARG(QVariant, myP.x()+m_myShipGml->boundingRect().width()/2),
+ Q_ARG(QVariant, myP.y()+m_myShipGml->boundingRect().height()));
+ missile->setOpacity(0);
+ m_myShipGml->setOpacity(0);
+ break;
+ }
+ }
+ }
+ } else {
+ // You was killed
+ enableEngineTimer(QVariant(false));
+ gameOver(false);
+ qDebug() << "You was killed by enemy missile";
+ }
+
+}
+
+
+void GameEngine::playSound(QVariant index)
+{
+ if (!m_silent) {
+ int i = index.toInt();
+ m_soundEngine->playSound(i);
+ }
+}
+
+void GameEngine::playSounds(QVariant index, QVariant count)
+{
+ if (!m_silent) {
+ m_soundEngine->playSounds(index.toInt(),count.toInt());
+ }
+}
+
+void GameEngine::playInternalSound(QVariant index)
+{
+ if (!m_silent) {
+ m_soundEngine->playInternalSound(index.toInt());
+ }
+}
+
+void GameEngine::playInternalSounds(QVariant index, QVariant count)
+{
+ if (!m_silent) {
+ m_soundEngine->playInternalSounds(index.toInt(),count.toInt());
+ }
+}
+
+void GameEngine::gameOver(bool youWin)
+{
+ qDebug() << "GameEngine::gameOver() "<< youWin;
+ QMetaObject::invokeMethod(m_GameGml, "gameOver", Qt::AutoConnection,Q_ARG(QVariant, youWin));
+}
+
+void GameEngine::pauseGame() {
+ QMetaObject::invokeMethod(m_GameGml, "pauseGame", Qt::AutoConnection);
+}
+
+
+QVariant GameEngine::isSymbian()
+{
+#ifdef Q_OS_SYMBIAN
+ return QVariant(true);
+#else
+ return QVariant(false);
+#endif
+}
+
+QVariant GameEngine::isMaemo()
+{
+#ifdef Q_WS_MAEMO_5
+ return QVariant(true);
+#else
+ return QVariant(false);
+#endif
+}
+
+QVariant GameEngine::isWindows()
+{
+#ifdef Q_OS_WIN
+ return QVariant(true);
+#else
+ return QVariant(false);
+#endif
+}
+
+void GameEngine::vibra()
+{
+#ifdef Q_OS_SYMBIAN
+ if (iVibrate){
+ TRAPD(err, iVibrate->StartVibraL(4000,KHWRMVibraMaxIntensity));
+ }
+#endif
+}
+
+void GameEngine::fastVibra()
+{
+#ifdef Q_OS_SYMBIAN
+ if (iVibrate){
+ TRAPD(err, iVibrate->StartVibraL(100,KHWRMVibraMaxIntensity));
+ }
+#endif
+}
+
+void GameEngine::openLink(QVariant link)
+{
+QDesktopServices::openUrl(QUrl(link.toString()));
+}
+
diff --git a/demos/mobile/quickhit/gameengine.h b/demos/mobile/quickhit/gameengine.h
new file mode 100644
index 0000000..c8c8b8c
--- /dev/null
+++ b/demos/mobile/quickhit/gameengine.h
@@ -0,0 +1,148 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef GAMEENGINE_H
+#define GAMEENGINE_H
+
+#include <QObject>
+#include <QDeclarativeItem>
+#include <QMutex>
+#include <QPluginLoader>
+#include <QList>
+
+#ifdef Q_OS_SYMBIAN
+#include <hwrmvibra.h>
+#endif
+
+// QtMobility
+#if defined Q_OS_SYMBIAN || defined Q_WS_MAEMO_5
+#include <QSystemDeviceInfo>
+QTM_USE_NAMESPACE
+#endif
+
+class CInvSounds;
+class LevelPluginInterface;
+class GameEngine : public QObject
+{
+ Q_OBJECT
+
+public:
+ GameEngine(QObject* parent);
+ ~GameEngine();
+ void timerEvent(QTimerEvent *);
+ void setGameLevel(LevelPluginInterface* level);
+ void setPluginList(QList<QPluginLoader*> plugins);
+ void pauseGame();
+
+public:
+ Q_INVOKABLE void enableEngineTimer(QVariant enable);
+ Q_INVOKABLE QVariant randInt(QVariant low, QVariant high);
+ Q_INVOKABLE void enableSounds(QVariant enable);
+ Q_INVOKABLE void playSound(QVariant index);
+ Q_INVOKABLE void playSounds(QVariant index, QVariant count);
+ Q_INVOKABLE void playInternalSound(QVariant index);
+ Q_INVOKABLE void playInternalSounds(QVariant index, QVariant count);
+ Q_INVOKABLE QVariant pluginList();
+ Q_INVOKABLE void findQmlObjects();
+ Q_INVOKABLE void clearQmlObjects();
+ Q_INVOKABLE void pauseLevel(QVariant doPause);
+ Q_INVOKABLE void gameStartSound();
+
+ Q_INVOKABLE QVariant isSymbian();
+ Q_INVOKABLE QVariant isMaemo();
+ Q_INVOKABLE QVariant isWindows();
+
+ Q_INVOKABLE void vibra();
+ Q_INVOKABLE void fastVibra();
+
+ Q_INVOKABLE void openLink(QVariant link);
+
+
+private slots:
+#if defined Q_OS_SYMBIAN || defined Q_WS_MAEMO_5
+ void currentProfileChanged (QSystemDeviceInfo::Profile);
+#endif
+
+public:
+ void setGameQml(QObject* o);
+
+private:
+ void findMissiles(QObject* rootObject);
+ void findEnemies(QObject* rootObject);
+ void setLevelQml(QObject* o) {m_levelQml = o;}
+ void setEnemiesGridQml(QObject* o);
+ void setMyShipQml(QObject* o);
+ void gameOver(bool youWin);
+ void selectVisibleEnemy(int& start, int& end);
+
+private:
+ void doHitTest();
+ void doEnemyMissile();
+
+private:
+ bool m_enableEnemyMissiles;
+ QMutex m_enemyListMutex;
+ QList<QDeclarativeItem*> m_enemyList;
+ QList<QDeclarativeItem*> m_missileList;
+ QList<QDeclarativeItem*> m_enemyMissileList;
+ QObject* m_levelQml;
+ QDeclarativeItem* m_enemiesGridGml;
+ QDeclarativeItem* m_myShipGml;
+ QDeclarativeItem* m_GameGml;
+
+ LevelPluginInterface* m_gameLevel;
+ CInvSounds* m_soundEngine;
+ QList<QPluginLoader*> m_pluginList;
+
+ int m_timerId;
+ int m_doEnemyMissile;
+
+#if defined Q_OS_SYMBIAN || defined Q_WS_MAEMO_5
+ QSystemDeviceInfo* m_systemDeviceInfo;
+#endif
+ bool m_silent;
+
+#ifdef Q_OS_SYMBIAN
+ CHWRMVibra* iVibrate;
+#endif
+
+};
+
+#endif // GAMEENGINE_H
diff --git a/demos/mobile/quickhit/gfx/back.png b/demos/mobile/quickhit/gfx/back.png
new file mode 100644
index 0000000..bb66f74
--- /dev/null
+++ b/demos/mobile/quickhit/gfx/back.png
Binary files differ
diff --git a/demos/mobile/quickhit/gfx/background2.png b/demos/mobile/quickhit/gfx/background2.png
new file mode 100644
index 0000000..c81875a
--- /dev/null
+++ b/demos/mobile/quickhit/gfx/background2.png
Binary files differ
diff --git a/demos/mobile/quickhit/gfx/bigship.png b/demos/mobile/quickhit/gfx/bigship.png
new file mode 100644
index 0000000..b88dc32
--- /dev/null
+++ b/demos/mobile/quickhit/gfx/bigship.png
Binary files differ
diff --git a/demos/mobile/quickhit/gfx/exit.png b/demos/mobile/quickhit/gfx/exit.png
new file mode 100644
index 0000000..a45abd6
--- /dev/null
+++ b/demos/mobile/quickhit/gfx/exit.png
Binary files differ
diff --git a/demos/mobile/quickhit/gfx/pause.png b/demos/mobile/quickhit/gfx/pause.png
new file mode 100644
index 0000000..0570908
--- /dev/null
+++ b/demos/mobile/quickhit/gfx/pause.png
Binary files differ
diff --git a/demos/mobile/quickhit/gfx/quickhit_logo.png b/demos/mobile/quickhit/gfx/quickhit_logo.png
new file mode 100644
index 0000000..0b505c7
--- /dev/null
+++ b/demos/mobile/quickhit/gfx/quickhit_logo.png
Binary files differ
diff --git a/demos/mobile/quickhit/gfx/soundOff.png b/demos/mobile/quickhit/gfx/soundOff.png
new file mode 100644
index 0000000..fed8520
--- /dev/null
+++ b/demos/mobile/quickhit/gfx/soundOff.png
Binary files differ
diff --git a/demos/mobile/quickhit/gfx/soundOn.png b/demos/mobile/quickhit/gfx/soundOn.png
new file mode 100644
index 0000000..03bd80e
--- /dev/null
+++ b/demos/mobile/quickhit/gfx/soundOn.png
Binary files differ
diff --git a/demos/mobile/quickhit/icon.svg b/demos/mobile/quickhit/icon.svg
new file mode 100644
index 0000000..3795e8d
--- /dev/null
+++ b/demos/mobile/quickhit/icon.svg
@@ -0,0 +1,305 @@
+<?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="128"
+ height="128"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.48.0 r9654"
+ sodipodi:docname="New document 1">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="2.8"
+ inkscape:cx="151.3239"
+ inkscape:cy="33.99485"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1680"
+ inkscape:window-height="1003"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1" />
+ <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" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-924.36218)">
+ <image
+ y="924.6955"
+ x="-0.20219566"
+ id="image2993"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABHNCSVQICAgIfAhkiAAAIABJREFU
+eJztvWmwZdd1HvatPZxz7vDm169HdANozA0QBCmKFBCKIGmpaJFlhYloKypJsUpUEvtHVJVQJblU
+KlmlHxQVJT/ilEuRVJVU+Y9t2VbRYlGxhsQUpYikJBAEAZAYuoGe3jzd+Zyzh5Uf+5xzz32vmwbR
+/V73Q7hQF/f1Hfbd5+y11/CttdcivEOp0+2Sc47m5+Z8/fWNjY13jUajTxpj/oFz7lFrLYwx30rT
+9F9tbe38wY/8yMdeqH/+T/7kT8X15RX+h//1T/HhXsHhEN3pCRwmGWtOdDvdp9M0/VFr7Q9Za09a
+a5Hn+cpwOPyTzc3tz7/44kv/7y/+4mdW7/RcD4vknZ7AYREzt5z37zd5/mye509nWXYuz3NprYW1
+LrHWKeedjaJo+Pob11ZWV66ZOz3nw6B3FANsbm3Rb/7mb+57nZkXrPfvH/T7Hx8OBh/pdDpPbG1t
+yc3NTXS7XWRZJr13S+y5DVB04cKj6ezC0u43nn9udAcu41DpHcUAN1n8FgPfb4356GAw+Gin03l0
+bW1NXb58BVevXMHW9hbyPIMQkpRS80rLZhTFbnFxId3ppGtXLl98R0uCdwQDbO/s0Oc+97l9r2d5
+dpyI3t/v9T4xGAw+sr29/e7VlVX55puXcfHiRVy5chVbW9tI0xRCEJTSUkp5QirRFkLGjzz8YH7v
+ufO9r33trwZ7x/5f/9n/Rn/0R188lOs7SHpHMMCNFp+ZFz3z087ajw4Ggw/v7u4+vLK8rK5cuYor
+V65gfX3d93pdjEYpsixj7z0JKaC1RhRFM0qqqSiKMDXVtotLp7ae//rfTKiDd8LiA+8QBthLnW73
+HBE9k45GnxgOhx/e2tp6fGVlRV2+fBnLK8vY3d2FtY4BEDNgrUGe5+SchxAErZVWSp2QSs5IKVvH
+jy/ZJ9/97sGff+k/du70td1uescxADMvWWefAeOH0jR9ttvtPriyvEJXrl7B8vIKRsORl1Jxq9Wi
+pNEgrTURCLkxnJucnXMkpUIcRUiSZEFpPRNpLaIoyu87/8DGV7/yV8M7fY23k95RDNDpdk979k/n
+Wf73sjx7ttPpnF9ZWaXLV65gZXkVw+EISSPh9lQbzVaLlFIgEiBB8N7DGIMsz8g7C6UU4iQRURQt
+aK3npZDx/Px8+r73v7/zf//Zn/bu9LXeLhJ3egJvh3Z3d/cBWMzcBuNJ7/yz3vun01F6//bODpZX
+lrG6sorhaOjjJPHz8/M0Nz9P7XYbcRwjSWI0W020p9qUxDHlee43Nzf96toqOp1dMHskcXz/1FT7
+6dnZmWdPnTz51K9/9rNTe3//d37n944kqKbu9ATeDu3u7k78Ozf5dJqm7/HO/pBz+PBoNHpge3sb
+K8srWF5eQafbgdKa2u022u02iARGoxGYGcwMQQJxFME7hzzPaDgcYX1tHUmcIEkSRFGMOI4eJCFy
+ZuZG0hj+3u/9n899+tP/sLIJtnd2983zKNCRZIB77713ApcfDIbntZTvB/ABZ+2Dw8EAm5ubWFlZ
+wdbWtjfWot1uU9JIIKSENQZZliLLMhhj4JwFEZUeAIwx6PZ6fmV1Fc1WS7TbbczOzkJr/SB7PwBj
+dYBBB8Bz5Rx+6Rc/cyRjBUfeBmDmc2maPgvgh421PzAcDZO1tXW8+eabuHL1Knq9PkspaardRtJI
+IIRAbgylaUpZmsFaC+89ASD2DOccjLEYjVLKshxgpqTRQLvdQpIkkgjHnPMuz83gg//Zhzf+wx//
+0ZH2DI6UDdDpdCb0rHd+Os/zB4noSWZ+yFqb9Ht9rK+vY2V5xe/u7LJzjrTWUFqDGHDWwjkHzwwA
+RKAwZrF/lVKIoxhSSKSjlNbW13l5edl3Oh1476G1jqIoekgp9WSc6If+0T/6+Zn6nP75P//fj5Qt
+cKRUwMzMzKToHw5Oa60vENHjzrmzo9EQGxsbuH7tOlbX1nkwGGJqaoqSOEEcx9CRBglBGkCkNYzW
+YO9BBQ+AiDTAznnoKEKWZeh0Ory8vMKzs7NotdqYmppCFOl74jh6Ior0K3PzM8sAKinwj//xf3uk
+VMGRYoA6MbPudnsnANwjhFjK8zzq9fpYW1/H2vo6hoMBlJTUbDbRareQNBLESUJCiCD2nWdrLMAM
+ISwAEFkCCUHee240G7DGYDgaUme3w2tra1hYWEAcJ1BKRlEcLSmt7tFanQDwGoD8jt6Qt0lHSgXs
+oSkh6JgQ4jgR5nKTY7fTwdraGra2tmGMpThJ0G630Wg2EMVxeEQRoiiCjjS0VlCFelBaQSkFrRS0
+1sFFbCSQUmI4GtLGxiY2NjYxHA5BRIi0noui6HgURcee/ejf2ecWHhU6ygwQCykaJChmhsyzHL1e
+D51uD7nJoSNN7XYLzVYTkY4giEAAU3gOmTBE4Z/hHyAiEBETEbRSSJLgBhIRjUYj9LpdjEZDeO8h
+lSKtdRxFOjm+dDy+o3fiFujIqgAASgoRERA571SWZRgORxiNRvDOI04SREnQ+yCQtRZCCBARrDEw
+1sBZC+s8vAtZY+w92Dsq7QKlFAe0kGCMwXA0QpZl8N5BCqEirVUcxbrdmjqy3tRRZgAWJDwzO++8
+s87Bew9BAkpraK0hhIBzDnmewzkHZy2IiK21yNKMsjwvcQACg521cNaSNQbOuQASCQGpFIQQYGa4
+4DZCCOmUUi6KIqdVdKQMvzodaQZgZgaDvffBmCNASgkpgmazxiLLMjhrIaWELbB/5x3y3MBZB+9c
+kABcYADOwgRGgPOBqUofkb2H8x7sGUIRtNYcRTEirb/HAHeA2DnvBcgD7GUVyw8731qLNE1LQ48j
+rQlEkILB3hMzM4IVACIwA8QFT3nvYJ3lkC9owb5Y3woyYADkhRBeKemllN9jgDtB1jkokgQQCSEh
+pQQJAe89rLUwWsPaENkjISClhBACIIKQjqSUYGYUdiEAgJlhpASMhS+QQWsdlPLw3qPgGwhBJKUk
+qSSkPrImwNFmAOcdJAfDTggR9LRnlDvXM5OUElEcI0kSjuMYRETOBT3urAMAeC9AVIoDsHMOzjky
+1oIZ8N6zK2wMZpSfHT+OsC91pBmAvScwV9vXM8N5B+c9QAWsG8eI4xhRpKGUAoPDgteORATmKcQ7
+M6y2cDbsfClF8Z1C/4MrhpNSQAii8rtHkY4wAzCV2piBIK6th3NhVyupEEUR6yiClBIAkWcPZmbv
+ffl3IdKBAIkQExEFy1+yVgEcKo1KLgxAYCwBCslzZDngCDNABeegNNy8dwADUgRXUClFRATvPAxK
+1y5gAtZYWGfh3TgWwOyJmRGkSsEIUkFKyUJS8XOlDRBsCikllDq6t/HozhyoFs770kALiymlhJIS
+JCjYBM5C+MJGQDDsnA/un2cP4rCbi7UPj8L1I4HKeJRSQgSxX+j+MKaSR/c2Ht2ZFxREeCmWg16W
+MhiG7D2ss2AAgvwkA1hX+PQegghMAegBjxmrpJKptNLQSkMVDEEFYijE97yAQ6cikaPmlgkoJSGl
+Klw9rnS89x4MoLTkiwOhyHMD5sAYWrlCCnA1ZmUnFgCT1gpRUC1BChQMc5TpyDKAKeBarVW1Q4O+
+DrsfDHge++4h28fDOQuTG+R5DmPyIB2EgNUaUgS14ZnD+hNVz6WoV0pVKqGUFEfYBjy6DGCtLXbr
+eIFk4ZqBijTv3GA0GgVx78YPYyysMWEMcGXISSlBhVPv2cMXRmK5y0kQiILeJ4gCEADoeyrg8Gks
+/gt/oAJmwgI655BlObznQloEbECQAMAQUkCRAjOK3SzgPYPZVrYBc+n7F+NXaoEqMEiKoBqOKh3Z
+mZeql8LqVwzAzCGpcziCkDmSOIaUAs1GhGazgUYSQKGx64dK7+fGYBxWzpBmBtZYGGNgo2isToKl
+CBLhUIlU35MAh07sy8ov48UHEZzzsMYgzw0aDYlms4H5uVnMz89iYX4W7XYzZAcXn6/bBsNRiuFw
+hJ2dXezsdLG1vYssywtJ4uE4RAZLiSMK1aO/hwMcPlXin8Y+fNDvObx3SGKFUycWcN999+LMmVNY
+WFzE7OwMdJEr4D0X0HGI8TN75FmGPM/R7XSwvb2D5eUVKMlYdgagcS6Ax6Tdob8nAQ6fuLIBAiOU
+YBAANJsNzE638fBDD+Khhx/E4tJJqKgBFhppbtEbMDJjYYyDcwzmsJCCBCLdxPRcE43WDBqNJgCC
+cw79wQhUGJdlxlAQ/wpxHN25G3GLdGQZoHTPvC8CNUUMoNVMcOrkMZw+dRL3n38Ac4unMbIxtrYy
+bO3uYrc7Qq+fYZRZpJmB9x5EQKQlWonEdDvG7JTCTEujObWAk6cy5HmKjc1tNBthoUtbgEBQUiLS
+32OAO0LljnTOAcxIYo1jxxbg3BzmFk9g4FrYvJzijWvrePPqNlbWuuj2RugNMmTGIzcWnhlSELQU
+aDc1ptoxlhabOHV8CmeOJ4iRoDm1iHlPiGONSCsAXHgMQJmIclTpyDKAL0C40rfXSmC63YI/toju
+wGJnoLB8bRtvLI/w8mvrWFnZwfb2AMY4ZLmFZ8AW8X0pgkEXRxI6UpiZSbB0bAoPnJvBqXmJY22B
+hm5huh0hSTSkoBB8YgYz4SgnVx9ZBjA27Pqgu4FGotFqt9AfWawvd/DtKzt4/tUuLl3r4tryLjDK
+gNwBgoLvV7iPAOCKhxkGBHFne4Q3Vwe4sj7AmcUID56SuO+4wPR0FIxIVSSQFEAUH2E4+MgygDXh
+RK+MGZIEoDRIRNjuM771Rh9f+eYGvvHqNvLdETDIABkWF1JUYE4R+QkDMsJKega8BzKH1dxhc1ui
+39ewpoHFuSZOehEYQBIsqPr4UaUDZ4B//fu/PwuQATj7+5/6lL1d43rnIGRYDEGAdUAvZVxaHuH5
+13bwzde3ka/1UeVwSVGG8gsq/lHleCH8O+SOAJ6AzMOmFq86Ay2BMycM7j2LwvcXBe/QvujhrdK/
+/Ff/VgGIAegf/wf/5YEWHjgECUCLAAYAugBuGwNQAchEOujfzDjs9HK8udLHpWtdpOt9YJgDiQIi
+CTQ0oCWkDn67FNW54AoPsNbDWQ9YBnIPeACZg991WN7MsbZj0U8ZDIJSISFFiGAI3k4SAjGAaQBt
+AEebAZj5fgAbCIu/r97e2yUpASEJWgl4D1jH6A4s1rdTbOykwCAPslkLiJkES/MtHFtoYqqdoN3S
+UEpAyQI6th5ZbtHvZ+j2c2ztptjuZPADG1RCyugOgc4QGOWAY0AQQckgWJS67UZgE8AJAMcRDp4e
+GB04AxDRWQR5u3VbxxUUYvKCIMBwjjFKLXZ7GfKhCb8438Tp++bxwLl53H/PLO45MYPpqRitVhQs
+fwGwDzGAPDfY7abY6YxwbbWHq6t9XF7uYf06AwMDY4IdaRzBe4CIIQQKCXC7w8HcALAI4OxtHngf
+HYYR+AAAA+Ba/cV//fv/hv7+p37sFuznQoSLEKVznpEbh+Go2LWzDTz8yBI+9P6zeOrCSdxzcgbz
+s80QERQE60KCJ7MvIF6HURqSRDa3+7i62sVLr27jrxXh6pUeAEJqGNaF4Uu9T0QQt8gAN7gXLQCn
+ADx4SwO/BToMBjgDYF0IMXGCttfr39qoZcJGYc1b62GshyRgfrGFk4st/NAz9+KjP3Af7j0zC6Uk
+stxhu5tiMDJIMxtcSc8APJQElGQ0GwrnTk1haT7C4rSCVoyvSKAzDPCvsQxrgTIdmejWE0LiePJw
+sfccE9ECEc7c0sBvgQ7DBjhLRFcBNPa8c0vjSkkhXZuD+M9NyAhemG3giYcX8fgDx/CBp07j9Ikp
+9IYG19e2sbzex9rWALu9FFnmwncQxHikCa1EYX46wsKsxvyUxPGFBE88OIXM5HhzNUW7IQubgeHC
+WTIIoltWAfUzCgU1ABwD6NwtDfwW6DAkwCwzt621E4D57OzsLQ2qpISUBG898tzDe0a7qfDQvbOw
+dgr3n52DEISXXt/Ei69t4pU3trCy3kN/aDAYmWD1u8CEUgQx3owlWg2NY3MJzp1s4N6TMaRgnDsR
+Q0nCVFsjUiH+YG04jBrsgFtjgOFosiq9lDJi5jaAuVsa+C3QYUiAKe99K8uyCQnwyU/+57c0riRi
+QcTGMnLroJTA4lwD58/OoNsPyRx/++IKXru8i+deXsPyWg/5KA9mu+ewclVWCVCkDgMgJInC8YUE
+D59r4cScRDNhLEwJzM9rTDUlhACMY0jBIBAL0C2Js+efn+hSA611w1rbYuYDrzxyKEig916ORiNd
+/J4FAEG3dtOsZWIwqSIo00gU5mcSdPsjLK93cfFyBy++to1LVzvornQDUkQAYhUWmvwYBQTGzGA8
+0n6Oy50MO90Mx+ckzh7XOH0sRisBppqESBeeAADPITv8Vq7lNz7769W9YGb1xT/6D9o5J/kQMObD
+YADy3os8NxI1BrhVynILzYRGQqSVRCsBokigN8zxyhs7+OtvruHiGzvAKBSCQlMXPtvetaqnfxOg
+RACALKO7naHbZfQHCsyMc6cctARiTZAyHCRzDrDutrqBSkkpiQ7nyOlhMIBjhufqkP3toaTR9N57
+H2nlAeaMGGnmcG21j5cvbuPipW1gazRGAhM9ueNLor1/FzEDcEAEhxYr3qPV0nika2EdQ0lCpAQz
+syehfBQ3b280gMJxx+JxoHQoKoAITCTG6Tu3gSKt2RjjpZbhxGdm0O0bXF8f4Pr6AOjnAMDQkqAl
+hJaslSCtBJQK2T/Fmc+QF+gZ1joY52Ess1c+sEYGRuqx1XXY6jqMsrAmShJXRSJub4UQ5nqq0wHT
+YUUDWQgqufq20PTM9CjPshQkLciwsYzewGBzJ+hu5A7QgtCKuNWKMDMV03QrRrOhkMQaSgYkEQw4
+52GsxXBkMEgNegND/ZHl4cgCmSM4z/0RozvkAAV7QAqwkMI2m0n65FNP3c7mUr7GAAfOBIfFALTn
++buiX/u1X6df/dVf2XszxGg0VFHckAAL5xmZYQxGFj73wdCbbeD+s7M4e3IGJ5faWJpvodWM0EpU
+OORJALOHMQ55btHtp+gNMqxvD7C2PcLKxhDXHAO9HMYBqQGMBbxjeGYBa2WWjdTlN1/fp69/8Zd+
+iT73G7/xdhbwlu7Vd0tHIh/gBouPL3/pz1tLx4/NtOKltoqiyBUBIWM5uHqzDTxw/wK//12n6NHz
+x3DmxDQvLbQoiRWSKGTxUlH4ITcGxlh0eykGwwyrmz1e3ujRa5c7AJivXfdF3SHAeoLzgLMuSk3W
+3tramnnxxRdbAHbq83ubi1/Q4R01OxIMsJcWFs8e+49f+tLj3/d977kwO6XPLCwuNpwHPBOUFDi+
+2MLCbIwPve8sPvR9Z/HwfYuYn21iZioJhr4M5//KTGKTh2Nig2GKPDfY2m1ic7uFkwsRkgiQ5NFP
+izQBT3BMMNY1dnZ7Z5aXVy68/PK33rzn3keyq29+e+NO35vvlo4iA7SffNcjT3Y6u09vbW891en2
+Tk/PzCrvQ6LG7HTMD983Rw+dm8Wz77sH3//EKRw/NoVQ7SMc/wIYznt4R3CeIIpYAKDRiAlKNjDd
+BGLlYE2ONM1wfTNHMxEMIvKeYK1T/cHwdLfTeWo4HO489sh5e/XNb38FwC0GOQ6XjhQDPP30DyxY
+y++Znml/zBjz9Gg4fHw4StvGMjxCVu99p6dw36kmP/HQIt574Tjde2YGkLoI+pTVRHyRBOLDqaDi
+dBAXuYJaCehWBFpqIB21qN9vcSsR3GhKRCpIAOsYaWaOpVnWcNbJqXar9eyHP0KRpuf++I//7LaG
+vg+S7sp01p/7uZ/bpwSfeeaZ5J57zr7r2NLihyKtf9Czf9w517aW4cLu59mpmM/fM43Hzs/h/jPT
+mJ2KQ9Gn3KA/yNDrZ+gPM/SHOfrDHIPR+NEvnwc5BiOLUebATGg3JU4uaNyzpLE0K9GMBRPAnssz
+Ca7N4Me1Vj84Nzv7oWPHjr/r4x//WPJWruluoLtSAvzu7/7uhAH1C7/wCzPr6+vvZua/673/sFLy
+vQAo7GKAIRApycfmG/BmiuIIODabQElCbnww2ioJgCKdm6ts3vJwaIUHFJVDrfOQAphuCpyYEyAp
+MNUkDmEEIj921NpCivfGcQyto+j48VP+M5/5zPO/9Vu/1bnZNd0tdFdKgDr9yq/8iur3+49KKT8o
+hPiQlPICFdkYRAIgwQTiSAvMtCKan4nQboRycMORwWBokGYu5Pv5IO6rBd/z8IUqsNYjyx2GaQB+
+mD1iDbQbQCMCBXuBGBCMcWIISSkuCCE+REQfHAwGj/7yL//yXX9o8K5mgJ/5mZ+J19fXH/XeP0tE
+f4eI3ktEjXEiSMBMEQ5oUquhMNXUaMQh6dMz2BcLXhX4Kihs3v1MAC5GDfg1vGcmMLT0SDQj1gwp
+QjrSuDpBVaOgUczxI977D25sbDzykz/5k3f1saG7UgWUJIQ4wcxPAvh+AI+haHJVRMl8We6/SMog
+KYmJimKPLux4z1zrjEVlCbBAtWpgVRWQsjA0APYBJbSuPHjqISiUluVQJCAkBxbB5GJUCeBRZt4E
+cDWO4y6Aqwd1j26V7moJQERnmfk9AN5DRMf2598Xq1EVbCSSZQm32lpXa87lvg9/lzUBJ6QAMKkW
+qqJR1YPK6iBALXQ0Gbo9AeA9AJ4ionsO7AbdBrprGeCnf/qnNYAFhJzCE/s+EBaeRDimTQCBmeA8
+yHsmDjF64lDRgQEeJyB8h+peYy1QmolMzEzeM3nHVDsKVpkixXRqUyMAWAJwmojmP/3pT9+1tsBd
+ywBCCIVwMGIO4ZRMSZ5CNhCVBRuBmn9fJIiMDfTxzi7/Lj8fLP/J3VvaBX6vfVCOu4dxikIj9TKi
+xes0hXC4o4G7uD/jXWsDJEkiioaOXF/kopMHWWu57OrBzrOzjmzoCch1vc8c8rWoPNBfjDNWDVzZ
+AjWVwMzhK8U/6yqi3PGVVqlqEU6qE0tEDgAnyT5Y4K6hu5YBZmZmRLfbFcxM9V1b3ugSxy+LPjrv
+kWVZUfqtjKZwuUJj474Yh4vvByTQjccNi0dcLagn9hVzjMGD8lwCxnaCr7mYKBI6hBBYWFi4K0Eg
+4C5mgM997nPDT33qU4MkSUZEVPUAGA6HkFIizzKyxoQ+wHkGYS3nWQ7nLAkhi/OeIdtzUsSPwaCA
+C7jKW/Clc7jPNSx3P1cSqSb2wZ7LfgJkjCk7luTe++FoNOr/9m//dnYn7uFboTtuA7z88st08eLF
+G+0Qt729bQaDgc2yjMvKoEIIiqMIjUYDURSBmZFlOY9GI2R5FuoBYpxrX4nomkVfShDnbMVYZRnZ
++mfYh0e9tHxtpwcIgsYVRIUQAKqqJZxlmet0OuZG1/3lL3+Znn/++ZtIhsMDDQ9TAtzwYh977LGb
+Xm2WZc47xxRFUEXt/larxVNTU3Ti+HGem5uDjiKy1lKpDoLWH5+1qInkylSvDD3nKwYAQmpYmQ+4
+1w2s2QNUdg5hZkgpOU5iNEwTzoXmVIV6Iu893ax8zAc/+MHvsMqVT3HgquMQGaCC794SfeELXzj2
+1a9+9eRwOJwSQlCx+Gg0GpiZmcHc3ByWjh1Ds9kM5eGsYWstVfqfMSnG61TYAKEfUGAAAmGv6Pfs
+K1uh6B5GhfTg0jaRSqPVakHKUDuoZAAiUlLK2QsXHj/7T/7JLx3/4Ad/cO2t3qjv5j7dKh0KAzCz
+z/MsB/AddeHrr7/eOH/+fAzgxPXr1x+IoujC5ubmkrUWURSh3Q7Nm1utFidJgkjrAvVzcAVaVzpj
+lZVfMkBZEKT+uvehbZx1oOJQSGnn+RoTjI27crziNYQq4knShI5iaCVZRxEJIiildavVPDU/v/Bk
+uz3VuXbt2mWt1dq3X3lldP3a9e2f+ImfuKEEIKLsi1/8vzJmPpS6I4eWFOrKOm41WllZbg2Ho7k4
+jo8ppWaklMf7/f4MEZ1pNBpnHnrooQunz5w55Z2D1hpJo4FmowGpFMBclHUdIsvzsJAcGkfuXfwS
+4y/TvksVUC8cXTadQlkyvrbzPfvCDqjVJyaCoFChXEcRNJiTJEGz0UAcR4jjRLZarbPtdhve+2Nb
+W1urRLTcbrV3H3nkkZXnnntuh4hWAew89dRTE0UgnPcWCFDEQS/MgTOAtdYbY+1wOJrorr2xsXHO
+OXdfkiTnpJQPCCGWhBAnjTFTQogFIcTU9PT03NTUVBO1qpwidPeGMabUs+NFmZCeNSiIuaojXIoI
+BsNxUT7eWihZ5AkWHUInQaBwlLwKLFEoDyOVhBCCiIh9EW4WUiKKYiRJgjiO54UQTef8CSI3EEJs
+CyEGAFaZed17/zozX/7a17526X3ve99rBW4ApZQ1xjgStG/T3G46jLOBLIRQS0vHZv7tv/uDMx//
+kY8Re3641+8/TkQPSSnPCSHuJ6JFZp5nZlFW4hRSQoRegAxm750jYwxZaynP89LvD6hNHY3d68bt
+mxMqI9CYgCN4paARILtJi7/EC+pt44ikFKxDiXlCOP3EQRU5HxJFWHjnlbOuba1tl/GKAtTqMvMO
+gDeY+TIzv/rCN77xzdWV668A5F/+9quLeZ5Fvix9eoB04AyglILSemphcf7+hx54MBkMhgtCiCcB
+PEZEZ4holohmgTEk68tFc64UyVwugqu5beUzECqGENM4ZFNngDIyhEn54Av7wRReQNV7MPj8NQi4
+fIzbyAohqv5BAMM5R9YYzvMcmcogSHgZGgsUreklmKuTxNNENM3Mi8z8IDM/luX5Iyur6y8KQdtE
+dJyEuLXj02+RDpwBpqenoyiKzszMTD/TaCTOWntCCPEQM+8L8OxF+saQbUDknAtGm3WuYAhPHCo1
+oogMltHcmv/vIcY9H0DVcSBUnkChTqqoYmkzsB9LgHGcgYuTTkRSFBIqnHqqMILQY9CRK4zTYKBy
+odInDPwWgBYzn3bOnXfOPeY9rxljyFm3ZKw98FyCA2eA+fnZJIqiM81tqndBAAAVSUlEQVRm84QQ
+IvbezwJo1uHdkth7X6Rrs/fFgnPwpyvL2wcEj0unvMRkC/VfLjzqO1jUfmOPSijxA/YeVkrowrOY
+kAKVKhnbFbXOoVy2likZtVIb4Tq4mDujYNYQxKyVuQ/zmHfOTxlru1mWpXmeU55nBy+hD/oHZmZm
+YinltFa6AUxW9d7LBOy98Fw0diw6ddZAFXjvuNxNQGGJF2VeaUK479fjJYlaYKl8z1oLh6L+X50B
+9kiA0gsosn+qDiVlj6LabxJXaQJcxBJ8FUou8wnGz2FOzjltjFkIDa2yNEuz9ACXBsAhMECkI0FE
+qrTCS53NY4VaBntKkGWsBlxo0uCLPn+uaPXu/bh9qyCJPWtfBfW5vOM18oVHUBEzfBFVNEUfIVF2
+Ct0XF5j8mRueNgaKE+fj9/ZEIhDSFAIqUUgQCsfBC4DKWhhjhDH5gUP1hwYE1d21giYQrwp2re36
+0ODRVwWhrXPki3Bv2amDC/y9GrK0GzAO4lS/ART1fSdfL6UAEcEYA6VULTro90iBPVPfU2OCuewm
+x7V3qxDzxPWXuQRCEJhF1e8ojBPUx9u742+dDgUHICJDJEgI0rgJzLnH7RqrgLD4bK2DdZaccwGC
+lRIyNIIcx2dRQfkon3jPb3i+AWMwV16Fsbamz3mCCWqMQ2XyYK28RF0NlTMYp68GsXODBaXim1Uf
+YhZEhoiMEHT03cCxdQ3yflJm7lkEKm9w6XO7ws0zYfErt6809KSUtTHGemC/8TZhZ0x4GeEbCB3H
+rYXJ86pORBUF9OMHar+2XwPUWK4am+sfpD1Cb4JKRiEKfYsPo0jIYTAACyEqRqhn99Seq6bNBfLG
+NUsa3jvyod0r25rfXyxmlaFDkyL3hmDQxO/wGGutpICzEC4UkKhjAJ5LZJbL1OFxaHHvxi7VANdy
+U1DMsvYPlAKrGmHckzj0Jzz4mNBh2QATf+/blTzeNcwMF/Q/F7qfrK3EM5VGZNCbe2yKcaTnhh5A
+ncrYf91IHNsCAqoK647PEpaG4DgTBAC4TA6rSZRKslBN99NeRinxqb3B37F0eQcwwD45hwkmoNr7
+vGfX0hgTcBUI5FzR49eX2p8qN2w8ECaYYN98biAByve88/DCwYMqCVAZpzzGF+q/NeFtFHOqeAJl
+bmH9A+XqVhPnIndpPAQw6a0cEB0aA3DN/dq382uf5SLhwo+tf6rH7a1zkEIGd65cfBDqpfoYqM7/
+32xOZfevfcag9xDWgTDuEFZ6Jjf6/FhFcHFaZMwMjLFdE1QVYw/Pjal0HWm8+w/cBcAhqoAqGld7
+re4YEVG1U+o3zvtiVxb2AHuPypYsAUCiiQ1ItUUBc802H4toz/vc0uozvmKQm9gSNPn5UjVUD9Sk
+wuT75fTKqU5SJfYrU+bA6Y6ogNrr+0xiLpAz731Y+OD/F0kfwTso8fwxGlcfuAbg+DLNs3yLAV8T
+9fuxiUo6eKJaLiDqK1utU/k7BUqJsotZiRpWeQTlLHhCqdddA54MZh9eUtChpYTdjBFu+FmUO6sG
+wpRZP+whS6uK9ujJuhq+gQ3AHOICN97VdeSufiSsNnBtS5afDsmmvkhGdXtAozH7VX8xY+/W5gpW
+oImx37FGYEl7Ld3y1pQLX2/5HiRA0TJeqbD4osTTa9+v2Rfs/URdugkJUKiTUndMCJFCl5f/7Zt3
+lXVahII9V/hEwCr2ZxlXVuHN7lM19vj5EGzAu+xcQF3vc5m3P2aEulFXYQp77lLwBGv6t/xOmepV
+lwAYewzVlydGKg3M/VMNKWHFtEv7hDEx10kV89Yk4Ngo2jehA6HDaBnzlj/LQJV6NQaCynhAeAhB
+leEnykhcXYrQ2DUL4JMoPLNiN3uelAA3EOuTDnkd8RkDz+XviwKt886DyU+eM3B+j62xX/zf4I5V
+i///Ewkwhsgrn7vKxK1Z2ZU4Lo6D01gQj2nC3ENwpcaGATPD1423miQYz2Xv7AiVnuHabxCN+xYV
+iI4vVEF94euJpTVE6OZscDi2X0WH0TYu/H8cqql2UZ3Ght+kBCj/5rr4F1U9gP0SpvLJASJfSxIK
+WH7pjt7Ir98zm0oP7802YBQSQMgqz4/BVch678MXTFGBUDe4Q1STNuNcgbd8k982HYIK+E+/z/Wd
+hbpPvcdaZw47j8Q4EWMPTRiCqNsEwbgcG24e9SNfN5/8GGyqxiZUuz8wQM19LELYpfryrp7YchMj
+sBAJJbA1ZoJ3gA2wl258r+uACY996MK/Hp/UDbtSVBm24gY4QNjpXBPVJfOU6GFYLAdnx8Zb+dm9
+VGabldMsn4kIUooyNRwAggoo5lyeOA5MUGYU75c4VaWR2q7fmy52kHSIDMA3Wfzy3fFnJnR0XQXU
+d0nlBewZh1EwAAAKNaOLuj5VV1hw6CnpNWANwWgC+0k0cUx7ZHFhzJVROylEkRg6hrl93dDk8cFU
+v0falOqolrQ8KQW+21v8NuiO4QD1AE6pAZjHGICvSYGxmK7XAypsgLoHUBp6lQcAgEODyLCzGAKB
+wQiMsvmjFJjMKyzd9moxxu/V/XUpJZTWCOcDFIhMZWzWYwSlVOOayhE1NLPUASVD08TrB0t31guo
+WVZ1I7C8YdhTlqUEf0Iu4PgGTdoMYUAlQ1sXJQlEYxXAjFqeQQCCwlm+MJ5nKhpDhocsOoMKSZX0
+KOcTqpPJ4uTy2CCs2buF0XdjCVDdhhqiWXkdN8EfbjcdqgS4iU6rXIP6jhnvwrIQmICQgqWUkFJW
+xhdqbBRMhPHuJoSzJblxyIxDmjkYwzBFZ5C8KDDB3kBSKBgtJRUeBMCF6ggSJCxMwagMgISQUEqx
+1hG01qFGgBRlVg8qx7Fkaj/JBMXC06QEKB/1Szs4uqMSgMeG+hgx54ofxqKQiIudT6X4JzFRAgBA
+iBFpRZAUsPXceoxSi+1ujk7fYLdnMMo80tzBWEZuLNg7xNpjtkVYnBaYbhMiFXqTO0dBAghACYas
+lqqsPkaQUpIuahcoJUsVxYWLWnm/tTIz46ufkBVjiVb+9Q5xA8fGURkWrt5DqTKZwDxxb+quUKkv
+S3ErZaECaiHmUlxDAnnuMBwZrG+nWNvOcG19iO2uwXbHYJR7pLlHbovGkcxoNwgn5iQeOB3hrBCY
+n5YQBBjPyDKPLPewDtXvlEndoYO4QhRpxHGMPM8BAqRS4VxjyazlZTFPqKoKoqigobpxeziI0KFJ
+gNLinWAC5hteZiEaubC0SRTJcUUmMFeHLLkAeZmhJFgEjsBgZHBtbYhvvdnDm8sjXF4dYXdg0enb
+YueHxfcMOMdoJQLHZhUGqYdxwbpvJQK5EeiOgO6Q4XKPOebgUQQlQABBSsFKa0SRho40mEFSSRqr
+qeI6CiBhjGhydflEVd2hQ3H96nQoEuBGMXdgQsNNfKJ0sYSUkMGnIhYi6FulIIWsMH5CyA9UkpBa
+RrdvcOl6Hy+8tovnXuniylqG9R0DtgxkBfZfWY0AHGMgCYOeRG4cQgtiwrG5CM4xrm8xtjYZkhlz
+c2GmQgQ7QwiClApxFKORNGCthWfPSmkqbAKuM0KBSlU/TzUXZq///47xAvamgdWpWEDef50B6y8B
+HxTp36owAEsVQERQSkBJASU9+oMMa9sZXrrUx998q4cXLg5g+i50EJMEwAHSI3QNLVp/uoIRcsLK
+Rg5JBsQWxxebIFK4uuqxuwO0NOFUJsAkQkMJJeC9nFQBJof3HlKKQlXVDFaxh91LXYBJJkDJCBUC
+ebB04AxQpoQD++yAwvTFpBlExKGnnwh5/wBxaDlXHDVXEEJWJV20Eoh0OHrd6Vt+/eoQz7/axTcv
+9WE20lAHTXuoFqMZOTQjpoZmaAlWMtT8tx48yhzl1sMbxyvrDr2BgaMYy5s5ej3CfEvj/Egjd6pY
+YMB5glQKcRyj2WwU7qWFIMFKq+AZaMVSFYxA1SmmqsI0atZguAdlajhV5xgPkg5FAtTVQI2rCxcJ
+hT0NhMsXJARBsgAVu6i0CbTWiKMISdKgOA6Vw5rNCLEWGKaGOkPGG6s5Li2nyHdzABY0RTg2ZbE4
+w5hrMdoJcbshEGtFkZIgIeAZNMo994YOw9TSKB9hOMjRSSOsbnq4oYPzGt2sCYMGojhBI4kghEOj
+kZAxbXjvWWsN5xwzmGoeS90eqIn2MYYRjILg++1XAwdLh9I7eN8L4eK4njIFoLhhXCz62DcWQngh
+JWulSClFWmuWImB6BA/nGINhjrXtFNfWR9jqpIBPSU0bnD9OOL3gsTQrsTCj0W5GmG4niKOIkzgi
+pRRAgp1n9IcG3X6K1a0hVrdSYGOEdXIYOYHUaO6lGv1MIM0drM3BPtgfcRKjzVOIoqhEMT0YwnPo
+PlpKMyELVVBbfwBcZhmWAHAFJr0T3EDUMLF64ANFkcoSuStFnyx8OVEucBCHgigUbiiTLTJCONMf
+/sDqdobV9R10e0NoMohmDN97zOCRMxKnFhXmphuYm2lT0mjSVLuFOI6RJAlrrSGlIikJubFIRyOs
+be7y9bUdzLS6YG9wkT2gmIapxdbOACtrW2A7AEOgN7RVrEIqCcmycO65EnFl/oIq1EANdK5UfbAG
+DicJpE6H1Du4EmfhMvcZhsG5Lo0lIYRl9t5aK5xzKh/lEyVhrLXw3sFag0iGLJy1HYsrVwYY9buY
+baSYb1o8egZ44LTC8cUptFrTmJqeRZy00GpPIQoMAK0VtNJQqjgJ5HIsLHRwfLGNufYqYr2DSKXY
+6Fvkow6uXvN4OdnB5lzA/40VkEqDqIgMEkEpDaUVoihyWqtUScVEpIkoFnsWOcg53ivuSz/xO4TP
+bg8dlgqQRBTd/AMEEDIiDISQHQZ3vfN5Okpb3V53qdPpLI5GI4zSFNaYUNTJWVhrQAgMsd1jbK4z
+lHc4PWdxchZ0dinmxblWWPjGDJLmDKKkiShpI4oj1nEcrPXgrpEigiCG1AmajRhaCYAkrNuiSys5
+cruD9dUOvmWB9WkKx9OhoXQEISS0DjZL0mig2WxidnZ2dXZmZiVuxkMCEgbm2ftpImoCSML9ryOD
+1XpHeKd0DxdCEPPECZmSsS0R9QEMGLxFoB2AN6JIr0gp14yx+erq6rGVldVHNjbWHx0MBseGw6E2
+xua5yT1757yzBDi2ltEdkeiNoigmGc9O6ejEnMLcTEKNRot11IbSTSgdRL7SEkpJKCVJSgEpBQsp
+uBLVuomkxZibS3H6hKGdToo8z7Gy0Xe93TS/luam1wQrJYiEJqU0E0mllCQlZZQ0G1m71V7Osuwb
+cRS9eOLEiU1BlBhjTqRZdpyIFikUxloEUOsrMGYCBgQfQp+Bw/ACplDpewYCV28C2AZ4pfj7OhFt
+MON6s9m8Pjc7u9brD8xf/MVfnnzjjTeWd3a2d7I8P5PnecM5l3vnHYEtERPgrWdyWSa1BJbasTo9
+1ZBLSSxAFMFyTMYrFp5CG7jioGkJMZfh5vLMIZGAMQ7eCTjEUDpBqxlhti3Q69punpm1LEu3RoKs
+IAgSuSouT1Oo/RNFke7FcfLGYDD4iiD6+jNPP72sldLrGxtLWZ6fJKITABaZcYaIFgA+TYRFIiwB
+aBTBsAi4udS8XXQYEkBwqBCSEdE6gDVmvgRgmRmXmbEBYJmIdoho4+zZc5tEVFbYvvTUU0+tz87O
+Xoui6IQQokmheIIXgqySQhBhxFDGOxdr7R+OI/eeRPuYwDOhmbSHtZakNT43OREBQhYLD66qgYxD
+uQRjLRuTi1GaI80NwB6J9r1WzN+G5RescRe9lxmDNXkkzlt4Zs3eSx8eHWvMlReef/6Fz372s6/+
+7M/+bHk9r7z00ktz3vtFZp5l5pMA5olwlohOEdF5AKeY+QSzb4E5vsEtva10GAww8N73KZRF/TYz
+vw7gFYRqmdeZucvMu1rr7MKFC3tLq+df//rXXzt58uTuvffeOz07MxPpKPJxHLPWysdRRI0kGiSN
+dr661Yvy3KwRfMTen81zOzMYZRBqBKk0QERKCmb2BELZeQROh7y9yvVkcJ5nNBwOsb3TwfZOF/3h
+EM7aTS3xQjPRX0LcfvHE0kxubR5Zy61QqNqpUNfHoN/rDVaWl7defPnlNQAT13ThwoWdS29c2h32
+h7GHe1NK0bTWn1BKHWfGgwDOe+8f9Z5PMXj+oNfnwBlASvk3RLTJzBcBPM/MF733V7TWnSeeeGL0
+FobIV1ZWrq+srFz/T33wUz/290ZCNVtgec5asZBm2YyQIaZQIvCRjdh7T1ppstZyGceXSjKBmD0j
+TUfodnu0vb2N3d0ORsNBx9nsJbjRX7pR7y/+4A//sGoD91M/89+pza0NluTFYDDA5Tcv86VLl+x3
+muf9993PANLigevLl69MtWfbKyurr6Zpeq/z/pLz7v5CQhwoHYYE+FMA60KIN5j51cFgsPaBD3zg
+O5Y/+7Vf+6d04bEL+LFPfeq7coN+/9/8+7X/4pOffFmp6BuAOSWy9L0lluC8E845xHEMZ0PxaWNN
+1YdASEHeM5y1GA6G6Ha72NndRa/XxWAweD1N068PBv1vfv4P//Ba/Tf/xf/x2+Vi37Su7xe+8AW6
+dPEi/fc///M3tOpPnzrHAHrM/Mrf/u3XN40xm87ZS8x+6bu5/rdDh1Eq9osAOlEUrT/wwAO9t/Kd
+X/3Vf/q2/d/e+muvxGef+DKDI2QkvPcPMXPLGIM8yxHHMdIkQ6Q1tNYocfpSLeR5jtFwhMFggF6v
+PxyNhq8Oh8M/M3n65Vef++Nvo+arvVX6xCc+MeHj3YwoNKHc/B9+4X/cfejBhy5LIafexi34rujA
+GaDVar08PT2dE9244tU3vvENIiK8613vetuL/uM/9d/Qv/wXv8MA8Cd/+eLox04+8qJkFgFu9lsA
+nnDOLVprZZ7nyLMcumCACp5lVA2o0jT1aZpujUajb2ZZ9jfpaPT/ZOnopW9dS29b4cayXcxgMMAz
+zzwzce3/y//0P1sAG//Vj39s83b93s3okIHHw6OPfuSj03MLCxeUUu9SSn2/lPK81vqMVjpRSiVK
+KZJSytAjAK5wBVNjTJbn+bUsyy6mafrX6Sh9/vVXX33xxZdf7N7pazoIOnQGeOONN+i+++47cIgT
+AP7uxz7earQap7XWjwshHlZSPSKEOKGUWhJCxFLKqIBgjWefeec3rbVrxppvG2NeGQ6HL6yvrV/7
+6lf/qn8Y8/385z9PP/qjP3oo96akd6wEqNMP//DHTjcajQe11u+WUj4opbxXCDEjhEhC+iin3vue
+tfaKtfZimqbPd7qdV77851+6fKfnftD0/wHqxrHboq02DgAAAABJRU5ErkJggg==
+"
+ height="128"
+ width="128" />
+ </g>
+</svg>
diff --git a/demos/mobile/quickhit/main.cpp b/demos/mobile/quickhit/main.cpp
new file mode 100644
index 0000000..e2eb8cf2
--- /dev/null
+++ b/demos/mobile/quickhit/main.cpp
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include <QDesktopWidget>
+#include "mainwindow.h"
+
+// Lock S60 orientation
+#ifdef Q_OS_SYMBIAN
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif
+
+#ifndef QT_NO_OPENGL
+ #include <QGLWidget>
+#endif
+
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+
+ // Lock S60 orientation
+#ifdef Q_OS_SYMBIAN
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi) {
+ appUi->SetOrientationL(CAknAppUi::EAppUiOrientationPortrait);
+ }
+ );
+#endif
+
+ MainWindow w;
+
+#ifndef QT_NO_OPENGL
+ // Use QGLWidget to get the opengl support if available
+ QGLFormat format = QGLFormat::defaultFormat();
+ format.setSampleBuffers(false);
+
+ QGLWidget *glWidget = new QGLWidget(format);
+ glWidget->setAutoFillBackground(false);
+ w.setViewport(glWidget); // ownership of glWidget is taken
+#endif
+
+ QObject *rootObject = dynamic_cast<QObject*>(w.rootObject());
+
+ // For Qt.exit() from QML
+ QObject::connect((QObject*)w.engine(), SIGNAL(quit()), &a, SLOT(quit()));
+ // Level activation signal from QML
+ QObject::connect(rootObject, SIGNAL(levelActivated(int)), &w, SLOT(levelActivated(int)));
+
+#if defined (Q_OS_SYMBIAN) || defined (Q_WS_MAEMO_5)
+ w.setGeometry(QApplication::desktop()->screenGeometry());
+ w.showFullScreen();
+#else
+ w.setGeometry(100,100,360,640);
+ w.setFixedSize(360,640);
+ w.show();
+#endif
+
+ return a.exec();
+}
diff --git a/demos/mobile/quickhit/mainwindow.cpp b/demos/mobile/quickhit/mainwindow.cpp
new file mode 100644
index 0000000..51c440b
--- /dev/null
+++ b/demos/mobile/quickhit/mainwindow.cpp
@@ -0,0 +1,248 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "mainwindow.h"
+#include "gameengine.h"
+#include "plugins/levelplugininterface.h"
+
+#include <QDebug>
+#include <QDir>
+#include <QMessageBox>
+#include <QLibraryInfo>
+#include <QDeclarativeEngine>
+#include <QDesktopWidget>
+
+MainWindow::MainWindow(QWidget *parent)
+ : QDeclarativeView(parent)
+{
+
+#ifdef Q_WS_MAEMO_5
+ window()->setAttribute(Qt::WA_Maemo5PortraitOrientation, true);
+#endif
+
+ // Game engine
+ m_gameEngine = new GameEngine(this);
+
+ // Load all levels plugins
+ m_levelPlugin = 0;
+ loadLevelPlugins();
+
+ // QML main window
+ engine()->addImportPath("./imports");
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+
+ // Set game engine visible to QML
+ rootContext()->setContextProperty("GameEngine", m_gameEngine);
+
+ // Set QML source
+ setSource(QUrl("qrc:/Game.qml"));
+ //setSource(QUrl("../QuickHit/Game.qml"));
+
+ // Store QML root object for game engine
+ QObject *ro = static_cast<QObject*>(rootObject());
+ m_gameEngine->setGameQml(ro);
+ m_gameEngine->findQmlObjects();
+
+ // Application foreground / background event filter for filterin incoming call (window)
+ // when game will be paused
+ m_eventFilter = new MyEventFilter(this);
+ QObject::connect(m_eventFilter,SIGNAL(activationChangeFiltered()),this,SLOT(activationChangeFiltered()));
+ qApp->installEventFilter(m_eventFilter);
+
+ // Remove context menu from the all widgets
+ QWidgetList widgets = QApplication::allWidgets();
+ QWidget* w = 0;
+ foreach (w,widgets){
+ w->setContextMenuPolicy(Qt::NoContextMenu);
+ }
+}
+
+MainWindow::~MainWindow()
+{
+ for (int i=0;i<m_plugins.count();i++) {
+ m_plugins[i]->unload();
+ }
+ m_plugins.clear();
+
+}
+
+void MainWindow::activationChangeFiltered()
+{
+ m_gameEngine->pauseGame();
+}
+
+void MainWindow::levelActivated(int index)
+{
+ // Set level for the game engine
+ createPlugin(index);
+ rootContext()->setContextProperty("LevelPlugin", m_levelPlugin);
+ m_gameEngine->setGameLevel(m_levelPlugin);
+}
+
+void MainWindow::loadLevelPlugins()
+{
+#if defined (Q_OS_SYMBIAN)
+ bool exists_c = loadPlugins("c", "quickhitlevels");
+ bool exists_e = loadPlugins("e", "quickhitlevels");
+ bool exists_f = loadPlugins("f", "quickhitlevels");
+ if (exists_c || exists_e || exists_f) {
+ m_gameEngine->setPluginList(m_plugins);
+ createPlugin();
+ }
+ else {
+ //QMessageBox::information(this, "QuickHit", "Could not load any of the quickhitlevels");
+ }
+#else
+ if (loadPlugins("c", "quickhitlevels")) {
+ m_gameEngine->setPluginList(m_plugins);
+ createPlugin();
+ }
+ else {
+ //QMessageBox::information(this, "QuickHit", "Could not load any of the quickhitlevels");
+ }
+
+
+#endif
+}
+
+bool MainWindow::loadPlugins(QString drive, QString pluginDir)
+{
+#if defined (Q_OS_SYMBIAN)
+ QDir pluginsDir(drive + ":" + QLibraryInfo::location(QLibraryInfo::PluginsPath));
+#elif defined Q_OS_WIN32
+ QDir pluginsDir = QDir::currentPath();
+#else
+ QDir pluginsDir(QLibraryInfo::location(QLibraryInfo::PluginsPath));
+#endif
+ pluginsDir.cd(pluginDir);
+
+ qDebug() << "Loads plugins from : " << pluginsDir.path();
+
+ bool newPluginsLoaded = false;
+
+ foreach (QString fileName, pluginsDir.entryList(QDir::Files))
+ {
+ // Accept only plugin files
+#if defined (Q_OS_SYMBIAN)
+ if (fileName.contains(".qtplugin",Qt::CaseInsensitive)) {
+#elif defined (Q_WS_MAEMO_5)
+ if (fileName.contains(".so",Qt::CaseInsensitive)) {
+#else
+ if (fileName.contains(".dll",Qt::CaseInsensitive)) {
+#endif
+
+ // Create plugin loader
+ QPluginLoader* pluginLoader = new QPluginLoader(pluginsDir.absoluteFilePath(fileName));
+ // Load plugin
+ bool ret = pluginLoader->load();
+ if (!ret) {
+ // Loading failed
+ qDebug() << "Could not load plugin " << fileName;
+ } else {
+ // Loading done
+ // Test creating plugin
+ QObject *plugin = 0;
+ LevelPluginInterface* pluginIF = 0;
+ plugin = pluginLoader->instance();
+ pluginIF = qobject_cast<LevelPluginInterface*> (plugin);
+ if (pluginIF) {
+ qDebug() << "Plugin can be created";
+ // Store loader to array
+ m_plugins.append(pluginLoader);
+ newPluginsLoaded = true;
+ } else {
+ pluginLoader->unload();
+ qDebug() << "Plugin can NOT be created!";
+ }
+ }
+ }
+ }
+
+ return newPluginsLoaded;
+}
+
+
+void MainWindow::createPlugin(int index)
+{
+ if (index == -1) {
+ return;
+ }
+
+ m_levelPlugin = 0;
+
+ // Try to create plugin instance
+ QPluginLoader* pluginLoader = m_plugins[index];
+ QObject *plugin = pluginLoader->instance();
+ if (plugin) {
+ // Plugin instance created
+ // Cast plugin to LevelPluginInterface, that is common for all plugins
+ LevelPluginInterface* pluginIF = qobject_cast<LevelPluginInterface*> (plugin);
+ m_levelPlugin = pluginIF;
+ qDebug() << "Plugin created: " << index;
+ }
+ else {
+ qDebug() << "Creating plugin failed!";
+ QMessageBox::information(this, "QuickHit", "Could not create quickhitlevels");
+ }
+}
+
+void MainWindow::printObjectTree(QObject* parent)
+{
+ if (parent) {
+ qDebug() << "className:" << parent->metaObject()->className();
+ qDebug() << "objectName:" << parent->objectName();
+
+ QObjectList list = parent->children();
+ QObject* item;
+ foreach (item,list) {
+ if (item->children().count()>0) {
+ qDebug() << "--Childrens found--";
+ printObjectTree(item);
+ } else {
+ qDebug() << "className:" << item->metaObject()->className();
+ qDebug() << "objectName:" << item->objectName();
+ }
+ }
+ } else {
+ qDebug() << "object NULL";
+ }
+
+}
+
diff --git a/demos/mobile/quickhit/mainwindow.h b/demos/mobile/quickhit/mainwindow.h
new file mode 100644
index 0000000..69846ef
--- /dev/null
+++ b/demos/mobile/quickhit/mainwindow.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QtGui/QMainWindow>
+#include <QDeclarativeView>
+
+#include <QApplication>
+#include <QDeclarativeView>
+#include <QDeclarativeContext>
+#include <QGraphicsObject>
+#include <QMouseEvent>
+#include <QPluginLoader>
+
+#include "myeventfilter.h"
+
+class GameEngine;
+class LevelPluginInterface;
+
+class MainWindow : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ MainWindow(QWidget *parent = 0);
+ ~MainWindow();
+
+public slots:
+ void levelActivated(int);
+ void activationChangeFiltered();
+
+private:
+ void printObjectTree(QObject* parent);
+ void loadLevelPlugins();
+ bool loadPlugins(QString drive, QString pluginDir);
+ void createPlugin(int index = -1);
+
+private:
+ GameEngine* m_gameEngine;
+ LevelPluginInterface* m_levelPlugin;
+ QList<QPluginLoader*> m_plugins;
+
+ MyEventFilter* m_eventFilter;
+};
+
+#endif // MAINWINDOW_H
diff --git a/demos/mobile/quickhit/myeventfilter.cpp b/demos/mobile/quickhit/myeventfilter.cpp
new file mode 100644
index 0000000..6ff8890
--- /dev/null
+++ b/demos/mobile/quickhit/myeventfilter.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QDebug>
+#include "myeventfilter.h"
+
+MyEventFilter::MyEventFilter(QObject *parent) :
+ QObject(parent)
+{
+}
+
+MyEventFilter::~MyEventFilter()
+{
+}
+
+bool MyEventFilter::eventFilter(QObject *obj, QEvent *event)
+{
+ // http://doc.trolltech.com/4.7/qevent.html#QEvent
+
+ // QEvent::ActivationChange : The application has been made available to the user.
+
+ if (event->type() == QEvent::ActivationChange) {
+ emit activationChangeFiltered();
+ qDebug() << "ActivationChangeFiltered()";
+ return false;
+ } else {
+ // standard event processing
+ return QObject::eventFilter(obj, event);
+ }
+}
diff --git a/demos/mobile/quickhit/myeventfilter.h b/demos/mobile/quickhit/myeventfilter.h
new file mode 100644
index 0000000..279cd26
--- /dev/null
+++ b/demos/mobile/quickhit/myeventfilter.h
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef KEYEVENTLISTENER_H
+#define KEYEVENTLISTENER_H
+
+#include <QObject>
+#include <QKeyEvent>
+
+class MyEventFilter : public QObject
+{
+ Q_OBJECT
+
+public:
+ MyEventFilter(QObject *parent = 0);
+ ~MyEventFilter();
+
+protected:
+ bool eventFilter(QObject *obj, QEvent *event);
+
+signals:
+ void activationChangeFiltered();
+
+};
+
+#endif // KEYEVENTLISTENER_H
diff --git a/demos/mobile/quickhit/plugins/LevelOne/Level.qml b/demos/mobile/quickhit/plugins/LevelOne/Level.qml
new file mode 100644
index 0000000..d564e6e
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/Level.qml
@@ -0,0 +1,214 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.particles 1.0
+
+Rectangle {
+ id: enemies
+ anchors.fill: parent
+ color: "black"
+
+
+ // Background image for the level
+ Image {
+ id: background1
+ source: "file:/"+LevelPlugin.pictureRootPath()+"background3.png"
+ fillMode: Image.PreserveAspectCrop
+ smooth: true
+ //anchors.fill: parent
+ width: parent.width
+ height: parent.height
+ }
+
+
+ // ***************************************************
+ // *** NOTE: This is mandatory for all level QML files
+ function pause(doPause) {
+ if (doPause) {
+ rightLeftAnim.pause()
+ upToDownAnim.pause()
+ } else {
+ rightLeftAnim.resume()
+ upToDownAnim.resume()
+ }
+ }
+
+
+ // ***************************************************
+ // *** NOTE: This is mandatory for all level QML files
+ objectName: "level"
+
+ property int enemySpeed: LevelPlugin.enemySpeed()
+ property int enemyMaxWidth
+
+ // Create enemies dynamically
+ function createEnemies(amount) {
+ var b = false;
+ for (var i=0;i<amount;i++) {
+ if (b){
+ Qt.createQmlObject('import QtQuick 1.0; Image { property bool hit:false; width:50; objectName:"enemy"; smooth:true; fillMode:Image.PreserveAspectFit; source:"file:/"+LevelPlugin.pictureRootPath()+"enemy1.png";}',enemiesGrid);
+ } else {
+ Qt.createQmlObject('import QtQuick 1.0; Image { property bool hit:false; width:50; objectName:"enemy"; smooth:true; fillMode:Image.PreserveAspectFit; source:"file:/"+LevelPlugin.pictureRootPath()+"enemy2.png";}',enemiesGrid);
+ }
+ b = !b;
+ }
+ }
+
+ // Calculate enemy max width
+ function calEnemyMaxWidth() {
+ var enemyCountInCol = LevelPlugin.enemyCount() / LevelPlugin.enemyRowCount();
+ enemyCountInCol++; // add some extra space needs for width
+ if (enemyCountInCol*LevelPlugin.graphSize(LevelPlugin.pictureRootPath()+"enemy1.png").width > gameArea.width) {
+ enemyMaxWidth = gameArea.width / (enemyCountInCol + 1);
+ }
+ else {
+ enemyMaxWidth = LevelPlugin.graphSize(LevelPlugin.pictureRootPath()+"enemy1.png").width;
+ }
+ }
+
+
+ Component.onCompleted: {
+ // Calculate enemy max width
+ calEnemyMaxWidth()
+
+ // Create enemies dynamically after component created
+ createEnemies(LevelPlugin.enemyCount())
+
+ // Start animations
+ enemiesGrid.y = enemiesGrid.height * -1
+ rightLeftAnim.restart()
+ upToDownAnim.restart()
+
+ // Flying stars animation, not in Maemo
+ if (!GameEngine.isMaemo()) {
+ starBurstTimer.restart()
+ }
+
+ GameEngine.playSound(4) // NOTE: Level start sound
+ }
+
+
+ Timer {
+ id: starBurstTimer
+ interval: starParticles.lifeSpan+GameEngine.randInt(100,2000); running: false; repeat: true
+ onTriggered: {
+ starParticles.burst(GameEngine.randInt(4,10))
+ }
+ }
+
+
+ // Right-left animation
+ SequentialAnimation {
+ id: rightLeftAnim
+ loops: Animation.Infinite
+ NumberAnimation { target:enemiesGrid; property:"x"; from: 0; to:gameArea.width - enemiesGrid.width; easing.type: Easing.OutQuad; duration: 3000 }
+ NumberAnimation { target:enemiesGrid; property:"x"; to: 0; easing.type: Easing.OutQuad; duration: 3000 }
+ }
+
+ // Up to down animation
+ PropertyAnimation { id: upToDownAnim; target:enemiesGrid; property:"y"; to: gameArea.height;
+ easing.type: Easing.Linear; duration: enemies.enemySpeed }
+
+ Grid {
+ id: enemiesGrid
+ objectName: "enemiesGrid"
+ columns: LevelPlugin.enemyCount() / LevelPlugin.enemyRowCount()
+ spacing: 8
+ }
+
+ // ***************************************************
+ // *** NOTE: This is mandatory for all level QML files
+ // Execute explode particle effect
+ function explode(x,y) {
+ explodeParticles.x = x
+ explodeParticles.y = y
+ explodeParticles.burst(20)
+ explodeParticles.opacity = 1
+ }
+ // ***************************************************
+ // *** NOTE: This is mandatory for all level QML files
+ // Explode particle effect
+ Particles {
+ id: explodeParticles
+ opacity: 0
+ width: 1
+ height: 1
+ emissionRate: 0
+ source: "file:/"+LevelPlugin.pictureRootPath()+"red_fire.png"
+ lifeSpan: 500
+ lifeSpanDeviation: 2000
+ count: -1
+ angle: 270
+ angleDeviation: 65
+ velocity: 100
+ velocityDeviation: 100
+ ParticleMotionGravity {
+ yattractor: 1000
+ xattractor: 300
+ acceleration: 50
+ }
+ }
+
+ Particles {
+ id: starParticles
+ y: -50
+ x: 0
+ width: parent.width
+ height: 50
+ emissionRate: 0
+ source: "file:/"+LevelPlugin.pictureRootPath()+"star3.png"
+ lifeSpan: 3000
+ count: -1
+ angle: 90
+ velocity: 100
+ ParticleMotionGravity {
+ yattractor: 1000
+ xattractor: 500
+ }
+ }
+
+
+}
+
+
+
+
+
diff --git a/demos/mobile/quickhit/plugins/LevelOne/debian/changelog b/demos/mobile/quickhit/plugins/LevelOne/debian/changelog
new file mode 100644
index 0000000..de7ac98
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/debian/changelog
@@ -0,0 +1,11 @@
+levelone (1.1.0) unstable; urgency=low
+
+ * Final graphics
+
+ -- Antonio Aloisio <antonio.aloisio@nokia.com> Wed, 5 Jan 2011 10:05:04 +0200
+
+levelone (1.0.0) unstable; urgency=low
+
+ * First version
+
+ -- Antonio Aloisio <antonio.aloisio@nokia.com> Tue, 19 Oct 2010 10:05:04 +0200
diff --git a/demos/mobile/quickhit/plugins/LevelOne/debian/compat b/demos/mobile/quickhit/plugins/LevelOne/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/demos/mobile/quickhit/plugins/LevelOne/debian/control b/demos/mobile/quickhit/plugins/LevelOne/debian/control
new file mode 100644
index 0000000..c46afef
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/debian/control
@@ -0,0 +1,11 @@
+Source: levelone
+Section: user/games
+Priority: extra
+Maintainer: Antonio Aloisio <antonio.aloisio@nokia.com>
+Standards-Version: 3.7.2
+
+Package: levelone
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: QuickHit - LevelOne
+ QuickHit - LevelOne
diff --git a/demos/mobile/quickhit/plugins/LevelOne/debian/copyright b/demos/mobile/quickhit/plugins/LevelOne/debian/copyright
new file mode 100644
index 0000000..fb9e5a8
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/debian/copyright
@@ -0,0 +1,8 @@
+This is qmultiwinexample, written and maintained by Forum Nokia Antonio Aloisio <antonio.aloisio@nokia.com>
+on Tue, 19 Oct 2010 10:05:04 +0200
+
+
+Copyright Holder: Nokia (c) 2010
+
+License:
+
diff --git a/demos/mobile/quickhit/plugins/LevelOne/debian/dirs b/demos/mobile/quickhit/plugins/LevelOne/debian/dirs
new file mode 100644
index 0000000..80507f1
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/debian/dirs
@@ -0,0 +1,2 @@
+usr/bin
+usr/share/applications/hildon
diff --git a/demos/mobile/quickhit/plugins/LevelOne/debian/postinst b/demos/mobile/quickhit/plugins/LevelOne/debian/postinst
new file mode 100644
index 0000000..79fb6dd
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/debian/postinst
@@ -0,0 +1,5 @@
+#!/bin/sh -e
+
+gtk-update-icon-cache -f /usr/share/icons/hicolor
+
+exit 0
diff --git a/demos/mobile/quickhit/plugins/LevelOne/debian/rules b/demos/mobile/quickhit/plugins/LevelOne/debian/rules
new file mode 100644
index 0000000..53a1d2e
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/debian/rules
@@ -0,0 +1,91 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+APPNAME := levelone
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ $(MAKE)
+ #docbook-to-man debian/$(APPNAME).sgml > $(APPNAME).1
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ $(MAKE) clean
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/$(APPNAME).
+ $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/$(APPNAME) install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+# dh_install
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+ # dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+ dh_makeshlibs
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/background3.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/background3.png
new file mode 100644
index 0000000..c81875a
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/background3.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy1.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy1.png
new file mode 100644
index 0000000..94f149b
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy1.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy2.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy2.png
new file mode 100644
index 0000000..448f8ca
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy2.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy_missile2.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy_missile2.png
new file mode 100644
index 0000000..c0b28d8
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy_missile2.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/fire.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/fire.png
new file mode 100644
index 0000000..8401034
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/fire.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/fire2.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/fire2.png
new file mode 100644
index 0000000..139aa61
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/fire2.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/missile2.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/missile2.png
new file mode 100644
index 0000000..dacd610
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/missile2.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/red_fire.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/red_fire.png
new file mode 100644
index 0000000..464d603
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/red_fire.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/ship.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/ship.png
new file mode 100644
index 0000000..cb7851c
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/ship.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/star3.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/star3.png
new file mode 100644
index 0000000..f37a391
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/star3.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/transparent.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/transparent.png
new file mode 100644
index 0000000..3aa1e41
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/transparent.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/levelone.cpp b/demos/mobile/quickhit/plugins/LevelOne/levelone.cpp
new file mode 100644
index 0000000..a3aa1f6
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/levelone.cpp
@@ -0,0 +1,120 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "levelone.h"
+#include <QtCore/qplugin.h>
+
+
+LevelOne::LevelOne()
+{
+}
+
+LevelOne::~LevelOne()
+{
+}
+
+QString LevelOne::pathPrefix()
+{
+ /*
+QDir::rootPath()
+For Unix operating systems this returns "/".
+For Windows file systems this normally returns "c:/".
+On Symbian this typically returns "c:/data",
+*/
+
+#ifdef Q_WS_MAEMO_5
+ return "/home/user/.";
+#elif defined Q_OS_WIN32
+ return QDir::rootPath();
+#else
+ //return QDir::rootPath()+"/";
+ return "c:/System/";
+#endif
+}
+
+QStringList LevelOne::levelSounds()
+{
+ QStringList list;
+
+ // NOTE: Mandatory sounds/indexs for the all levels
+ // 0 = Enemy explode
+ list.append(LevelOne::pathPrefix()+"quickhitdata/levelone/sound/rocket_explosion.wav");
+ // 1 = You explode
+ list.append(LevelOne::pathPrefix()+"quickhitdata/levelone/sound/crash.wav");
+ // 2 = Missile fires
+ list.append(LevelOne::pathPrefix()+"quickhitdata/levelone/sound/rocket_explosion.wav");
+ // 3 = Emeny Missile fires
+ list.append(LevelOne::pathPrefix()+"quickhitdata/levelone/sound/rocket.wav");
+
+ // Additional sounds
+ // Level starts
+ list.append(LevelOne::pathPrefix()+"quickhitdata/levelone/sound/levelonestart.wav");
+
+ return list;
+}
+
+QVariant LevelOne::getData(QVariant key)
+{
+ QVariant ret;
+ switch (key.toInt()) {
+ case 1: {
+ // Any data what you need for this key
+ // Set your data into QVariant (ret)
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ return ret;
+}
+
+QVariant LevelOne::graphSize(QVariant pathToGraph)
+{
+ QVariant ret;
+ m_imageReader.setFileName(pathToGraph.toString());
+ QSize imageSize = m_imageReader.size();
+ ret.setValue(imageSize);
+ return ret;
+}
+
+// This Qt macro exports the plugin class LevelOne with the name levelplugins.
+// There should be exactly one occurrence of this LevelOne macro in a Qt plugin's source code.
+Q_EXPORT_PLUGIN2(levelplugins, LevelOne);
diff --git a/demos/mobile/quickhit/plugins/LevelOne/levelone.h b/demos/mobile/quickhit/plugins/LevelOne/levelone.h
new file mode 100644
index 0000000..6c64d79
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/levelone.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LEVELONE_H
+#define LEVELONE_H
+
+#include <QObject>
+#include <QDir>
+#include <QImageReader>
+
+#include "levelplugininterface.h"
+
+class LevelOne : public LevelPluginInterface
+{
+ Q_OBJECT
+
+ // This macro tells Qt which interfaces the class implements.
+ // This is used when implementing plugins.
+ Q_INTERFACES(LevelPluginInterface)
+
+public:
+ LevelOne();
+ ~LevelOne();
+
+ static QString pathPrefix();
+
+public: // From LevelPluginInterface
+
+ QStringList levelSounds();
+
+ Q_INVOKABLE QVariant getData(QVariant key);
+
+ Q_INVOKABLE QVariant graphSize(QVariant pathToGraph);
+
+ Q_INVOKABLE QVariant enemyCount() { return QVariant(30); } // 6x5=30
+ Q_INVOKABLE QVariant enemyRowCount() { return QVariant(6); } // 6 rows of enemies
+ Q_INVOKABLE QVariant enemySpeed() { return QVariant(36000); }
+ Q_INVOKABLE QVariant enemyFireSpeed() { return QVariant(200); }
+
+ // Root paths for the QML, Pictures and Sounds
+ Q_INVOKABLE QVariant qmlRootPath() { return QVariant(LevelOne::pathPrefix()+"quickhitdata/levelone/"); }
+ Q_INVOKABLE QVariant pictureRootPath() { return QVariant(LevelOne::pathPrefix()+"quickhitdata/levelone/gfx/"); }
+
+ // Full paths
+ Q_INVOKABLE QVariant pathToTransparentEnemyPic() {return QVariant(LevelOne::pathPrefix()+"quickhitdata/levelone/gfx/transparent.png");}
+ Q_INVOKABLE QVariant pathToMissilePic() {return QVariant(LevelOne::pathPrefix()+"quickhitdata/levelone/gfx/missile2.png");}
+ Q_INVOKABLE QVariant pathToEnemyMissilePic() {return QVariant(LevelOne::pathPrefix()+"quickhitdata/levelone/gfx/enemy_missile2.png");}
+ Q_INVOKABLE QVariant pathToMyShipPic() {return QVariant(LevelOne::pathPrefix()+"quickhitdata/levelone/gfx/ship.png");}
+
+protected:
+ QImageReader m_imageReader;
+};
+
+#endif // LEVELONE_H
diff --git a/demos/mobile/quickhit/plugins/LevelOne/levelone.pro b/demos/mobile/quickhit/plugins/LevelOne/levelone.pro
new file mode 100644
index 0000000..fcbfc56
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/levelone.pro
@@ -0,0 +1,100 @@
+
+# Copyright (c) 2010 Nokia Corporation.
+
+TEMPLATE = lib
+
+#VERSION = 1.1.0
+
+CONFIG += plugin
+
+INCLUDEPATH += ../
+
+HEADERS = levelone.h
+
+SOURCES = levelone.cpp
+
+TARGET = $$qtLibraryTarget(levelone)
+
+OTHER_FILES += Level.qml
+
+
+# SYMBIAN ---------------------------
+symbian: {
+# Load predefined include paths (e.g. QT_PLUGINS_BASE_DIR) to be used in the pro-files
+load(data_caging_paths)
+
+# EPOCALLOWDLLDATA have to set true because Qt macros has initialised global data
+TARGET.EPOCALLOWDLLDATA=1
+TARGET.UID3 = 0xE07dfb66
+
+TARGET.CAPABILITY = NetworkServices \
+ Location \
+ ReadUserData \
+ WriteUserData \
+ LocalServices \
+ UserEnvironment
+
+# Defines plugin stub file into Symbian .pkg package
+pluginDep.sources = levelone.dll
+pluginDep.path = $$QT_PLUGINS_BASE_DIR/quickhitlevels
+DEPLOYMENT += pluginDep
+
+# Graphics and Sounds for the plugin
+BLD_INF_RULES.prj_exports += "gfx/background3.png ../winscw/c/Data/gfx/background3.png" \
+"gfx/enemy1.png ../winscw/c/Data/gfx/enemy1.png" \
+"gfx/enemy2.png ../winscw/c/Data/gfx/enemy2.png" \
+"gfx/red_fire.png ../winscw/c/Data/gfx/red_fire.png" \
+"gfx/missile2.png ../winscw/c/Data/gfx/missile2.png" \
+"gfx/enemy_missile2.png ../winscw/c/Data/gfx/enemy_missile2.png" \
+"gfx/ship.png ../winscw/c/Data/gfx/ship.png" \
+"gfx/transparent.png ../winscw/c/Data/gfx/transparent.png" \
+"gfx/star3.png ../winscw/c/Data/gfx/star3.png" \
+"sound/crash.wav ../winscw/c/Data/sound/crash.wav" \
+"sound/rocket.wav ../winscw/c/Data/sound/rocket.wav" \
+"sound/rocket_explosion.wav ../winscw/c/Data/sound/rocket_explosion.wav" \
+"sound/levelonestart.wav ../winscw/c/Data/sound/levelonestart.wav" \
+"Level.qml ../winscw/c/Data/Level.qml"
+
+
+myQml.sources = level.qml
+myQml.path = c:/System/quickhitdata/levelone
+myGraphic.sources = gfx/*
+myGraphic.path = c:/System/quickhitdata/levelone/gfx
+mySound.sources = sound/*
+mySound.path = c:/System/quickhitdata/levelone/sound
+# Takes qml, graphics and sounds into Symbian SIS package file (.pkg)
+DEPLOYMENT += myQml myGraphic mySound
+
+target.path += $$[QT_INSTALL_PLUGINS]/quickhitlevels
+# Installs binaries
+INSTALLS += target
+}
+
+# WINDOWS ---------------------------
+win32: {
+# Copy level sounds and graphics into right destination
+system(mkdir c:\\quickhitdata\\levelone)
+system(mkdir c:\\quickhitdata\\levelone\\gfx)
+system(mkdir c:\\quickhitdata\\levelone\\sound)
+system(copy *.qml c:\\quickhitdata\\levelone)
+system(copy gfx\\*.* c:\\quickhitdata\\levelone\\gfx)
+system(copy sound\\*.* c:\\quickhitdata\\levelone\\sound)
+
+# Installs binaries
+target.path += $$[QT_INSTALL_PLUGINS]/quickhitlevels
+INSTALLS += target
+}
+
+# MAEMO_5 ---------------------------
+maemo5: {
+myQml.path = /home/user/.quickhitdata/levelone/
+myQml.files += Level.qml
+myGraphic.path = /home/user/.quickhitdata/levelone/gfx/
+myGraphic.files += gfx/*
+mySound.path = /home/user/.quickhitdata/levelone/sound/
+mySound.files += sound/*
+
+target.path += /usr/lib/qt4/plugins/quickhitlevels
+# Installs qml, binaries, sounds and graphics
+INSTALLS += target myGraphic mySound myQml
+}
diff --git a/demos/mobile/quickhit/plugins/LevelOne/sound/crash.wav b/demos/mobile/quickhit/plugins/LevelOne/sound/crash.wav
new file mode 100644
index 0000000..8076f0f
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/sound/crash.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/sound/levelonestart.wav b/demos/mobile/quickhit/plugins/LevelOne/sound/levelonestart.wav
new file mode 100644
index 0000000..e9e3ac0
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/sound/levelonestart.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/sound/rocket.wav b/demos/mobile/quickhit/plugins/LevelOne/sound/rocket.wav
new file mode 100644
index 0000000..8c0dee9
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/sound/rocket.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/sound/rocket_explosion.wav b/demos/mobile/quickhit/plugins/LevelOne/sound/rocket_explosion.wav
new file mode 100644
index 0000000..d2b451c
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/sound/rocket_explosion.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/changelog b/demos/mobile/quickhit/plugins/LevelTemplate/debian/changelog
new file mode 100644
index 0000000..a5e0a1b
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/changelog
@@ -0,0 +1,11 @@
+leveltemplate (1.1.0) unstable; urgency=low
+
+ * Final graphics
+
+ -- Antonio Aloisio <antonio.aloisio@nokia.com> Wed, 5 Jan 2011 10:05:04 +0200
+
+leveltemplate (1.0.0) unstable; urgency=low
+
+ * First version
+
+ -- Antonio Aloisio <antonio.aloisio@nokia.com> Tue, 19 Oct 2010 10:05:04 +0200
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/compat b/demos/mobile/quickhit/plugins/LevelTemplate/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/control b/demos/mobile/quickhit/plugins/LevelTemplate/debian/control
new file mode 100644
index 0000000..68742fd
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/control
@@ -0,0 +1,11 @@
+Source: leveltemplate
+Section: user/games
+Priority: extra
+Maintainer: Antonio Aloisio <antonio.aloisio@nokia.com>
+Standards-Version: 3.7.2
+
+Package: leveltemplate
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: QuickHit - Level Template
+ QuickHit - Level Template
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/copyright b/demos/mobile/quickhit/plugins/LevelTemplate/debian/copyright
new file mode 100644
index 0000000..f9ee8e2
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/copyright
@@ -0,0 +1,8 @@
+This is leveltemplate, written and maintained by Forum Nokia Antonio Aloisio <antonio.aloisio@nokia.com>
+on Tue, 19 Oct 2010 10:05:04 +0200
+
+
+Copyright Holder: Nokia (c) 2010
+
+License:
+
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/dirs b/demos/mobile/quickhit/plugins/LevelTemplate/debian/dirs
new file mode 100644
index 0000000..80507f1
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/dirs
@@ -0,0 +1,2 @@
+usr/bin
+usr/share/applications/hildon
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/levelone.tarlist b/demos/mobile/quickhit/plugins/LevelTemplate/debian/levelone.tarlist
new file mode 100644
index 0000000..f3146fa1
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/levelone.tarlist
@@ -0,0 +1,41 @@
+755 root root . home /
+755 root root . home/maemo /
+755 root root . home/maemo/quickhitdata /
+755 root root . home/maemo/quickhitdata/levelone /
+644 root root . home/maemo/quickhitdata/levelone/Level.qml debian/levelone/home/maemo/quickhitdata/levelone/Level.qml
+755 root root . home/maemo/quickhitdata/leveltwo /
+755 root root . home/maemo/quickhitdata/leveltwo/gfx /
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/background3.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/background3.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/blue_fire.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/blue_fire.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/enemy1.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/enemy1.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/enemy2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/enemy2.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/enemy_missile2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/enemy_missile2.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/fire.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/fire.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/fire2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/fire2.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/missile.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/missile.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/missile2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/missile2.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/moon.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/moon.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/ship.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/ship.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/star3.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/star3.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/transparent.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/transparent.png
+755 root root . home/maemo/quickhitdata/leveltwo/sound /
+644 root root . home/maemo/quickhitdata/leveltwo/sound/crash.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/crash.wav
+644 root root . home/maemo/quickhitdata/leveltwo/sound/enemy_explosion.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/enemy_explosion.wav
+644 root root . home/maemo/quickhitdata/leveltwo/sound/laser.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/laser.wav
+644 root root . home/maemo/quickhitdata/leveltwo/sound/myship_explosion.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/myship_explosion.wav
+644 root root . home/maemo/quickhitdata/leveltwo/sound/rocket.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/rocket.wav
+644 root root . home/maemo/quickhitdata/leveltwo/sound/rocket_explosion.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/rocket_explosion.wav
+755 root root . usr /
+755 root root . usr/bin /
+755 root root . usr/lib /
+755 root root . usr/lib/qt4 /
+755 root root . usr/lib/qt4/plugins /
+755 root root . usr/lib/qt4/plugins/quickhitlevels /
+644 root root . usr/lib/qt4/plugins/quickhitlevels/libleveltwo.so debian/levelone/usr/lib/qt4/plugins/quickhitlevels/libleveltwo.so
+755 root root . usr/share /
+755 root root . usr/share/applications /
+755 root root . usr/share/applications/hildon /
+755 root root . usr/share/doc /
+755 root root . usr/share/doc/levelone /
+644 root root . usr/share/doc/levelone/changelog.gz debian/levelone/usr/share/doc/levelone/changelog.gz
+644 root root . usr/share/doc/levelone/copyright debian/levelone/usr/share/doc/levelone/copyright
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/postinst b/demos/mobile/quickhit/plugins/LevelTemplate/debian/postinst
new file mode 100644
index 0000000..79fb6dd
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/postinst
@@ -0,0 +1,5 @@
+#!/bin/sh -e
+
+gtk-update-icon-cache -f /usr/share/icons/hicolor
+
+exit 0
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/rules b/demos/mobile/quickhit/plugins/LevelTemplate/debian/rules
new file mode 100644
index 0000000..7f30ca3
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/rules
@@ -0,0 +1,91 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+APPNAME := leveltemplate
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ $(MAKE)
+ #docbook-to-man debian/$(APPNAME).sgml > $(APPNAME).1
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ $(MAKE) clean
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/$(APPNAME).
+ $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/$(APPNAME) install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+# dh_install
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+ # dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+ dh_makeshlibs
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/gfx/blue_fire.png b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/blue_fire.png
new file mode 100644
index 0000000..8667a39
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/blue_fire.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy1.png b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy1.png
new file mode 100644
index 0000000..94f149b
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy1.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy2.png b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy2.png
new file mode 100644
index 0000000..448f8ca
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy2.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy_missile2.png b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy_missile2.png
new file mode 100644
index 0000000..c0b28d8
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy_missile2.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/gfx/missile2.png b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/missile2.png
new file mode 100644
index 0000000..dacd610
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/missile2.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/gfx/ship.png b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/ship.png
new file mode 100644
index 0000000..cb7851c
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/ship.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/gfx/transparent.png b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/transparent.png
new file mode 100644
index 0000000..3aa1e41
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/transparent.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.cpp b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.cpp
new file mode 100644
index 0000000..fffec69
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.cpp
@@ -0,0 +1,126 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "leveltemplate.h"
+#include <QtCore/qplugin.h>
+
+
+LevelTemplate::LevelTemplate()
+{
+}
+
+LevelTemplate::~LevelTemplate()
+{
+}
+
+QString LevelTemplate::pathPrefix()
+{
+/*
+QDir::rootPath()
+For Unix operating systems this returns "/".
+For Windows file systems this normally returns "c:/".
+On Symbian this typically returns "c:/data",
+*/
+
+#ifdef Q_WS_MAEMO_5
+ return "/home/user/.";
+#elif defined Q_OS_WIN32
+ return QDir::rootPath();
+#else
+ //return QDir::rootPath()+"/";
+ return "c:/System/";
+#endif
+}
+
+QStringList LevelTemplate::levelSounds()
+{
+ QStringList list;
+
+
+ // NOTE: Mandatory sounds/indexs for the all levels
+ // 0 = Enemy explode
+ list.append(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/sound/enemy_explosion.wav");
+ // 1 = You explode
+ list.append(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/sound/myship_explosion.wav");
+ // 2 = Missile fires
+ list.append(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/sound/laser.wav");
+ // 3 = Emeny Missile fires
+ list.append(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/sound/rocket.wav");
+
+ // Additional sounds
+ list.append(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/sound/enableship.wav");
+ list.append(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/sound/level2.wav");
+
+
+ return list;
+}
+
+QVariant LevelTemplate::getData(QVariant key)
+{
+ QVariant ret;
+ switch (key.toInt()) {
+ case 1: {
+ // Any data what you need for this key
+ // Set your data into QVariant (ret)
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ return ret;
+}
+
+QVariant LevelTemplate::graphSize(QVariant pathToGraph)
+{
+ QVariant ret;
+ m_imageReader.setFileName(pathToGraph.toString());
+ QSize imageSize = m_imageReader.size();
+ ret.setValue(imageSize);
+ return ret;
+}
+
+// This Qt macro exports the plugin class level with the name levelplugins.
+// There should be exactly one occurrence of this macro in a Qt plugin's source code.
+Q_EXPORT_PLUGIN2(levelplugins, LevelTemplate);
+
+
+
+
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.h b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.h
new file mode 100644
index 0000000..f13705a
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.h
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LevelTemplate_H
+#define LevelTemplate_H
+
+#include <QObject>
+#include <QDir>
+#include <QImageReader>
+
+// Common interface header for all level plugins
+#include "levelplugininterface.h"
+
+// Level name
+#define LEVEL_NAME "leveltemplate"
+
+class LevelTemplate : public LevelPluginInterface
+{
+ Q_OBJECT
+
+ // This macro tells Qt which interfaces the class implements.
+ // This is used when implementing plugins.
+ Q_INTERFACES(LevelPluginInterface)
+
+public:
+ LevelTemplate();
+ ~LevelTemplate();
+
+ static QString pathPrefix();
+
+public: // From LevelPluginInterface
+
+ QStringList levelSounds();
+
+ Q_INVOKABLE QVariant getData(QVariant key);
+
+ Q_INVOKABLE QVariant graphSize(QVariant pathToGraph);
+
+ Q_INVOKABLE QVariant enemyCount() { return QVariant(1); }
+ Q_INVOKABLE QVariant enemyRowCount() { return QVariant(0); }
+ Q_INVOKABLE QVariant enemySpeed() { return QVariant(20000); }
+ Q_INVOKABLE QVariant enemyFireSpeed() { return QVariant(2000); }
+
+ // Root paths for the QML, Pictures and Sounds
+ Q_INVOKABLE QVariant qmlRootPath() { return QVariant(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/"); }
+ Q_INVOKABLE QVariant pictureRootPath() { return QVariant(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/gfx/"); }
+
+ // Full paths
+ Q_INVOKABLE QVariant pathToTransparentEnemyPic() {return QVariant(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/gfx/transparent.png");}
+ Q_INVOKABLE QVariant pathToMissilePic() {return QVariant(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/gfx/missile2.png");}
+ Q_INVOKABLE QVariant pathToEnemyMissilePic() {return QVariant(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/gfx/enemy_missile2.png");}
+ Q_INVOKABLE QVariant pathToMyShipPic() {return QVariant(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/gfx/ship.png");}
+
+protected:
+ QImageReader m_imageReader;
+};
+
+#endif // LevelTemplate_H
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro
new file mode 100644
index 0000000..a4f5900
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro
@@ -0,0 +1,103 @@
+
+# Copyright (c) 2010 Nokia Corporation.
+
+TEMPLATE = lib
+
+#VERSION = 1.1.0
+
+CONFIG += plugin
+
+INCLUDEPATH += ../
+
+HEADERS = leveltemplate.h
+
+SOURCES = leveltemplate.cpp
+
+TARGET = $$qtLibraryTarget(leveltemplate)
+
+OTHER_FILES += qml/Level.qml \
+ qml/Enemy.qml \
+ qml/Level.js
+
+
+# SYMBIAN ---------------------------
+symbian: {
+# Load predefined include paths (e.g. QT_PLUGINS_BASE_DIR) to be used in the pro-files
+load(data_caging_paths)
+
+# EPOCALLOWDLLDATA have to set true because Qt macros has initialised global data
+TARGET.EPOCALLOWDLLDATA=1
+TARGET.UID3 = 0xE07dfb68
+
+TARGET.CAPABILITY = NetworkServices \
+ Location \
+ ReadUserData \
+ WriteUserData \
+ LocalServices \
+ UserEnvironment
+
+# Defines plugin stub file into Symbian .pkg package
+pluginDep.sources = leveltemplate.dll
+pluginDep.path = $$QT_PLUGINS_BASE_DIR/quickhitlevels
+DEPLOYMENT += pluginDep
+
+# Graphics and Sounds for the plugin
+BLD_INF_RULES.prj_exports += "gfx/enemy1.png ../winscw/c/Data/gfx/enemy1.png" \
+"gfx/enemy2.png ../winscw/c/Data/gfx/enemy2.png" \
+"gfx/missile2.png ../winscw/c/Data/gfx/missile2.png" \
+"gfx/enemy_missile2.png ../winscw/c/Data/gfx/enemy_missile2.png" \
+"gfx/ship.png ../winscw/c/Data/gfx/ship.png" \
+"gfx/transparent.png ../winscw/c/Data/gfx/transparent.png" \
+"gfx/blue_fire.png ../winscw/c/Data/gfx/blue_fire.png" \
+"sound/enemy_explosion.wav ../winscw/c/Data/sound/enemy_explosion.wav" \
+"sound/myship_explosion.wav ../winscw/c/Data/sound/myship_explosion.wav" \
+"sound/enableship.wav ../winscw/c/Data/sound/enableship.wav" \
+"sound/laser.wav ../winscw/c/Data/sound/laser.wav" \
+"sound/level2.wav ../winscw/c/Data/sound/level2.wav" \
+"qml/Level.qml ../winscw/c/Data/Level.qml" \
+"qml/Level.js ../winscw/c/Data/Level.js" \
+"qml/Enemy.qml ../winscw/c/Data/Enemy.qml"
+
+
+myQml.sources = qml/*
+myQml.path = c:/System/quickhitdata/leveltemplate
+myGraphic.sources = gfx/*
+myGraphic.path = c:/System/quickhitdata/leveltemplate/gfx
+mySound.sources = sound/*
+mySound.path = c:/System/quickhitdata/leveltemplate/sound
+# Takes qml, graphics and sounds into Symbian SIS package file (.pkg)
+DEPLOYMENT += myQml myGraphic mySound
+
+target.path += $$[QT_INSTALL_PLUGINS]/quickhitlevels
+# Installs binaries
+INSTALLS += target
+}
+
+# WINDOWS ---------------------------
+win32: {
+# Copy level sounds and graphics into right destination
+system(mkdir c:\quickhitdata\leveltemplate)
+system(mkdir c:\quickhitdata\leveltemplate\gfx)
+system(mkdir c:\quickhitdata\leveltemplate\sound)
+system(copy qml\*.* c:\quickhitdata\leveltemplate)
+system(copy gfx\*.* c:\quickhitdata\leveltemplate\gfx)
+system(copy sound\*.* c:\quickhitdata\leveltemplate\sound)
+
+# Installs binaries
+target.path += $$[QT_INSTALL_PLUGINS]/quickhitlevels
+INSTALLS += target
+}
+
+# MAEMO_5 ---------------------------
+maemo5: {
+myQml.path = /home/user/.quickhitdata/leveltemplate/
+myQml.files += qml/*
+myGraphic.path = /home/user/.quickhitdata/leveltemplate/gfx/
+myGraphic.files += gfx/*
+mySound.path = /home/user/.quickhitdata/leveltemplate/sound/
+mySound.files += sound/*
+
+target.path += /usr/lib/qt4/plugins/quickhitlevels
+# Installs qml, binaries, sounds and graphics
+INSTALLS += target myGraphic mySound myQml
+}
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/qml/Enemy.qml b/demos/mobile/quickhit/plugins/LevelTemplate/qml/Enemy.qml
new file mode 100644
index 0000000..b187c03
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/qml/Enemy.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: enemy
+
+ // ***************************************************
+ // *** NOTE: This "enemy "is mandatory enemy object name for all enemy QML files
+ objectName: "enemy"
+
+ smooth:true
+ opacity: 0 // 0=hidden by default
+ fillMode:Image.PreserveAspectFit
+ source:"file:/"+LevelPlugin.pictureRootPath()+"enemy1.png"
+
+ property int enemySpeed: LevelPlugin.enemySpeed()
+
+ // ***************************************************
+ // *** NOTE: This "pause(bool)" function is mandatory for all enemies QML files
+ function pause(doPause) {
+ }
+}
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/qml/Level.js b/demos/mobile/quickhit/plugins/LevelTemplate/qml/Level.js
new file mode 100644
index 0000000..e2e1d3a
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/qml/Level.js
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+var hiddenEnemies = new Array()
+
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/qml/Level.qml b/demos/mobile/quickhit/plugins/LevelTemplate/qml/Level.qml
new file mode 100644
index 0000000..3a383cf
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/qml/Level.qml
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.particles 1.0
+
+// Level own JavaScript file
+import "Level.js" as LevelScript
+
+Rectangle {
+ id: enemies
+ anchors.fill: parent
+ property int enemiesCreated: 0
+ property int enemiesEnabled: 0
+ color: "black"
+
+ // ***************************************************
+ // *** NOTE: This "pause(bool)" function is mandatory for all level QML files
+ function pause(doPause) {
+ }
+
+ // ***************************************************
+ // *** NOTE: Level object name "level" is mandatory for all level QML files
+ objectName: "level"
+
+ // Enemy placeholder. Have to exist at least one enemy for prevent to level be stopped
+ Enemy {
+ x: parent.width / 2
+ y: parent.height / 2
+ opacity: 1
+ }
+
+ // ***************************************************
+ // *** NOTE: This is mandatory for all level QML files
+ // Execute explode particle effect
+ function explode(x,y) {
+ explodeParticles.x = x
+ explodeParticles.y = y
+ explodeParticles.burst(20)
+ explodeParticles.opacity = 1
+ }
+
+ // ***************************************************
+ // *** NOTE: This is mandatory for all level QML files
+ // Explode particle effect
+ Particles {
+ id: explodeParticles
+ opacity: 0
+ width: 1
+ height: 1
+ emissionRate: 0
+ source: "file:/"+LevelPlugin.pictureRootPath()+"blue_fire.png"
+ lifeSpan: 500
+ lifeSpanDeviation: 2000
+ count: -1
+ angle: 270
+ angleDeviation: 65
+ velocity: 100
+ velocityDeviation: 100
+ ParticleMotionGravity {
+ yattractor: 1000
+ xattractor: 300
+ acceleration: 50
+ }
+ }
+}
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/crash.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/crash.wav
new file mode 100644
index 0000000..8076f0f
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/crash.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/enableship.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/enableship.wav
new file mode 100644
index 0000000..6fe5fe8
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/enableship.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/enemy_explosion.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/enemy_explosion.wav
new file mode 100644
index 0000000..fd338e6
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/enemy_explosion.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/laser.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/laser.wav
new file mode 100644
index 0000000..c3b58b2
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/laser.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/level2.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/level2.wav
new file mode 100644
index 0000000..24d3917
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/level2.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/myship_explosion.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/myship_explosion.wav
new file mode 100644
index 0000000..e22d030
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/myship_explosion.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/rocket.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/rocket.wav
new file mode 100644
index 0000000..8c0dee9
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/rocket.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/rocket_explosion.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/rocket_explosion.wav
new file mode 100644
index 0000000..d2b451c
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/rocket_explosion.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/changelog b/demos/mobile/quickhit/plugins/LevelTwo/debian/changelog
new file mode 100644
index 0000000..106ef66
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/changelog
@@ -0,0 +1,11 @@
+leveltwo (1.1.0) unstable; urgency=low
+
+ * Final graphics
+
+ -- Antonio Aloisio <antonio.aloisio@nokia.com> Wed, 5 Jan 2011 10:05:04 +0200
+
+leveltwo (1.0.0) unstable; urgency=low
+
+ * First version
+
+ -- Antonio Aloisio <antonio.aloisio@nokia.com> Tue, 19 Oct 2010 10:05:04 +0200
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/compat b/demos/mobile/quickhit/plugins/LevelTwo/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/control b/demos/mobile/quickhit/plugins/LevelTwo/debian/control
new file mode 100644
index 0000000..8f9d05e
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/control
@@ -0,0 +1,11 @@
+Source: leveltwo
+Section: user/games
+Priority: extra
+Maintainer: Antonio Aloisio <antonio.aloisio@nokia.com>
+Standards-Version: 3.7.2
+
+Package: leveltwo
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: QuickHit - LevelTwo
+ QuickHit - LevelTwo
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/copyright b/demos/mobile/quickhit/plugins/LevelTwo/debian/copyright
new file mode 100644
index 0000000..fb9e5a8
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/copyright
@@ -0,0 +1,8 @@
+This is qmultiwinexample, written and maintained by Forum Nokia Antonio Aloisio <antonio.aloisio@nokia.com>
+on Tue, 19 Oct 2010 10:05:04 +0200
+
+
+Copyright Holder: Nokia (c) 2010
+
+License:
+
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/dirs b/demos/mobile/quickhit/plugins/LevelTwo/debian/dirs
new file mode 100644
index 0000000..80507f1
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/dirs
@@ -0,0 +1,2 @@
+usr/bin
+usr/share/applications/hildon
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/levelone.tarlist b/demos/mobile/quickhit/plugins/LevelTwo/debian/levelone.tarlist
new file mode 100644
index 0000000..f3146fa1
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/levelone.tarlist
@@ -0,0 +1,41 @@
+755 root root . home /
+755 root root . home/maemo /
+755 root root . home/maemo/quickhitdata /
+755 root root . home/maemo/quickhitdata/levelone /
+644 root root . home/maemo/quickhitdata/levelone/Level.qml debian/levelone/home/maemo/quickhitdata/levelone/Level.qml
+755 root root . home/maemo/quickhitdata/leveltwo /
+755 root root . home/maemo/quickhitdata/leveltwo/gfx /
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/background3.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/background3.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/blue_fire.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/blue_fire.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/enemy1.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/enemy1.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/enemy2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/enemy2.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/enemy_missile2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/enemy_missile2.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/fire.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/fire.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/fire2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/fire2.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/missile.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/missile.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/missile2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/missile2.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/moon.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/moon.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/ship.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/ship.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/star3.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/star3.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/transparent.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/transparent.png
+755 root root . home/maemo/quickhitdata/leveltwo/sound /
+644 root root . home/maemo/quickhitdata/leveltwo/sound/crash.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/crash.wav
+644 root root . home/maemo/quickhitdata/leveltwo/sound/enemy_explosion.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/enemy_explosion.wav
+644 root root . home/maemo/quickhitdata/leveltwo/sound/laser.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/laser.wav
+644 root root . home/maemo/quickhitdata/leveltwo/sound/myship_explosion.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/myship_explosion.wav
+644 root root . home/maemo/quickhitdata/leveltwo/sound/rocket.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/rocket.wav
+644 root root . home/maemo/quickhitdata/leveltwo/sound/rocket_explosion.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/rocket_explosion.wav
+755 root root . usr /
+755 root root . usr/bin /
+755 root root . usr/lib /
+755 root root . usr/lib/qt4 /
+755 root root . usr/lib/qt4/plugins /
+755 root root . usr/lib/qt4/plugins/quickhitlevels /
+644 root root . usr/lib/qt4/plugins/quickhitlevels/libleveltwo.so debian/levelone/usr/lib/qt4/plugins/quickhitlevels/libleveltwo.so
+755 root root . usr/share /
+755 root root . usr/share/applications /
+755 root root . usr/share/applications/hildon /
+755 root root . usr/share/doc /
+755 root root . usr/share/doc/levelone /
+644 root root . usr/share/doc/levelone/changelog.gz debian/levelone/usr/share/doc/levelone/changelog.gz
+644 root root . usr/share/doc/levelone/copyright debian/levelone/usr/share/doc/levelone/copyright
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/postinst b/demos/mobile/quickhit/plugins/LevelTwo/debian/postinst
new file mode 100644
index 0000000..79fb6dd
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/postinst
@@ -0,0 +1,5 @@
+#!/bin/sh -e
+
+gtk-update-icon-cache -f /usr/share/icons/hicolor
+
+exit 0
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/rules b/demos/mobile/quickhit/plugins/LevelTwo/debian/rules
new file mode 100644
index 0000000..5dac6e0
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/rules
@@ -0,0 +1,91 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+APPNAME := leveltwo
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ $(MAKE)
+ #docbook-to-man debian/$(APPNAME).sgml > $(APPNAME).1
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ $(MAKE) clean
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/$(APPNAME).
+ $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/$(APPNAME) install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+# dh_install
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+ # dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+ dh_makeshlibs
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/background2.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/background2.png
new file mode 100644
index 0000000..8fbf2f4
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/background2.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/background_loop.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/background_loop.png
new file mode 100644
index 0000000..3a135d2
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/background_loop.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/blue_fire.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/blue_fire.png
new file mode 100644
index 0000000..8667a39
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/blue_fire.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/enemy1.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/enemy1.png
new file mode 100644
index 0000000..94f149b
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/enemy1.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/enemy_missile2.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/enemy_missile2.png
new file mode 100644
index 0000000..5011d75
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/enemy_missile2.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/fire.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/fire.png
new file mode 100644
index 0000000..8401034
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/fire.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/fire2.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/fire2.png
new file mode 100644
index 0000000..139aa61
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/fire2.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/missile.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/missile.png
new file mode 100644
index 0000000..86bb41b
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/missile.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/missile2.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/missile2.png
new file mode 100644
index 0000000..dacd610
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/missile2.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/ship.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/ship.png
new file mode 100644
index 0000000..cb7851c
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/ship.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/star3.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/star3.png
new file mode 100644
index 0000000..70af0f3
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/star3.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/transparent.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/transparent.png
new file mode 100644
index 0000000..3aa1e41
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/transparent.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.cpp b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.cpp
new file mode 100644
index 0000000..45a39e3
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.cpp
@@ -0,0 +1,122 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "leveltwo.h"
+#include <QtCore/qplugin.h>
+
+
+LevelTwo::LevelTwo()
+{
+}
+
+LevelTwo::~LevelTwo()
+{
+}
+
+QString LevelTwo::pathPrefix()
+{
+ /*
+QDir::rootPath()
+For Unix operating systems this returns "/".
+For Windows file systems this normally returns "c:/".
+On Symbian this typically returns "c:/data",
+*/
+
+#ifdef Q_WS_MAEMO_5
+ return "/home/user/.";
+#elif defined Q_OS_WIN32
+ return QDir::rootPath();
+#else
+ //return QDir::rootPath()+"/";
+ return "c:/System/";
+#endif
+}
+
+QStringList LevelTwo::levelSounds()
+{
+ QStringList list;
+
+
+ // NOTE: Mandatory sounds/indexs for the all levels
+ // 0 = Enemy explode
+ list.append(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/sound/enemy_explosion.wav");
+ // 1 = You explode
+ list.append(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/sound/myship_explosion.wav");
+ // 2 = Missile fires
+ list.append(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/sound/laser.wav");
+ // 3 = Emeny Missile fires
+ list.append(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/sound/rocket.wav");
+
+ // Additional sounds
+ list.append(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/sound/enableship.wav");
+ list.append(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/sound/level2.wav");
+
+
+ return list;
+}
+
+QVariant LevelTwo::getData(QVariant key)
+{
+ QVariant ret;
+ switch (key.toInt()) {
+ case 1: {
+ // Any data what you need for this key
+ // Set your data into QVariant (ret)
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ return ret;
+}
+
+QVariant LevelTwo::graphSize(QVariant pathToGraph)
+{
+ QVariant ret;
+ m_imageReader.setFileName(pathToGraph.toString());
+ QSize imageSize = m_imageReader.size();
+ ret.setValue(imageSize);
+ return ret;
+}
+
+// This Qt macro exports the plugin class LevelTwo with the name levelplugins.
+// There should be exactly one occurrence of this LevelTwo macro in a Qt plugin's source code.
+Q_EXPORT_PLUGIN2(levelplugins, LevelTwo);
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.h b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.h
new file mode 100644
index 0000000..b983210
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LevelTwo_H
+#define LevelTwo_H
+
+#include <QObject>
+#include <QDir>
+#include <QImageReader>
+
+#include "levelplugininterface.h"
+
+class LevelTwo : public LevelPluginInterface
+{
+ Q_OBJECT
+
+ // This macro tells Qt which interfaces the class implements.
+ // This is used when implementing plugins.
+ Q_INTERFACES(LevelPluginInterface)
+
+public:
+ LevelTwo();
+ ~LevelTwo();
+
+ static QString pathPrefix();
+
+public: // From LevelPluginInterface
+
+ QStringList levelSounds();
+
+ Q_INVOKABLE QVariant getData(QVariant key);
+
+ Q_INVOKABLE QVariant graphSize(QVariant pathToGraph);
+
+ Q_INVOKABLE QVariant enemyCount() { return QVariant(35); }
+ Q_INVOKABLE QVariant enemyRowCount() { return QVariant(0); }
+ Q_INVOKABLE QVariant enemySpeed() { return QVariant(20000); }
+ Q_INVOKABLE QVariant enemyFireSpeed() { return QVariant(500); }
+
+ // Root paths for the QML, Pictures and Sounds
+ Q_INVOKABLE QVariant qmlRootPath() { return QVariant(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/"); }
+ Q_INVOKABLE QVariant pictureRootPath() { return QVariant(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/gfx/"); }
+
+ // Full paths
+ Q_INVOKABLE QVariant pathToTransparentEnemyPic() {return QVariant(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/gfx/transparent.png");}
+ Q_INVOKABLE QVariant pathToMissilePic() {return QVariant(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/gfx/missile2.png");}
+ Q_INVOKABLE QVariant pathToEnemyMissilePic() {return QVariant(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/gfx/enemy_missile2.png");}
+ Q_INVOKABLE QVariant pathToMyShipPic() {return QVariant(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/gfx/ship.png");}
+
+protected:
+ QImageReader m_imageReader;
+};
+
+#endif // LevelTwo_H
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro
new file mode 100644
index 0000000..171ee6c
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro
@@ -0,0 +1,108 @@
+
+# Copyright (c) 2010 Nokia Corporation.
+
+TEMPLATE = lib
+
+#VERSION = 1.1.0
+
+CONFIG += plugin
+
+INCLUDEPATH += ../
+
+HEADERS = leveltwo.h
+
+SOURCES = leveltwo.cpp
+
+TARGET = $$qtLibraryTarget(leveltwo)
+
+OTHER_FILES += qml/Level.qml \
+ qml/Enemy.qml \
+ qml/Level.js
+
+
+# SYMBIAN ---------------------------
+symbian: {
+# Load predefined include paths (e.g. QT_PLUGINS_BASE_DIR) to be used in the pro-files
+load(data_caging_paths)
+
+# EPOCALLOWDLLDATA have to set true because Qt macros has initialised global data
+TARGET.EPOCALLOWDLLDATA=1
+TARGET.UID3 = 0xE07dfb67
+
+TARGET.CAPABILITY = NetworkServices \
+ Location \
+ ReadUserData \
+ WriteUserData \
+ LocalServices \
+ UserEnvironment
+
+# Defines plugin stub file into Symbian .pkg package
+pluginDep.sources = leveltwo.dll
+pluginDep.path = $$QT_PLUGINS_BASE_DIR/quickhitlevels
+DEPLOYMENT += pluginDep
+
+# Graphics and Sounds for the plugin
+BLD_INF_RULES.prj_exports += "gfx/background2.png ../winscw/c/Data/gfx/background2.png" \
+"gfx/background_loop.png ../winscw/c/Data/gfx/background_loop.png" \
+"gfx/enemy1.png ../winscw/c/Data/gfx/enemy1.png" \
+"gfx/fire2.png ../winscw/c/Data/gfx/fire2.png" \
+"gfx/fire.png ../winscw/c/Data/gfx/fire.png" \
+"gfx/missile2.png ../winscw/c/Data/gfx/missile2.png" \
+"gfx/enemy_missile2.png ../winscw/c/Data/gfx/enemy_missile2.png" \
+"gfx/ship.png ../winscw/c/Data/gfx/ship.png" \
+"gfx/transparent.png ../winscw/c/Data/gfx/transparent.png" \
+"gfx/star3.png ../winscw/c/Data/gfx/star3.png" \
+"gfx/blue_fire.png ../winscw/c/Data/gfx/blue_fire.png" \
+"sound/enemy_explosion.wav ../winscw/c/Data/sound/enemy_explosion.wav" \
+"sound/myship_explosion.wav ../winscw/c/Data/sound/myship_explosion.wav" \
+"sound/enableship.wav ../winscw/c/Data/sound/enableship.wav" \
+"sound/laser.wav ../winscw/c/Data/sound/laser.wav" \
+"sound/level2.wav ../winscw/c/Data/sound/level2.wav" \
+"qml/Level.qml ../winscw/c/Data/Level.qml" \
+"qml/Level.js ../winscw/c/Data/Level.js" \
+"qml/Enemy.qml ../winscw/c/Data/Enemy.qml"
+
+
+myQml.sources = qml/*
+myQml.path = c:/System/quickhitdata/leveltwo
+myGraphic.sources = gfx/*
+myGraphic.path = c:/System/quickhitdata/leveltwo/gfx
+mySound.sources = sound/*
+mySound.path = c:/System/quickhitdata/leveltwo/sound
+# Takes qml, graphics and sounds into Symbian SIS package file (.pkg)
+DEPLOYMENT += myQml myGraphic mySound
+
+target.path += $$[QT_INSTALL_PLUGINS]/quickhitlevels
+# Installs binaries
+INSTALLS += target
+}
+
+# WINDOWS ---------------------------
+win32: {
+
+# Copy level sounds and graphics into right destination
+system(mkdir c:\quickhitdata\leveltwo)
+system(mkdir c:\quickhitdata\leveltwo\gfx)
+system(mkdir c:\quickhitdata\leveltwo\sound)
+system(copy qml\*.* c:\quickhitdata\leveltwo)
+system(copy gfx\*.* c:\quickhitdata\leveltwo\gfx)
+system(copy sound\*.* c:\quickhitdata\leveltwo\sound)
+
+# Installs binaries
+target.path += $$[QT_INSTALL_PLUGINS]/quickhitlevels
+INSTALLS += target
+}
+
+# MAEMO_5 ---------------------------
+maemo5: {
+myQml.path = /home/user/.quickhitdata/leveltwo/
+myQml.files += qml/*
+myGraphic.path = /home/user/.quickhitdata/leveltwo/gfx/
+myGraphic.files += gfx/*
+mySound.path = /home/user/.quickhitdata/leveltwo/sound/
+mySound.files += sound/*
+
+target.path += /usr/lib/qt4/plugins/quickhitlevels
+# Installs qml, binaries, sounds and graphics
+INSTALLS += target myGraphic mySound myQml
+}
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/qml/Enemy.qml b/demos/mobile/quickhit/plugins/LevelTwo/qml/Enemy.qml
new file mode 100644
index 0000000..1b489b2
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/qml/Enemy.qml
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: enemy
+ objectName: "enemy"
+ smooth:true
+ opacity: 0 // 0=hidden by default
+ fillMode:Image.PreserveAspectFit
+ source:"file:/"+LevelPlugin.pictureRootPath()+"enemy1.png"
+
+ property int enemySpeed: LevelPlugin.enemySpeed()
+
+ function pause(doPause) {
+ if (doPause) {
+ upToDownAnim.pause()
+ rightLeftAnim.pause()
+ } else {
+ upToDownAnim.resume()
+ rightLeftAnim.resume()
+ }
+ }
+
+ function startMovingAnim() {
+ upToDownAnim.restart()
+ rightLeftAnim.restart()
+ }
+
+ // Right-left animation
+ SequentialAnimation {
+ id: rightLeftAnim
+ loops: Animation.Infinite
+ NumberAnimation { target:enemy; property:"x";
+ to:gameArea.width - enemy.width; easing.type: Easing.OutQuad; duration: 3000 }
+ NumberAnimation { target:enemy; property:"x"; to:0; easing.type: Easing.OutQuad; duration: 3000 }
+ }
+
+ // Up to down animation
+ SequentialAnimation {
+ id: upToDownAnim
+ PropertyAnimation { target:enemy; property:"y"; to: gameArea.height;
+ easing.type: Easing.Linear; duration: enemy.enemySpeed }
+ PropertyAction { target: enemy; properties: "opacity"; value: 0 }
+ }
+}
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/qml/Level.js b/demos/mobile/quickhit/plugins/LevelTwo/qml/Level.js
new file mode 100644
index 0000000..e2e1d3a
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/qml/Level.js
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+var hiddenEnemies = new Array()
+
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/qml/Level.qml b/demos/mobile/quickhit/plugins/LevelTwo/qml/Level.qml
new file mode 100644
index 0000000..69a6593
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/qml/Level.qml
@@ -0,0 +1,228 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.particles 1.0
+import "Level.js" as LevelScript
+
+Item {
+ id: enemies
+ anchors.fill: parent
+
+ property int enemiesCreated: 0
+ property int enemiesEnabled: 0
+
+ property int backOneTop
+ property int backTwoTop
+
+ // Long background 2
+ Image {
+ id: longBackground_2
+ source: "file:/"+LevelPlugin.pictureRootPath()+"background_loop.png"
+ fillMode: Image.Stretch
+ smooth: false
+ width: gameArea.width
+ height: gameArea.height
+ }
+
+ // Long background 1
+ Image {
+ id: longBackground_1
+ source: "file:/"+LevelPlugin.pictureRootPath()+"background_loop.png"
+ fillMode: Image.Stretch
+ smooth: false
+ width: gameArea.width
+ height: gameArea.height
+ }
+
+ // Long background Up to down animation
+ ParallelAnimation {
+ id: backgroundAnim;
+ loops: Animation.Infinite
+ PropertyAnimation { target:longBackground_1; property:"y";
+ from:backOneTop; to:gameArea.height; easing.type:Easing.Linear; duration:10000 }
+ PropertyAnimation { target:longBackground_2; property:"y";
+ from:backTwoTop; to:backOneTop; easing.type:Easing.Linear; duration:10000 }
+ }
+
+
+
+ // ***************************************************
+ // *** NOTE: This is mandatory for all level QML files
+ function pause(doPause) {
+ if (doPause) {
+ enemyCreationTimer.stop()
+ backgroundAnim.stop()
+ } else {
+ enemyCreationTimer.restart()
+ backgroundAnim.restart()
+ }
+ for (var i=0;i<LevelScript.hiddenEnemies.length;i++) {
+ var enemy = LevelScript.hiddenEnemies[i]
+ enemy.pause(doPause)
+ }
+ }
+
+
+ // ***************************************************
+ // *** NOTE: This is mandatory for all level QML files
+ objectName: "level"
+
+
+ // Enemy creation timer
+ Timer {
+ id: enemyCreationTimer
+ interval: 1000; running: false; repeat: true
+ onTriggered: {
+ enableEnemy()
+ }
+ }
+
+ function enableEnemy() {
+ if (enemiesEnabled < enemiesCreated) {
+ var enemy = LevelScript.hiddenEnemies[enemiesEnabled]
+ enemy.opacity = 1
+ enemy.x = GameEngine.randInt(0,gameArea.width-enemy.width-50)
+ enemy.startMovingAnim()
+ enemyCreationTimer.stop()
+ enemyCreationTimer.interval = GameEngine.randInt(500,2000)
+ enemyCreationTimer.restart()
+ enemiesEnabled = enemiesEnabled + 1
+ GameEngine.playSound(4) // NOTE: Enable enemy sound
+ } else {
+ enemyCreationTimer.stop()
+ }
+ }
+
+ // Hidden enemies group
+ function createHiddenEnemiesGroup() {
+ for (var i=0;i<LevelPlugin.enemyCount();i++) {
+ var enemyComponent = Qt.createComponent("file:/"+LevelPlugin.qmlRootPath()+"Enemy.qml")
+ var enemyObject = enemyComponent.createObject(enemies)
+ LevelScript.hiddenEnemies.push(enemyObject)
+ enemiesCreated = enemiesCreated + 1
+ }
+ }
+
+ Component.onCompleted: {
+ // Create hidden enemies
+ createHiddenEnemiesGroup()
+ // Flying moons animation
+ starBurstTimer.restart()
+ // Create enemies timer
+ enemyCreationTimer.restart()
+
+ // Start Long background loop animation
+ backOneTop = 0
+ longBackground_1.y = backOneTop;
+ backTwoTop = gameArea.height * -1
+ longBackground_2.y = backTwoTop;
+ backgroundAnim.restart()
+
+ GameEngine.playSounds(5,3) //NOTE: Level starts sound, 3 times
+ }
+
+ Timer {
+ id: starBurstTimer
+ interval: starParticles.lifeSpan+GameEngine.randInt(100,2000); running: false; repeat: true
+ onTriggered: {
+ starParticles.burst(GameEngine.randInt(4,6))
+ }
+ }
+
+ // ***************************************************
+ // *** NOTE: This is mandatory for all level QML files
+ // Execute explode particle effect
+ function explode(x,y) {
+ explodeParticles.x = x
+ explodeParticles.y = y
+ explodeParticles.burst(20)
+ explodeParticles.opacity = 1
+ }
+ // ***************************************************
+ // *** NOTE: This is mandatory for all level QML files
+ // Explode particle effect
+ Particles {
+ id: explodeParticles
+ opacity: 0
+ width: 1
+ height: 1
+ emissionRate: 0
+ source: "file:/"+LevelPlugin.pictureRootPath()+"blue_fire.png"
+ lifeSpan: 500
+ lifeSpanDeviation: 2000
+ count: -1
+ angle: 270
+ angleDeviation: 65
+ velocity: 100
+ velocityDeviation: 100
+ ParticleMotionGravity {
+ yattractor: 1000
+ xattractor: 300
+ acceleration: 50
+ }
+ }
+
+ Particles {
+ id: starParticles
+ y: -50
+ x: 0
+ width: parent.width
+ height: 50
+ emissionRate: 0
+ source: "file:/"+LevelPlugin.pictureRootPath()+"star3.png"
+ lifeSpan: 5000
+ count: -1
+ angle: 90
+ velocity: 100
+ opacity: 0.7
+ ParticleMotionGravity {
+ yattractor: 1000
+ xattractor: 500
+ }
+ }
+
+
+}
+
+
+
+
+
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/crash.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/crash.wav
new file mode 100644
index 0000000..8076f0f
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/crash.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/enableship.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/enableship.wav
new file mode 100644
index 0000000..6fe5fe8
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/enableship.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/enemy_explosion.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/enemy_explosion.wav
new file mode 100644
index 0000000..fd338e6
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/enemy_explosion.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/laser.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/laser.wav
new file mode 100644
index 0000000..c3b58b2
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/laser.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/level2.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/level2.wav
new file mode 100644
index 0000000..24d3917
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/level2.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/myship_explosion.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/myship_explosion.wav
new file mode 100644
index 0000000..e22d030
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/myship_explosion.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/rocket.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/rocket.wav
new file mode 100644
index 0000000..8c0dee9
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/rocket.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/rocket_explosion.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/rocket_explosion.wav
new file mode 100644
index 0000000..d2b451c
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/rocket_explosion.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/levelplugininterface.h b/demos/mobile/quickhit/plugins/levelplugininterface.h
new file mode 100644
index 0000000..b8d5018
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/levelplugininterface.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LEVELPLUGININTERFACE_H
+#define LEVELPLUGININTERFACE_H
+
+#include <QObject>
+#include <QVariant>
+
+class LevelPluginInterface : public QObject
+{
+public:
+ // Full paths to level sounds
+ virtual QStringList levelSounds() = 0;
+
+ // Generic key/value data
+ virtual QVariant getData(QVariant key) = 0;
+
+ // Request picture size
+ virtual QVariant graphSize(QVariant pathToGraph) = 0;
+
+ // Enemy count in the level
+ virtual QVariant enemyCount() = 0;
+ // Enemy row count in the level
+ virtual QVariant enemyRowCount() = 0;
+ // Enemy speed
+ virtual QVariant enemySpeed() = 0;
+ // Enemy fire speed
+ virtual QVariant enemyFireSpeed() = 0;
+
+ // QML root path
+ virtual QVariant qmlRootPath() = 0;
+ // Picture root path
+ virtual QVariant pictureRootPath() = 0;
+
+ // Paths for GameEngine and QuickHit internal QML files
+ virtual QVariant pathToTransparentEnemyPic() = 0;
+ virtual QVariant pathToMissilePic() = 0;
+ virtual QVariant pathToEnemyMissilePic() = 0;
+ virtual QVariant pathToMyShipPic() = 0;
+};
+
+// This Qt macro associates the given Identifier "Forum.Nokia.com.QuickHit.LevelPluginInterface/1.0"
+// to the interface class called LevelPluginInterface. The Identifier must be unique.
+Q_DECLARE_INTERFACE(LevelPluginInterface,
+ "Forum.Nokia.com.QuickHit.LevelPluginInterface/1.0");
+
+
+#endif // LEVELPLUGININTERFACE_H
diff --git a/demos/mobile/quickhit/quickhit.png b/demos/mobile/quickhit/quickhit.png
new file mode 100644
index 0000000..01d2d60
--- /dev/null
+++ b/demos/mobile/quickhit/quickhit.png
Binary files differ
diff --git a/demos/mobile/quickhit/quickhit.pro b/demos/mobile/quickhit/quickhit.pro
new file mode 100644
index 0000000..e5a4b3d
--- /dev/null
+++ b/demos/mobile/quickhit/quickhit.pro
@@ -0,0 +1,91 @@
+
+# Copyright (c) 2011 Nokia Corporation.
+
+QT += core gui declarative opengl
+
+VERSION = 1.1.1
+
+TARGET = quickhit
+TEMPLATE = app
+
+SOURCES += main.cpp \
+ mainwindow.cpp \
+ gameengine.cpp \
+ InvSounds.cpp \
+ myeventfilter.cpp \
+ ga_src/GEAudioBuffer.cpp \
+ ga_src/GEAudioOut.cpp \
+ ga_src/GEInterfaces.cpp
+
+HEADERS += mainwindow.h \
+ gameengine.h \
+ myeventfilter.h \
+ plugins/levelplugininterface.h \
+ InvSounds.h \
+ ga_src/GEAudioBuffer.h \
+ ga_src/GEAudioOut.h \
+ ga_src/GEInterfaces.h
+
+RESOURCES += resources.qrc
+
+# QtMultimedia from Qt
+QT += multimedia
+
+symbian {
+ # in Symbian 1 we do not have OpenGL available
+ contains(SYMBIAN_VERSION, 9.4) {
+ DEFINES += QT_NO_OPENGL
+ QT -= opengl
+ warning("No OpenGL support")
+ }
+
+ CONFIG += mobility
+ MOBILITY = systeminfo
+ TARGET = QuickHit
+ TARGET.UID3 = 0xe7ced714
+
+ TARGET.CAPABILITY = NetworkServices \
+ Location \
+ ReadUserData \
+ WriteUserData \
+ LocalServices \
+ UserEnvironment
+
+ LIBS += -lcone -leikcore -lavkon -lhwrmvibraclient
+
+ ICON = icon.svg
+
+ TARGET.EPOCSTACKSIZE = 0x14000
+ TARGET.EPOCHEAPSIZE = 0x100000 0x2000000
+}
+
+maemo5 {
+ CONFIG += mobility
+ MOBILITY = systeminfo
+
+ BINDIR = /opt/usr/bin
+ DATADIR = /usr/share
+ DEFINES += DATADIR=\\\"$$DATADIR\\\" \
+ PKGDATADIR=\\\"$$PKGDATADIR\\\"
+
+ INSTALLS += target \
+ desktop \
+ icon64
+
+ target.path = $$BINDIR
+ desktop.path = $$DATADIR/applications/hildon
+ desktop.files += quickhit.desktop
+
+ icon64.path = $$DATADIR/icons/hicolor/64x64/apps
+ icon64.files += quickhit.png
+}
+
+OTHER_FILES += \
+ Game.qml \
+ Game.js \
+ MyShip.qml \
+ Missile.qml \
+ Menu.qml \
+ MenuItem.qml \
+ Button.qml \
+ Message.qml
diff --git a/demos/mobile/quickhit/resources.qrc b/demos/mobile/quickhit/resources.qrc
new file mode 100644
index 0000000..8063bf7
--- /dev/null
+++ b/demos/mobile/quickhit/resources.qrc
@@ -0,0 +1,25 @@
+<RCC>
+ <qresource prefix="/">
+ <file>Game.qml</file>
+ <file>Game.js</file>
+ <file>MyShip.qml</file>
+ <file>Missile.qml</file>
+ <file>Menu.qml</file>
+ <file>MenuItem.qml</file>
+ <file>Button.qml</file>
+ <file>Message.qml</file>
+ <file>gfx/back.png</file>
+ <file>gfx/exit.png</file>
+ <file>gfx/pause.png</file>
+ <file>gfx/soundOn.png</file>
+ <file>gfx/soundOff.png</file>
+ <file>gfx/background2.png</file>
+ <file>gfx/bigship.png</file>
+ <file>gfx/quickhit_logo.png</file>
+ <file>sound/menu1.wav</file>
+ <file>sound/menu2.wav</file>
+ <file>sound/gamestart.wav</file>
+ <file>sound/youwin.wav</file>
+ <file>sound/gameover.wav</file>
+ </qresource>
+</RCC>
diff --git a/demos/mobile/quickhit/sound/gameover.wav b/demos/mobile/quickhit/sound/gameover.wav
new file mode 100644
index 0000000..e5b9e94
--- /dev/null
+++ b/demos/mobile/quickhit/sound/gameover.wav
Binary files differ
diff --git a/demos/mobile/quickhit/sound/gamestart.wav b/demos/mobile/quickhit/sound/gamestart.wav
new file mode 100644
index 0000000..8632fca
--- /dev/null
+++ b/demos/mobile/quickhit/sound/gamestart.wav
Binary files differ
diff --git a/demos/mobile/quickhit/sound/menu1.wav b/demos/mobile/quickhit/sound/menu1.wav
new file mode 100644
index 0000000..586ab2c
--- /dev/null
+++ b/demos/mobile/quickhit/sound/menu1.wav
Binary files differ
diff --git a/demos/mobile/quickhit/sound/menu2.wav b/demos/mobile/quickhit/sound/menu2.wav
new file mode 100644
index 0000000..70a61c1
--- /dev/null
+++ b/demos/mobile/quickhit/sound/menu2.wav
Binary files differ
diff --git a/demos/mobile/quickhit/sound/youwin.wav b/demos/mobile/quickhit/sound/youwin.wav
new file mode 100644
index 0000000..f48297d
--- /dev/null
+++ b/demos/mobile/quickhit/sound/youwin.wav
Binary files differ
diff --git a/dist/changes-4.7.3 b/dist/changes-4.7.3
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/dist/changes-4.7.3
diff --git a/dist/changes-4.7.4 b/dist/changes-4.7.4
new file mode 100644
index 0000000..a37e66a
--- /dev/null
+++ b/dist/changes-4.7.4
@@ -0,0 +1,31 @@
+Qt 4.7.4 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 4.7.0. For more details,
+refer to the online documentation included in this distribution. The
+documentation is also available online:
+
+ http://qt.nokia.com/doc/4.7
+
+The Qt version 4.7 series is binary compatible with the 4.6.x series.
+Applications compiled for 4.6 will continue to run with 4.7.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker or the Merge Request queue
+of the public source repository.
+
+Qt Bug Tracker: http://bugreports.qt.nokia.com
+Merge Request: http://qt.gitorious.org
+
+****************************************************************************
+* Library *
+****************************************************************************
+
+
+****************************************************************************
+* Platform Specific Changes *
+****************************************************************************
+
+
+****************************************************************************
+* Tools *
+****************************************************************************
+
diff --git a/doc/doc.pri b/doc/doc.pri
index 3cdac61..68d729b 100644
--- a/doc/doc.pri
+++ b/doc/doc.pri
@@ -15,6 +15,7 @@ win32:!win32-g++* {
$$unixstyle {
QDOC = cd $$QT_SOURCE_TREE/tools/qdoc3/test && QT_BUILD_TREE=$$QT_BUILD_TREE QT_SOURCE_TREE=$$QT_SOURCE_TREE $$QT_BUILD_TREE/bin/qdoc3 $$DOCS_GENERATION_DEFINES
+ COPYWEBKITGUIDE = $$QT_SOURCE_TREE/examples/webkit/webkit-guide
} else {
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, "/", "\\")
@@ -23,6 +24,7 @@ ADP_DOCS_QDOCCONF_FILE = qt-build-docs-online.qdocconf
QT_DOCUMENTATION = ($$QDOC qt-api-only.qdocconf assistant.qdocconf designer.qdocconf \
linguist.qdocconf qmake.qdocconf qdeclarative.qdocconf) && \
(cd $$QT_BUILD_TREE && \
+ $$QMAKE_COPY_DIR $$COPYWEBKITGUIDE $$QT_BUILD_TREE/doc-build/html-qt && \
$$GENERATOR doc-build/html-qt/qt.qhp -o doc/qch/qt.qch && \
$$GENERATOR doc-build/html-assistant/assistant.qhp -o doc/qch/assistant.qch && \
$$GENERATOR doc-build/html-designer/designer.qhp -o doc/qch/designer.qch && \
@@ -48,7 +50,7 @@ win32-g++*:isEmpty(QMAKE_SH) {
}
# Build rules:
-adp_docs.commands = ($$QDOC $$ADP_DOCS_QDOCCONF_FILE)
+adp_docs.commands = ($$QDOC $$ADP_DOCS_QDOCCONF_FILE && $$QMAKE_COPY_DIR $$COPYWEBKITGUIDE $$QT_BUILD_TREE/doc/html)
adp_docs.depends += sub-qdoc3 # qdoc3
qch_docs.commands = $$QT_DOCUMENTATION
qch_docs.depends += sub-qdoc3
diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc
index 8d8e6c6..93571bd 100644
--- a/doc/src/declarative/declarativeui.qdoc
+++ b/doc/src/declarative/declarativeui.qdoc
@@ -116,6 +116,8 @@ Qt applications.
\o \l{QML Modules}
\o \l{QML Documents}
\o \l{QML Global Object}
+\o \l{QML Internationalization}
+\o \l{QML Right-to-left User Interfaces}
\o \l{QML Security}
\o \l{Qt Declarative Module}
\endlist
diff --git a/doc/src/declarative/dynamicobjects.qdoc b/doc/src/declarative/dynamicobjects.qdoc
index 7c10760..90fb715 100644
--- a/doc/src/declarative/dynamicobjects.qdoc
+++ b/doc/src/declarative/dynamicobjects.qdoc
@@ -69,12 +69,14 @@ a \l Component object from this URL.
Once you have a \l Component, you can call its \l {Component::createObject()}{createObject()} method to create an instance of
the component. This function can take one or two arguments:
\list
-\o The first is the parent for the new item. Since graphical items will not appear on the scene without a parent, it is
- recommended that you set the parent this way. However, if you wish to set the parent later you can safely pass \c null to
- this function.
-\o The second is optional and is a script which assigns values to the item's properties during creation. This avoids warnings
- when certain properties have been bound to before they have been set by the code. Additionally, there are small performance
- benefits when instantiating objects in this way.
+\o The first is the parent for the new item. Since graphical items will not appear on the scene without a parent, it is
+ recommended that you set the parent this way. However, if you wish to set the parent later you can safely pass \c null to
+ this function.
+\o The second is optional and is a map of property-value items that define initial any property values for the item.
+ Property values specified by this argument are applied to the object before its creation is finalized, avoiding
+ binding errors that may occur if particular properties must be initialized to enable other property bindings.
+ when certain properties have been bound to before they have been set by the code. Additionally, there are small
+ performance benefits when compared to defining property values and bindings after the object is created.
\endlist
Here is an example. First there is \c Sprite.qml, which defines a simple QML component:
diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc
index 873d0de..8fb64c1 100644
--- a/doc/src/declarative/elements.qdoc
+++ b/doc/src/declarative/elements.qdoc
@@ -77,6 +77,7 @@ To see the QML elements listed by functional area, see the
\o \l {FocusScope} - Element that mediate keyboard focus changes
\o \l {Flickable} - Provides a surface that can be "flicked"
\o \l {Flipable} - Provides a surface that produces "flipping" effects
+\o \l {PinchArea} - Enables simple pinch gesture handling
\endlist
\section1 Positioners and Repeater
diff --git a/doc/src/declarative/examples.qdoc b/doc/src/declarative/examples.qdoc
index 06bd819..b7420e0 100644
--- a/doc/src/declarative/examples.qdoc
+++ b/doc/src/declarative/examples.qdoc
@@ -136,8 +136,7 @@ The examples can be found in Qt's \c examples/declarative directory.
\section2 Positioners
\list
-\o \l{declarative/positioners/addandremove}{Adding and Removing Items}
-\o \l{declarative/positioners/layoutdirection}{Layout Direction}
+\o \l{declarative/positioners}{Example}
\endlist
\section2 Key Interaction
@@ -197,13 +196,20 @@ The examples can be found in Qt's \c examples/declarative directory.
\o \l{declarative/i18n}{Example}
\endlist
+\section2 Right-to-left User Interfaces
+\list
+\o \l{declarative/righttoleft/layoutmirroring}{Layout mirroring}
+\o \l{declarative/righttoleft/layoutdirection}{Layout direction}
+\o \l{declarative/righttoleft/textalignment}{Text alignment}
+\endlist
+
\section2 Threading
\list
\o \l{declarative/threading/threadedlistmodel}{Threaded ListModel}
\o \l{declarative/threading/workerscript}{WorkerScript}
\endlist
-\section2 Screen orientation
+\section2 Screen Orientation
\list
\o \l{declarative/screenorientation}{Example}
\endlist
diff --git a/doc/src/declarative/pics/layoutmirroring.png b/doc/src/declarative/pics/layoutmirroring.png
new file mode 100644
index 0000000..df90ac4
--- /dev/null
+++ b/doc/src/declarative/pics/layoutmirroring.png
Binary files differ
diff --git a/doc/src/declarative/qdeclarativeperformance.qdoc b/doc/src/declarative/qdeclarativeperformance.qdoc
index 36b4878..6760869 100644
--- a/doc/src/declarative/qdeclarativeperformance.qdoc
+++ b/doc/src/declarative/qdeclarativeperformance.qdoc
@@ -136,4 +136,15 @@ The QML Viewer uses the raster graphics system by default for X11 and OS X. It a
includes a \c -opengl command line option which sets a QGLWidget as the viewport of the
view. On OS X, a QGLWidget is always used.
+You can also prevent QDeclarativeView from painting its window background if
+you will provide the background of your application using QML, e.g.
+
+\code
+QDeclarativeView window;
+window.setAttribute(Qt::WA_OpaquePaintEvent);
+window.setAttribute(Qt::WA_NoSystemBackground);
+window.viewport()->setAttribute(Qt::WA_OpaquePaintEvent);
+window.viewport()->setAttribute(Qt::WA_NoSystemBackground);
+\endcode
+
*/
diff --git a/doc/src/declarative/qmlinuse.qdoc b/doc/src/declarative/qmlinuse.qdoc
index 7380ef5..131be1b 100644
--- a/doc/src/declarative/qmlinuse.qdoc
+++ b/doc/src/declarative/qmlinuse.qdoc
@@ -207,7 +207,7 @@
<li><a href="qml-flipable.html">Flipable Element</a> - The Flipable item provides a surface that can be flipped or reflected.</li>
<li><a href="qml-focuspanel.html">FocusPanel Element</a> - The FocusPanel item explicitly creates a focus panel.</li>
<li><a href="qml-focusscope.html">FocusScope Element</a> - The FocusScope object explicitly creates a focus scope for focus management.</li>
- <li><a href="qml-gesturearea.html">GestureArea Element</a> - The GestureArea item enables simple gesture handling.</li>
+ <li><a href="qml-pincharea.html">PinchArea Element</a> - The PinchArea item enables simple pinch gesture handling.</li>
<li><a href="qml-keynavigation.html">KeyNavigation Element</a> - The KeyNavigation attached property supports key navigation by arrow keys.</li>
<li><a href="qml-keys.html">Keys Element</a> - The Keys attached property provides key handling to Items.</li>
<li><a href="qml-mousearea.html">MouseArea Element</a> - The MouseArea item enables simple mouse handling.</li>
diff --git a/doc/src/declarative/righttoleft.qdoc b/doc/src/declarative/righttoleft.qdoc
new file mode 100644
index 0000000..7db6136
--- /dev/null
+++ b/doc/src/declarative/righttoleft.qdoc
@@ -0,0 +1,195 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of this
+** file.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qml-righttoleft.html
+\title QML Right-to-left User Interfaces
+
+\section1 Overview
+
+This chapter discusses different approaches and options available for implementing right-to-left
+language support for Qt Quick applications. Some common right-to-left languages include Arabic, Hebrew,
+Persian and Urdu. Most changes include making sure that text translated to right-to-left languages
+is properly aligned to the right, and horizontally ordered content in views, lists and grids flows
+correctly from the right to left.
+
+In right-to-left language speaking cultures, people naturally scan and read graphic elements and text
+from the right to left. The general rule of thumb is that content (like photos, videos and maps) is not
+mirrored, but positioning of the content (like application layouts and the flow of visual elements) is
+mirrored. For example, photos shown in chronological order should flow from right to left, the
+low end range of the horizontal sliders should be located at the right side of the slider, and
+text lines should should be aligned to the right side of the available text area. The location of visual
+elements should not be mirrored when the position is related to a content; for example, when a
+position marker is shown to indicate a location on a map. Also, there are some special cases you may
+need to take into account where right-to-left language speakers are used to left-to-right
+positioning, for example when using number dialers in phones and media play, pause, rewind and
+forward buttons in music players.
+
+\section1 Text Alignment
+
+(This applies to the \l Text, \l TextInput and \l TextEdit elements.)
+
+When the horizontal alignment of a text item is not explicitly set, the text element is
+automatically aligned to the natural reading direction of the text. By default left-to-right text
+like English is aligned to the left side of the text area, and right-to-left text like Arabic is
+aligned to the right side of the text area. The alignment of a text element with empty text takes
+its alignment cue from \l QApplication::keyboardInputDirection(), which is based on the active
+system locale.
+
+This default locale-based alignment can be overriden by setting the \c horizontalAlignment
+property for the text element, or by enabling layout mirroring using the \l LayoutMirroring attached
+property, which causes any explicit left and right horizontal alignments to be mirrored.
+Note that when \l LayoutMirroring is set, the \c horizontalAlignment property value remains unchanged;
+the effective alignment of the text element that takes the mirroring into account can be read from the
+\c effectiveHorizontalAlignment property.
+
+\snippet doc/src/snippets/declarative/righttoleft.qml 0
+
+\section1 Layout direction of positioners and views
+
+(This applies to the \l Row, \l Grid, \l Flow, \l ListView and \l GridView elements.)
+
+From Qt Quick 1.1 onwards, elements used for horizontal positioning and model views have gained a \c layoutDirection
+property for controlling the horizontal direction of the layouts. Setting \c layoutDirection to
+\c Qt.RightToLeft causes items to be laid out from the right to left. By default Qt Quick follows
+the left-to-right layout direction.
+
+The horizontal layout direction can also be reversed through the \l LayoutMirroring attached property.
+This causes the effective \c layoutDirection of positioners and views to be mirrored. Note the actual value
+of the \c layoutDirection property will remain unchanged; the effective layout direction of positioners and
+views that takes the mirroring into account can be read from the \c effectiveLayoutDirection property.
+
+\snippet doc/src/snippets/declarative/righttoleft.qml 1
+
+\section1 Layout mirroring
+
+The attached property \l LayoutMirroring is provided as a convenience for easily implementing right-to-left
+support for existing left-to-right Qt Quick applications. It mirrors the behavior of \l {anchor-layout}
+{Item anchors}, the layout direction of \l{Using QML Positioner and Repeater Items}{positioners} and
+model views, and the explicit text alignment of QML text elements.
+
+You can enable layout mirroring for a particular \l Item:
+
+\snippet doc/src/snippets/declarative/righttoleft.qml 2
+
+Or set all child elements to also inherit the layout direction:
+
+\snippet doc/src/snippets/declarative/righttoleft.qml 3
+
+Applying mirroring in this manner does not change the actual value of the relevant anchor,
+\c layoutDirection or \c horizontalAlignment properties. The separate read-only property
+\c effectiveLayoutDirection can be used to query the effective layout
+direction of positioners and model views that takes the mirroring into account. Similarly the \l Text,
+\l TextInput and \l TextEdit elements have gained the read-only property \c effectiveHorizontalAlignment
+for querying the effective visual alignment of text. For anchors, the read only
+\l {Item::anchors}{anchors.mirrored} property reflects whether anchors have been mirrored.
+
+Note that application layouts and animations that are defined using \l {Item::}{x} property values (as
+opposed to anchors or positioner elements) are not affected by the \l LayoutMirroring attached property.
+Therefore, adding right-to-left support to these types of layouts may require some code changes to your application,
+especially in views that rely on both the anchors and x coordinate-based positioning. Here is one way to use
+the \l LayoutMirroring attached property to apply mirroring to an item that is positioned using \l {Item::}{x}
+coordinates:
+
+\snippet doc/src/snippets/declarative/righttoleft.qml 4
+
+Not all layouts should necessarily be mirrored. There are cases where a visual element is positioned to
+the right side of the screen for improved one-handed use, because most people are right-handed, and not
+because of the reading direction. In the case that a child element should not be affected by mirroring,
+set the \l {LayoutMirroring::enabled}{LayoutMirroring.enabled} property for that element to false.
+
+Qt Quick is designed for developing animated, fluid user interfaces. When mirroring your application, remember to test that
+the animations and transitions continue to work as expected. If you do not have the resources to add
+right-to-left support for your application, it may be better to just keep the application layouts left
+aligned and just make sure that text is translated and aligned properly.
+
+\section1 Mirroring icons
+
+(This applies to \l Image, \l BorderImage and \l AnimatedImage elements.)
+
+Most images do not need to be mirrored, but some directional icons, such as arrows, may need to be mirrored.
+The painting of these icons can be mirrored with a dedicated \c mirror property introduced in Qt Quick 1.1:
+
+\snippet doc/src/snippets/declarative/righttoleft.qml 5
+
+\section1 Default layout direction
+
+The \l {QML:Qt::application}{Qt.application.layoutDirection} property can be used to query the active layout direction of the
+application. It is based on QApplication::layoutDirection(), which most commonly determines the layout
+direction from the active language translation file.
+
+To define the layout direction for a particular locale, declare the dedicated string literal
+\c QT_LAYOUT_DIRECTION in context \c QApplication as either "LTR" or "RTL".
+
+You can do this by first introducing this line
+
+\code
+QT_TRANSLATE_NOOP("QApplication", "QT_LAYOUT_DIRECTION");
+\endcode
+
+somewhere in your QML source code and calling \c lupdate to generate the translation source file.
+
+\code
+lupdate myapp.qml -ts myapp.ts
+\endcode
+
+This will append the following declaration to the translation file, where you can fill in either "LTR" or
+"RTL" as the translation for the locale.
+
+\code
+<context>
+ <name>QApplication</name>
+ <message>
+ <location filename="myapp.qml" line="33"/>
+ <source>QT_LAYOUT_DIRECTION</source>
+ <translation type="unfinished">RTL</translation>
+ </message>
+</context>
+\endcode
+
+You can test that the layout direction works as expected by running your Qt Quick application with
+the compiled translation file:
+
+\code
+qmlviewer myapp.qml -translation myapp.qm
+\endcode
+
+You can test your application in right-to-left layout direction simply by executing qmlviewer with a
+command-line parameter "-reverse":
+
+\code
+qmlviewer myapp.qml -reverse
+\endcode
+
+The layout direction can also be set from C++ by calling the static function \l QApplication::setLayoutDirection():
+
+\code
+QApplication app(argc, argv);
+app.setLayoutDirection(Qt::RightToLeft);
+\endcode
+
+*/
diff --git a/doc/src/declarative/whatsnew.qdoc b/doc/src/declarative/whatsnew.qdoc
index f4359f9..6eb1548 100644
--- a/doc/src/declarative/whatsnew.qdoc
+++ b/doc/src/declarative/whatsnew.qdoc
@@ -29,22 +29,35 @@
\title What's new in Qt Quick
\page qtquick-whatsnew.html
-\section1 Qt 4.7.3 includes QtQuick 1.1
+\section1 Qt 4.7.4 includes QtQuick 1.1
-QtQuick 1.1 is a minor feature update.
+QtQuick 1.1 is a minor feature update. \e {import QtQuick 1.1} to use the new features.
\section2 PinchArea
PinchArea provides support for the common two finger pinch gesture.
+\section2 LayoutMirroring attached property
+
+\l {LayoutMirroring}{Layout mirroring} is useful when you need to support both left-to-right and right-to-left layout versions of your application that target different language areas.
+
+\section2 Anchors
+
+Added the following property:
+\list
+\o \l {Item::}{anchors.mirrored}
+\endlist
+
\section2 Text
Added the following properties:
\list
-\o lineSpacing
-\o lineCount
-\o maximumLineCount
-\o truncated
+\o \l {Text::}{lineHeight}
+\o \l {Text::}{lineHeightMode}
+\o \l {Text::}{lineCount}
+\o \l {Text::}{maximumLineCount}
+\o \l {Text::}{truncated}
+\o \l {Text::}{effectiveHorizontalAlignment}
\endlist
horizontalAlignment now accepts Text.AlignJustify alignment mode.
@@ -53,85 +66,107 @@ horizontalAlignment now accepts Text.AlignJustify alignment mode.
Added the following properties, methods and signal handlers:
\list
-\o canPaste
-\o lineCount
-\o deselect()
-\o moveCursorSelection(int pos, SelectionMode mode) to enable selection by word
-\o onLinkActivated(string link)
+\o \l {TextEdit::}{canPaste}
+\o \l {TextEdit::}{lineCount}
+\o \l {TextEdit::}{inputMethodComposing}
+\o \l {TextEdit::}{mouseSelectionMode}
+\o \l {TextEdit::}{effectiveHorizontalAlignment}
+\o \l {TextEdit::}{deselect()}
+\o \l {TextEdit::}{isRightToLeft()}
+\o \l {TextEdit::}{moveCursorSelection()} to enable selection by word
+\o \l {TextEdit::}{onLinkActivated}
\endlist
\section2 TextInput
Added the following properties and methods:
\list
-\o canPaste
-\o deselect()
-\o moveCursorSelection(int pos, SelectionMode mode) to enable selection by word
+\o \l {TextInput::}{canPaste}
+\o \l {TextInput::}{inputMethodComposing}
+\o \l {TextInput::}{mouseSelectionMode}
+\o \l {TextInput::}{effectiveHorizontalAlignment}
+\o \l {TextInput::}{deselect()}
+\o \l {TextInput::}{isRightToLeft()}
+\o \l {TextInput::}{moveCursorSelection()} to enable selection by word
\endlist
\section2 Image, BorderImage and AnimatedImage
Added the following properties:
\list
-\o cache
-\o mirror
+\o \l{Image::}{cache}
+\o \l{Image::}{mirror}
\endlist
\section2 Item
Added the following properties:
\list
-\o implicitWidth and implicitHeight
+\o \l{Item::}{implicitWidth} and \l{Item::}{implicitHeight}
\endlist
\section2 Flickable
Added the following methods:
\list
-\o resizeContent(qreal w, qreal h, QPointF center)
-\o returnToBounds()
+\o \l{Flickable::}{resizeContent()}
+\o \l{Flickable::}{returnToBounds()}
+\endlist
+
+\section2 MouseArea
+
+Added the following property:
+\list
+\o \l{MouseArea::}{preventStealing}
\endlist
\section2 ListView and GridView
-Added the following methods:
+Added the following properties and methods:
\list
-\o positionViewAtBeginning()
-\o positionViewAtEnd()
+\o \l{ListView::}{layoutDirection}
+\o \l{ListView::}{effectiveLayoutDirection}
+\o \l{ListView::}{positionViewAtBeginning()}
+\o \l{ListView::}{positionViewAtEnd()}
\endlist
-\section2 Flow, Grid, Row
+\section2 Flow, Grid and Row
Added the following properties:
\list
-\o layoutDirection
+\o \l{Flow::}{layoutDirection}
+\o \l{Flow::}{effectiveLayoutDirection}
\endlist
\section2 Repeater
Added the following methods and signal handlers:
\list
-\o onItemAdded()
-\o onItemRemoved()
-\o itemAt(int index)
+\o \l{Repeater::}{onItemAdded}
+\o \l{Repeater::}{onItemRemoved}
+\o \l{Repeater::}{itemAt()}
\endlist
\section2 Component
-The createObject() method now accepts a map of initial property values for the created object.
+\list
+\o The \l{Component::}{createObject()} method now accepts a map of initial property values for
+the created object.
+\endlist
\section2 Qt
-Added the following properties and methods:
\list
-\o application.layoutDirection
-\o application.active
+\o Added the \l {QML:Qt::application}{Qt.application} object to hold generic global application
+properties.
\endlist
\section2 Other changes
\list
-\o Functions can be assigned to properties from JavaScript to create property bindings
+\o Functions can be \l{Binding Properties from JavaScript}{assigned to properties from JavaScript}
+to create property bindings.
+\o QtQuick now supports Right to Left layout in positioners, views, anchors and text elements.
\endlist
diff --git a/doc/src/demos/guitartuner.qdoc b/doc/src/demos/guitartuner.qdoc
new file mode 100644
index 0000000..c669765
--- /dev/null
+++ b/doc/src/demos/guitartuner.qdoc
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of this
+** file.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page guitartuner_example.html
+ \title Guitar Tuner Example
+ \example demos/mobile/guitartuner
+
+The Guitar Tuner application can be used to tune guitar strings by analyzing the
+audio recorded by the device microphone. Guitar Tuner can be also used in the
+listening mode. It will then play the audio by the corresponding frequency, and
+the user can tune the guitar by ear. The application demonstrates the audio-in
+and the audio-out interfaces of
+\l{external: Mobility Multimedia}{Qt Mobility Multimedia} and integrating Qt
+code to the Qt Quick UI.
+
+ The example is hosted in Projects Forum Nokia: https://projects.forum.nokia.com/guitartuner
+
+ \image qml-guitartuner-example.png
+*/
diff --git a/doc/src/demos/mobiledemos.qdoc b/doc/src/demos/mobiledemos.qdoc
new file mode 100644
index 0000000..47241a6
--- /dev/null
+++ b/doc/src/demos/mobiledemos.qdoc
@@ -0,0 +1,39 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of this
+** file.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+/*!
+ \example demos/mobile/quickhit
+ \title Quick Hit Demo
+
+ This demo shows how to use Mobility APIs to access device audio
+ capabilities. Uses the multimedia and systeminfo modules of
+ \l{external: Qt Mobility Manual}{Qt Mobility}.
+
+*/
+
+
diff --git a/doc/src/demos/qcamera.qdoc b/doc/src/demos/qcamera.qdoc
new file mode 100644
index 0000000..315e82a6
--- /dev/null
+++ b/doc/src/demos/qcamera.qdoc
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of this
+** file.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page qcamera_example.html
+ \title QCamera Example
+ \example demos/mobile/qcamera
+
+ This Qt C++ application demonstrates how to use Multimedia, Messaging and Contacts modules from \l{external: Qt Mobility Manual}{Qt Mobility}.
+
+ \image qcameraexample.png
+
+ The application shows the viewfinder picture from the device camera and allows the user to capture images. Captured images are stored into the gallery and can be sent as an MMS message to a friend. Application listens for incoming MMS messages in the Inbox folder. If the MMS message contains a picture, the application asks the user whether he or she wants to add the picture as an avatar of the sender. The person's general contact information has to exist in the device phonebook in order to store the avatar in it.
+
+ The application uses own MyVideoSurface video surface derived from QAbstractVideoSurface for showing camera view finder pictures. A video surface presents a continuous stream of identically formatted frames.
+
+ \snippet demos/mobile/qcamera/cameraexample.cpp 0
+
+ The application handles Graphics Out Of Memory (GOOM) events in it's QApplication::symbianEventFilter() method.
+
+ \snippet demos/mobile/qcamera/main.cpp 0
+
+ \section1 Required capabilities
+
+ Application can be self-signed.
+
+ After enabling Qt Mobility Messaging module (MESSAGING_ENABLED flag in .pro file)
+ from the project file is ReadDeviceData WriteDeviceData capabilities also needed and
+ application have to be Developer Signed. Enabling Messaging adds MMS sending feature for the application.
+
+ \section1 Compatibility
+
+ Qt SDK 1.1
+
+ Qt 4.7.2 for Symbian
+
+ QtMobility 1.1.1
+
+ Tested on: Nokia N8, Nokia E7
+
+ Developed with: Qt SDK 1.1
+
+
+*/
diff --git a/doc/src/demos/qml-qtbubblelevel.qdoc b/doc/src/demos/qml-qtbubblelevel.qdoc
new file mode 100644
index 0000000..63ac286
--- /dev/null
+++ b/doc/src/demos/qml-qtbubblelevel.qdoc
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of this
+** file.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page qtbubblelevel_example.html
+ \title Qt Bubble Level Example
+ \example demos/mobile/qtbubblelevel
+
+Qt Bubble Level is a simple application that uses
+\l{external: Qt Mobility Manual}{Qt Mobility's} accelerometer APIs and hardware
+sensor information to calculate the inclination of the device and presents this
+as atraditional bubble level. The application provides a calibration feature to
+handle any possible errors in accelerometer readings. The example is hosted in
+Projects Forum Nokia: https://projects.forum.nokia.com/qtbubblelevel
+
+ \image qml-qtbubblelevel-demo.png
+
+ \section1 Initialising the application
+
+ All of the initialisations are done in the main function.
+
+ First, QDeclarativeView is created to intepret the QML files. The QML file given is found in the Qt resource. The root QML element is set to resize to the view whenever the view is resized.
+
+ \snippet demos/mobile/qtbubblelevel/main.cpp 0
+
+ The Settings object will handle the loading or storing of the calibration value. Next, we create instances from QAccelerometer and AccelerometerFilter and attach the filter to the sensor.
+
+ \snippet demos/mobile/qtbubblelevel/main.cpp 1
+
+ The Qt code is then connected to QML code by using Qt Signals and Slots connections. First, the root object is retrieved from QDeclarativeView. The root object now represents the Qt object of the QML root element.
+
+ The saveCorrectionAngle signal of the QML root element is connected to the Qt slot saveCorrectionAngle. The rotationChanged and correctionAngle Qt signals are connected to the handleRotation and setCorrectionAngle slot of the QML root element. Finally, the quit signal of QDeclarativeEngine is connected to QApplication's quit slot.
+
+ \snippet demos/mobile/qtbubblelevel/main.cpp 2
+
+ On the Maemo target, the application needs a minimise button, so we connect one additional QML signal to the Qt slot. The minimise button is made visible by setting the value of the QML root element's taskSwitcherVisible property to true.
+
+ \snippet demos/mobile/qtbubblelevel/main.cpp 3
+
+ The correction factor of the accelerometer is retrieved from persistent storage by using QSettings. The correction factor is signalled to the QML side by using the function setCorrectionAngle. The accelerometer sensor is started and it will eventually begin to signal the changes in accelerometer readings.
+
+ \snippet demos/mobile/qtbubblelevel/main.cpp 4
+
+ Finally, in the end of the function the view is shown in full screen on mobile devices. On other targets, the application is shown as 800 x 480 resolution in the 100, 100 position from the top-left corner of the desktop.
+
+ \snippet demos/mobile/qtbubblelevel/main.cpp 5
+
+ \section1 Accessing the accelerometer information
+
+ The inclination of the device is resolved by using the QAccelerometer sensor of QtMobility. We already created the sensor in the main function and attached our self-derived AccelerometerFilter object to it. Here is the definition of the AccelerometerFilter class:
+
+ \snippet demos/mobile/qtbubblelevel/accelerometerfilter.h 0
+
+ The class is multiderived from QObject and QAccelerometerFilter classes. The QAccelerometerFilter class is derived from QObject because we want to use Qt Signals and Slots to signal changes in accelerometer readings.
+
+ The members x, y, and z store the previous values of the sensor reading in order to implement a low pass filter to the values.
+
+ In the implementation of the AccelerometerFilter class, we first read the value of each axis from the QAccelerometerReading object. The values are then converted from radians to degrees and applied the low pass filter to reduce noise in the sensor readings. Different low pass factors are used depending on the platform (these were determined to be good via experimenting). Finally, the calculated value is emitted.
+
+ Note that the accelerometer sensors are oriented differently in Symbian and Maemo devices, and we must account for this by using platform-specific code.
+
+ \snippet demos/mobile/qtbubblelevel/accelerometerfilter.cpp 0
+
+ \section1 The Qt Quick UI
+
+ BubbleLevel.qml is the main QML element. It represents the wooden board of the bubble level, and it also acts as a connection point between the QML and the Qt side. In the beginning of the element, there are two signals, two functions, and one property. All of these define the interface between Qt and QML.
+
+ On the Maemo platform, when the application is to be minimised, minimizeApplication is signalled. When a new calibration factor is to be stored in the device's memory, saveCorrectionAngle is signalled.
+
+ The handleRotation function acts as a Qt slot to which the AccelerometerFilters signal rotationChanged is connected. Similarly, the setCorrectionAngle function also acts as a Qt slot to which the Settings object's signal, correctionAngle, is connected.
+
+ The property alias taskSwitcherVisible is provided to allow the Qt model to show or hide the task switcher button which minimises the application. This is only meaningful on Maemo platforms, where every application normally has a task switcher button.
+
+ \snippet demos/mobile/qtbubblelevel/qml/BubbleLevel.qml 0
+
+ The Tube element represents the the glass tube of the bubble level. It is anchored to the centre of the wooden board. The width and height are calculated with specific factors to make the glass tube scale to different resolutions.
+
+ \snippet demos/mobile/qtbubblelevel/qml/BubbleLevel.qml 1
+
+ In the implementation of Tube.qml, the property deg represents the current inclination. The x-position of the bubble is bound to the JavaScript function calX which is called every time the property deg, center, or bubblCenter is changed. The function places the bubble in the corresponding place on its parent.
+
+ \snippet demos/mobile/qtbubblelevel/qml/Tube.qml 0
+*/
diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc
index d4e2a7a..103f474 100644
--- a/doc/src/development/qmake-manual.qdoc
+++ b/doc/src/development/qmake-manual.qdoc
@@ -1691,8 +1691,7 @@
\section1 INCLUDEPATH
This variable specifies the #include directories which should be
- searched when compiling the project. Use ';' or a space as the
- directory separator.
+ searched when compiling the project.
For example:
diff --git a/doc/src/examples/qml-examples.qdoc b/doc/src/examples/qml-examples.qdoc
index dc478b4..68deae7 100644
--- a/doc/src/examples/qml-examples.qdoc
+++ b/doc/src/examples/qml-examples.qdoc
@@ -271,23 +271,55 @@
*/
/*!
- \title Positioners: Adding and Removing Items Example
- \example declarative/positioners/addandremove
+ \title Right-to-left User Interfaces: Text Alignment Example
+ \example declarative/righttoleft/textalignment
- This example shows how to use the positioner elements such as \l Row, \l Column,
- \l Grid and \l Flow, in particular how to add and remove items with appropriate transitions.
+ This example shows how the horizontal alignment of \l Text,
+ \l TextInput and \l TextEdit is affected by the reading direction
+ of the text and by the layout mirrroring. Click on the gray buttons
+ shown at the bottom of the example to toggle between different
+ horizontal alignment options.
- \image qml-positioners-example.png
+ \sa {QML Right-to-left User Interfaces}
*/
/*!
- \title Positioners: Layout Direction Example
- \example declarative/positioners/layoutdirection
+ \title Right-to-left User Interfaces: Layout Direction Example
+ \example declarative/righttoleft/layoutdirection
+
+ This example shows how to control the horizontal layout direction of
+ \l Row, \l Grid and \l Flow positioners, and \l ListView and \l GridView
+ model views. Click on the gray buttons shown at the bottom of the example
+ to toggle the layout direction of the shown elements.
+
+ \image qml-righttoleft-layoutdirection-example.png
+
+ \sa {QML Right-to-left User Interfaces}
+*/
+
+
+/*!
+ \title Right-to-left User Interfaces: Layout Mirroring Example
+ \example declarative/righttoleft/layoutmirroring
- This example shows how to control the horizontal layout direction of
- \l Row, \l Grid and \l Flow positioners.
+ This example shows how to mirror the application layouts
+ using \l LayoutMirroring attached property. Click on the grey button
+ shown at the bottom of the example to enable or disable the
+ layout mirroring.
- \image qml-positioners-layoutdirection-example.png
+ \image qml-righttoleft-layoutmirroring-example.png
+
+ \sa {QML Right-to-left User Interfaces}
+*/
+
+/*!
+ \title Positioners Example
+ \example declarative/positioners
+
+ This example shows how to use the positioner elements such as \l Row, \l Column,
+ \l Grid and \l Flow.
+
+ \image qml-positioners-example.png
*/
/*!
@@ -457,7 +489,7 @@
/*!
- \title Screen orientation
+ \title Screen Orientation
\example declarative/screenorientation
This example shows how to implement screen orientation support for your application.
diff --git a/doc/src/frameworks-technologies/accessible.qdoc b/doc/src/frameworks-technologies/accessible.qdoc
index e7bf171..3f63353 100644
--- a/doc/src/frameworks-technologies/accessible.qdoc
+++ b/doc/src/frameworks-technologies/accessible.qdoc
@@ -52,12 +52,12 @@
An application does not usually communicate directly with
assistive tools but through an assistive technology, which is a
bridge for exchange of information between the applications and
- the tools. Information about user interface elements, such
- as buttons and scroll bars, is exposed to the assistive technologies.
- Qt supports Microsoft Active Accessibility (MSAA) on Windows and
- Mac OS X Accessibility on Mac OS X.
- On Unix/X11, support is preliminary. The individual technologies
- are abstracted from Qt, and there is only a single interface to
+ the tools. Information about user interface elements, such as
+ buttons and scroll bars, is exposed to the assistive technologies.
+ Qt supports Microsoft Active Accessibility (MSAA) on Windows, Mac
+ OS X Accessibility on Mac OS X, and AT-SPI on Unix/X11. On
+ Unix/X11, support is preliminary. The individual technologies are
+ abstracted from Qt, and there is only a single interface to
consider. We will use MSAA throughout this document when we need
to address technology related issues.
@@ -333,10 +333,16 @@
\section2 QAccessibleWidget Example
Instead of creating a custom widget and implementing an interface
- for it, we will show how accessibility can be implemented for one of
- Qt's standard widgets: QSlider. Making this widget accessible
- demonstrates many of the issues that need to be faced when making
- a custom widget accessible.
+ for it, we will show how accessibility is implemented for one of
+ Qt's standard widgets: QSlider. The accessible interface,
+ QAccessibleSlider, inherits from QAccessibleAbstractSlider, which
+ in turn inherits QAccessibleWidget. You do not need to examine the
+ QAccessibleAbstractSlider class to read this section. If you want
+ to take a look, the code for all of Qt's accessible interfaces are
+ found in src/plugins/accessible/widgets. Here is the
+ QAccessibleSlider's constructor:
+
+ \snippet doc/src/snippets/accessibilityslidersnippet.cpp 0
The slider is a complex control that functions as a
\l{QAccessible::}{Controller} for its accessible children.
@@ -346,8 +352,6 @@
using a controlling signal, which is a mechanism provided by
QAccessibleWidget. We do this in the constructor:
- \snippet doc/src/snippets/accessibilityslidersnippet.cpp 0
-
The choice of signal shown is not important; the same principles
apply to all signals that are declared in this way. Note that we
use QLatin1String to ensure that the signal name is correctly
@@ -507,10 +511,10 @@
plugin template, and the library containing the plugin must be
placed on a path where Qt searches for accessible plugins.
- We will go through the implementation of \c SliderPlugin, which is an
- accessible plugin that produces interfaces for the
- QAccessibleSlider we implemented in the \l{QAccessibleWidget Example}.
- We start with the \c key() function:
+ We will go through the implementation of \c SliderPlugin, which is
+ an accessible plugin that produces the QAccessibleSlider interface
+ from the \l{QAccessibleWidget Example}. We start with the \c key()
+ function:
\snippet doc/src/snippets/accessibilitypluginsnippet.cpp 0
@@ -521,13 +525,12 @@
\snippet doc/src/snippets/accessibilitypluginsnippet.cpp 1
- We check whether the interface requested is for the QSlider; if it
- is, we create and return an interface for it. Note that \c object
- will always be an instance of \c classname. You must return 0 if
- you do not support the class.
- \l{QAccessible::}{updateAccessibility()} checks with the
- available accessibility plugins until it finds one that does not
- return 0.
+ We check whether the interface requested is for QSlider; if it is,
+ we create and return an interface for it. Note that \c object will
+ always be an instance of \c classname. You must return 0 if you do
+ not support the class. \l{QAccessible::}{updateAccessibility()}
+ checks with the available accessibility plugins until it finds one
+ that does not return 0.
Finally, you need to include macros in the cpp file:
@@ -536,9 +539,9 @@
The Q_EXPORT_PLUGIN2 macro exports the plugin in the \c
SliderPlugin class into the \c acc_sliderplugin library. The first
argument is the name of the plugin library file, excluding the
- file suffix, and the second is the class name. For more information
- on plugins, consult the plugins \l{How to Create Qt
- Plugins}{overview document}.
+ file suffix, and the second is the class name. For more
+ information on plugins, you can consult the plugins \l{How to
+ Create Qt Plugins}{overview document}.
You can omit the first macro unless you want the plugin
to be statically linked with the application.
@@ -555,7 +558,7 @@
\l{QAccessiblePlugin::}{create()} - a QString and a QObject. It
also works the same way. You install the factory with the
\l{QAccessible::}{installFactory()} function. We give an example
- of how to create a factory for the \c SliderPlugin class:
+ of how to create a factory for the \c QAccessibleSlider interface:
\snippet doc/src/snippets/accessibilityfactorysnippet.cpp 0
\dots
diff --git a/doc/src/getting-started/demos.qdoc b/doc/src/getting-started/demos.qdoc
index 48a5fca..9366259 100644
--- a/doc/src/getting-started/demos.qdoc
+++ b/doc/src/getting-started/demos.qdoc
@@ -39,7 +39,7 @@
\l{Qt Examples} and are used to highlight certain features of
Qt.
- \table
+ \table
\header
\o {2,1} Getting an Overview
\row
@@ -54,6 +54,17 @@
If you are new to Qt, and want to start developing applications,
you should probably start by going through the \l{Tutorials}.
+ \keyword qt-mobile-demos
+ \section1 Mobile Applications
+ These are demonstrations of some of the capabilities of \l{Qt Quick} and
+ \l{external: Qt Mobility Manual}{Mobility} to create feature rich mobile
+ applications.
+ \list
+ \o \l{Guitar Tuner Example}{Guitar Tuner} - a guitar tuner made with a QML frontend and a Mobility based backend
+ \o \l{Quick Hit Demo}{Quick Hit} - a game that uses multimedia and Qt Quick
+ \o \l{Qt Bubble Level Example}{Qt Bubble Level} - a game that utilizes hardware sensors for effects
+ \o \l{QCamera Example}{QCamera} - a camera application that accesses mobile contacts and networking
+ \endlist
\section1 Painting
\list
@@ -105,19 +116,19 @@
\list
\o \l{demos/mainwindow}{Main Window} shows Qt's extensive support for main window
features, such as tool bars, dock windows, and menus.
- \o \l{demos/macmainwindow}{Mac Main Window} shows how to create main window applications that has
+ \o \l{demos/macmainwindow}{Mac Main Window} shows how to create main window applications that has
the same appearance as other Mac OS X applications.
\endlist
\section1 Graphics View
\list
- \o \l{demos/chip}{40000 Chips} uses the \l{Graphics View Framework} to
- efficiently display a large number of individual graphical items on
- a scrolling canvas and highlighting features including rotation,
+ \o \l{demos/chip}{40000 Chips} uses the \l{Graphics View Framework} to
+ efficiently display a large number of individual graphical items on
+ a scrolling canvas and highlighting features including rotation,
zooming, level of detail control, and item selection.
- \o \l{demos/embeddeddialogs}{Embedded Dialogs} showcases Qt 4.4's
- \e{Widgets on the Canvas} feature by embedding several
+ \o \l{demos/embeddeddialogs}{Embedded Dialogs} showcases Qt 4.4's
+ \e{Widgets on the Canvas} feature by embedding several
fully-functional dialogs in a scene.
\o \l{demos/boxes}{Boxes} showcases Qt's OpenGL support and the
integration with the \l{Graphics View Framework}.
diff --git a/doc/src/howtos/developmentsteps.qdoc b/doc/src/howtos/developmentsteps.qdoc
index e898bf5..078de80 100644
--- a/doc/src/howtos/developmentsteps.qdoc
+++ b/doc/src/howtos/developmentsteps.qdoc
@@ -94,7 +94,7 @@ great way to do it.
Not knowing a better place to start, you begin by taking a cue from web design
and plan a wireframe, which helps
-\l{http://doc.qt.nokia.com/qtcreator-snapshot/creator-visual-editor.html}{define the application layout},
+\l{external: Developing Qt Quick Applications}{define the application layout},
content and user interaction. You decide on breaking the field of the screen
space into three roughly equal size parts. There will be one section across the
top, which will span the width of the screen, and two sections in the lower
@@ -130,7 +130,7 @@ quickly:
Devising a user friendly interface to audio playback is not as intuitive as you
first thought. Since there exist a ready made component for
-\l{http://doc.qt.nokia.com/qtmobility-1.1.0/qml-multimedia.html}{multimedia},
+\l{external: Mobility Multimedia}{multimedia},
you remove the bottom left field and now have the screen split in two. You add
textual links for each of the five target languages, and when the user clicks
one of them the message text changes and the appropriate audio plays back. It is
@@ -164,7 +164,7 @@ for your current and future projects:
using \l{Qt WebKit}
\o An \l{qt-rendering-painting-system}{OpenGL} based UI for embedded platforms
\o \l{Gestures Programming}{Touch} screen support
-\o \l{http://doc.qt.nokia.com/qtmobility-1.1.0/location-overview.html}{Location} based applications
+\o \l{external: Mobility Location}{Location} based applications
\o \l{qt-technologies}{Much, much more}
\endlist
diff --git a/doc/src/images/qcameraexample.png b/doc/src/images/qcameraexample.png
new file mode 100644
index 0000000..cdf7d4e
--- /dev/null
+++ b/doc/src/images/qcameraexample.png
Binary files differ
diff --git a/doc/src/images/qml-guitartuner-example.png b/doc/src/images/qml-guitartuner-example.png
new file mode 100644
index 0000000..2f13e8d
--- /dev/null
+++ b/doc/src/images/qml-guitartuner-example.png
Binary files differ
diff --git a/doc/src/images/qml-qtbubblelevel-demo.png b/doc/src/images/qml-qtbubblelevel-demo.png
new file mode 100644
index 0000000..9d5bc4b
--- /dev/null
+++ b/doc/src/images/qml-qtbubblelevel-demo.png
Binary files differ
diff --git a/doc/src/images/qml-righttoleft-layoutdirection-example.png b/doc/src/images/qml-righttoleft-layoutdirection-example.png
new file mode 100644
index 0000000..381ecd7
--- /dev/null
+++ b/doc/src/images/qml-righttoleft-layoutdirection-example.png
Binary files differ
diff --git a/doc/src/images/qml-righttoleft-layoutmirroring-example.png b/doc/src/images/qml-righttoleft-layoutmirroring-example.png
new file mode 100644
index 0000000..992c876
--- /dev/null
+++ b/doc/src/images/qml-righttoleft-layoutmirroring-example.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_arcTo.png b/doc/src/images/webkit-guide/canvas_arcTo.png
new file mode 100644
index 0000000..6bc1871
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_arcTo.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_arcTo2.png b/doc/src/images/webkit-guide/canvas_arcTo2.png
new file mode 100644
index 0000000..5f9d32d
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_arcTo2.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_clip-complex.png b/doc/src/images/webkit-guide/canvas_clip-complex.png
new file mode 100644
index 0000000..cb582ba
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_clip-complex.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_clip.png b/doc/src/images/webkit-guide/canvas_clip.png
new file mode 100644
index 0000000..c397f5e
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_clip.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_clip_aqu.png b/doc/src/images/webkit-guide/canvas_clip_aqu.png
new file mode 100644
index 0000000..d0696d6
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_clip_aqu.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_closepath.gif b/doc/src/images/webkit-guide/canvas_closepath.gif
new file mode 100644
index 0000000..e32024a
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_closepath.gif
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_composite.png b/doc/src/images/webkit-guide/canvas_composite.png
new file mode 100644
index 0000000..6e20efa
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_composite.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_context.gif b/doc/src/images/webkit-guide/canvas_context.gif
new file mode 100644
index 0000000..f18e52ca
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_context.gif
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_lineStrokeTo.gif b/doc/src/images/webkit-guide/canvas_lineStrokeTo.gif
new file mode 100644
index 0000000..e05aa00
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_lineStrokeTo.gif
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_linecap.png b/doc/src/images/webkit-guide/canvas_linecap.png
new file mode 100644
index 0000000..72ecce5
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_linecap.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_math.png b/doc/src/images/webkit-guide/canvas_math.png
new file mode 100644
index 0000000..c039a38
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_math.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_math_rotate.png b/doc/src/images/webkit-guide/canvas_math_rotate.png
new file mode 100644
index 0000000..e80cc09
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_math_rotate.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_pattern.png b/doc/src/images/webkit-guide/canvas_pattern.png
new file mode 100644
index 0000000..6b593bc
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_pattern.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_rectangles.gif b/doc/src/images/webkit-guide/canvas_rectangles.gif
new file mode 100644
index 0000000..3b44cc5
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_rectangles.gif
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_rotate.png b/doc/src/images/webkit-guide/canvas_rotate.png
new file mode 100644
index 0000000..20947fd
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_rotate.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_scale.png b/doc/src/images/webkit-guide/canvas_scale.png
new file mode 100644
index 0000000..3b26fde
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_scale.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_scalex.png b/doc/src/images/webkit-guide/canvas_scalex.png
new file mode 100644
index 0000000..d4e76aa
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_scalex.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_scaley.png b/doc/src/images/webkit-guide/canvas_scaley.png
new file mode 100644
index 0000000..61462b9
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_scaley.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_skewx.png b/doc/src/images/webkit-guide/canvas_skewx.png
new file mode 100644
index 0000000..c9bcb67
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_skewx.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_skewy.png b/doc/src/images/webkit-guide/canvas_skewy.png
new file mode 100644
index 0000000..594ac84
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_skewy.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_startAngle.png b/doc/src/images/webkit-guide/canvas_startAngle.png
new file mode 100644
index 0000000..f81562e
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_startAngle.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_text.png b/doc/src/images/webkit-guide/canvas_text.png
new file mode 100644
index 0000000..6983047
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_text.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_translate.png b/doc/src/images/webkit-guide/canvas_translate.png
new file mode 100644
index 0000000..7bb3ae7
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_translate.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/canvas_translatey.png b/doc/src/images/webkit-guide/canvas_translatey.png
new file mode 100644
index 0000000..9196bf5
--- /dev/null
+++ b/doc/src/images/webkit-guide/canvas_translatey.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/mask0.png b/doc/src/images/webkit-guide/mask0.png
new file mode 100644
index 0000000..f9764b5
--- /dev/null
+++ b/doc/src/images/webkit-guide/mask0.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/mask1.png b/doc/src/images/webkit-guide/mask1.png
new file mode 100644
index 0000000..5ca7798
--- /dev/null
+++ b/doc/src/images/webkit-guide/mask1.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_anim_accord.png b/doc/src/images/webkit-guide/scr_anim_accord.png
new file mode 100644
index 0000000..4295e15
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_anim_accord.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_anim_demo-rotate.png b/doc/src/images/webkit-guide/scr_anim_demo-rotate.png
new file mode 100644
index 0000000..d18bf16
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_anim_demo-rotate.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_anim_demo-scale.png b/doc/src/images/webkit-guide/scr_anim_demo-scale.png
new file mode 100644
index 0000000..8d32d1c
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_anim_demo-scale.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_anim_demo-skew.png b/doc/src/images/webkit-guide/scr_anim_demo-skew.png
new file mode 100644
index 0000000..15fc0fa
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_anim_demo-skew.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_anim_gallery.png b/doc/src/images/webkit-guide/scr_anim_gallery.png
new file mode 100644
index 0000000..aa32583
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_anim_gallery.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_anim_panel.png b/doc/src/images/webkit-guide/scr_anim_panel.png
new file mode 100644
index 0000000..ceff393
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_anim_panel.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_anim_pulse.png b/doc/src/images/webkit-guide/scr_anim_pulse.png
new file mode 100644
index 0000000..afa9ff8
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_anim_pulse.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_anim_skew.png b/doc/src/images/webkit-guide/scr_anim_skew.png
new file mode 100644
index 0000000..819a3a1
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_anim_skew.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_anim_slide1.png b/doc/src/images/webkit-guide/scr_anim_slide1.png
new file mode 100644
index 0000000..8fdf79f
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_anim_slide1.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_anim_tabbedSkew.png b/doc/src/images/webkit-guide/scr_anim_tabbedSkew.png
new file mode 100644
index 0000000..fd07fd7
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_anim_tabbedSkew.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_css3_backgrounds.png b/doc/src/images/webkit-guide/scr_css3_backgrounds.png
new file mode 100644
index 0000000..96fec39
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_css3_backgrounds.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_css3_border-img.png b/doc/src/images/webkit-guide/scr_css3_border-img.png
new file mode 100644
index 0000000..9242b4c
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_css3_border-img.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_css3_grad-radial.png b/doc/src/images/webkit-guide/scr_css3_grad-radial.png
new file mode 100644
index 0000000..e520f8a
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_css3_grad-radial.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_css3_gradientBack.png b/doc/src/images/webkit-guide/scr_css3_gradientBack.png
new file mode 100644
index 0000000..22f80af
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_css3_gradientBack.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_css3_gradientBackStop.png b/doc/src/images/webkit-guide/scr_css3_gradientBackStop.png
new file mode 100644
index 0000000..ff12a11
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_css3_gradientBackStop.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_css3_gradientButton.png b/doc/src/images/webkit-guide/scr_css3_gradientButton.png
new file mode 100644
index 0000000..b3ba62e
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_css3_gradientButton.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_css3_mask-grad.png b/doc/src/images/webkit-guide/scr_css3_mask-grad.png
new file mode 100644
index 0000000..bb539e6
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_css3_mask-grad.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_css3_mask-img.png b/doc/src/images/webkit-guide/scr_css3_mask-img.png
new file mode 100644
index 0000000..6215739
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_css3_mask-img.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_css3_multicol.png b/doc/src/images/webkit-guide/scr_css3_multicol.png
new file mode 100644
index 0000000..775d685
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_css3_multicol.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_css3_reflect.png b/doc/src/images/webkit-guide/scr_css3_reflect.png
new file mode 100644
index 0000000..94e58c3
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_css3_reflect.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_css3_scroll.png b/doc/src/images/webkit-guide/scr_css3_scroll.png
new file mode 100644
index 0000000..d11e05e
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_css3_scroll.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_css3_sel-nth.png b/doc/src/images/webkit-guide/scr_css3_sel-nth.png
new file mode 100644
index 0000000..fe8d26c
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_css3_sel-nth.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_css3_text-overflow.png b/doc/src/images/webkit-guide/scr_css3_text-overflow.png
new file mode 100644
index 0000000..084a52e
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_css3_text-overflow.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_css3_text-shadow.png b/doc/src/images/webkit-guide/scr_css3_text-shadow.png
new file mode 100644
index 0000000..e23e8fa
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_css3_text-shadow.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_css3_text-stroke.png b/doc/src/images/webkit-guide/scr_css3_text-stroke.png
new file mode 100644
index 0000000..5fb3f0d
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_css3_text-stroke.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_form_tapper.png b/doc/src/images/webkit-guide/scr_form_tapper.png
new file mode 100644
index 0000000..3a00060
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_form_tapper.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_form_toggler.png b/doc/src/images/webkit-guide/scr_form_toggler.png
new file mode 100644
index 0000000..c03d259
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_form_toggler.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_layout_link-fmt.png b/doc/src/images/webkit-guide/scr_layout_link-fmt.png
new file mode 100644
index 0000000..68e8d72
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_layout_link-fmt.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_layout_tbl-keyhole.png b/doc/src/images/webkit-guide/scr_layout_tbl-keyhole.png
new file mode 100644
index 0000000..d90fcd8
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_layout_tbl-keyhole.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_mob_condjs.png b/doc/src/images/webkit-guide/scr_mob_condjs.png
new file mode 100644
index 0000000..4793f80
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_mob_condjs.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_mob_layout.png b/doc/src/images/webkit-guide/scr_mob_layout.png
new file mode 100644
index 0000000..f3c40ed
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_mob_layout.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_mob_mediaquery.png b/doc/src/images/webkit-guide/scr_mob_mediaquery.png
new file mode 100644
index 0000000..c51aec7
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_mob_mediaquery.png
Binary files differ
diff --git a/doc/src/images/webkit-guide/scr_storage.png b/doc/src/images/webkit-guide/scr_storage.png
new file mode 100644
index 0000000..d71156f
--- /dev/null
+++ b/doc/src/images/webkit-guide/scr_storage.png
Binary files differ
diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index 079a03b..90caf06 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -29,33 +29,24 @@
\page index.html
\keyword Qt Reference Documentation
-\div {class="indexbox guide"}
- \div {class="heading"}
- Qt Developer Guide
- \enddiv
-\enddiv
\div {class="indexbox tools"}
\div {class="indexboxcont indexboxbar"}
\div {class="sectionlist normallist"}
- \div {class="heading"}
- What is Qt
- \enddiv
- \image qt-logo_large.png
- Qt is a cross-platform application and UI framework. Using Qt, you can
- write applications once and deploy them across desktop, mobile, and
- embedded operating systems without rewriting the source code.
- \enddiv
- \div {class="sectionlist normallist"}
+ \div {class="heading"}
+ What is Qt
+ \enddiv
\list
- \o \l{http://doc.qt.nokia.com/nokia-qtsdk-1.0/index.html}{Qt SDK}
- \o \l{http://developer.qt.nokia.com/wiki/QtCreatorWhitepaper}{Qt Creator}
- \o \l{http://doc.qt.nokia.com/qtsimulator-1.1/index.html}{Qt Simulator}
+ \o \l{Qt Whitepaper}{Qt C++ Framework}
+ \o \l{Intro to Qt Quick}{Qt Quick}
+ \o \l{external: Qt Mobility Manual}{Qt Mobility}
+ \o \l{Qt WebKit}
\endlist
+ \enddiv
+ \div {class="sectionlist normallist"}
\list
- \o \l{http://developer.qt.nokia.com/wiki/QtWhitepaper}{Qt C++ Framework}
- \o \l{Qt Quick}
- \o \l{http://doc.qt.nokia.com/qtmobility-1.1.0/index.html}{Qt Mobility}
- \o \l{Qt WebKit}
+ \o \l{external: Qt SDK Manual}{Qt SDK}
+ \o \l{Qt Creator Whitepaper}{Qt Creator}
+ \o \l{external: Qt Simulator Manual}{Qt Simulator}
\endlist
\list
\o \l{Supported Platforms}{Platform Support}
@@ -64,13 +55,12 @@
\enddiv
\div {class="sectionlist normallist"}
\div {class="heading"}
- See Qt
+ Qt in Action
\enddiv
- \image mobile.png
\list
\o \l{Qt Demonstrations}{Application Gallery}
- \o \l{Tutorials}
- \o \l{Qt Examples}{Examples}
+ \o \l{Tutorials}{Step-by-Step Tutorials}
+ \o \l{Qt Examples}{Qt Example Code}
\o \l{QML Examples and Demos}
\endlist
\enddiv
@@ -82,25 +72,39 @@
\div {class="heading"}
Develop with Qt
\enddiv
- \image tools.png
\list
+ \o \l{Getting Started Guides}{Getting Started with Qt}
\o \l{Develop with Qt}{Steps to Programming Qt Applications}
\o \l{qt-creator-configure-target}{Configure Qt and Creator for Platforms}
\o \l{qt-technologies}{Qt Features and Technologies}
\o \l{qt-utilities}{Utilities and Testing}
- \o \l{qt-deployment}{Deploying Applications and Publish to Ovi Store}
+ \o \l{qt-deployment}{Deploying and Publishing Applications to Ovi Store}
+ \endlist
+
+ \enddiv
+ \div {class="sectionlist normallist"}
+ \div {class="heading"}
+ UI Creation with Qt
+ \enddiv
+
+ \list
+ \o \l{qt-ui-creation}{Create UI with Qt}
+ \o \l{qt-rendering-painting-system}{Qt's Rendering and Painting Systems}
+ \o \l{Qt Quick} - develop fluid UIs with QML
+ \o \l{Widgets and Layouts} - elements for C++ interfaces
+ \o \l{external: Designer in Creator}{Designing UI in Creator}
\endlist
\enddiv
\div {class="sectionlist normallist"}
\div {class="heading"}
Featured Articles
\enddiv
- \image guide.png
\list
\o \l{Scalability}{How to Create Scalable Applications}
- \o \l{http://doc.qt.nokia.com/nokia-qtsdk-1.0/creator-developing-symbian.html}{Setting Up Development Environment for Symbian}
- \o \l{http://doc.qt.nokia.com/nokia-qtsdk-1.0/creator-developing-maemo.html}{Setting Up Development Environment for Maemo}
- \o \l{http://doc.qt.nokia.com/qtcreator-snapshot/creator-publish-ovi.html}{Publishing Qt Applications to Ovi Store}
+ \o \l{external: Setting Up Development Environment for Symbian}{Setting Up Development Environment for Symbian}
+ \o \l{external: Setting Up Development Environment for Maemo}{Setting Up Development Environment for Maemo}
+ \o \l{qt-mobile-demos}{Mobile Applications and Demos}
+ \o \l{QtWebKit Guide}{QtWebKit Developer Guide}
\endlist
\list
\o \l{Qt Development: The Steps from Challenge to Achievement}{The Steps from Challenge to Achievement}
@@ -108,18 +112,6 @@
innovative solutions using Qt.
\endlist
\enddiv
- \div {class="sectionlist normallist"}
- \div {class="heading"}
- UI Creation with Qt
- \enddiv
- \image qml.png
- \list
- \o \l{qt-ui-creation}{Create UI with Qt}
- \o \l{qt-rendering-painting-system}{Qt's Rendering and Painting Systems}
- \o \l{Qt Quick} - develop fluid UIs with QML
- \o \l{Widgets and Layouts} - elements for C++ interfaces
- \endlist
- \enddiv
\enddiv
\enddiv
\div {class="indexbox tools"}
@@ -137,17 +129,18 @@ innovative solutions using Qt.
\o \l{All Modules}{All Modules}
\o \l{All Namespaces}{All Namespaces}
\o \l{Global Qt Declarations}{Global Declarations}
-
\endlist
\enddiv
\div {class="sectionlist normallist"}
\list
- \o \l{Qt Quick}
\o \l{QML Elements}
\endlist
\list
- \o \l{http://doc.qt.nokia.com/qtmobility-1.1.0/index.html}{Qt Mobility APIs}
- \o \l{http://doc.qt.nokia.com/qtmobility-1.1.0/qml-plugins.html}{Mobility QML Plugins}
+ \o \l{external: Qt Mobility Manual}{Qt Mobility APIs}
+ \o \l{external: Qt Mobility QML Plugins}{Mobility QML Plugins}
+ \endlist
+ \list
+ \o \l{Qt Licenses and Credits}
\endlist
\enddiv
\div {class="sectionlist normallist"}
@@ -155,8 +148,8 @@ innovative solutions using Qt.
Qt Manuals
\enddiv
\list
- \o \l{http://doc.qt.nokia.com/qtcreator-2.0/index.html}{Qt Creator}
- \o \l{http://doc.qt.nokia.com/qtsimulator/index.html}{Qt Simulator}
+ \o \l{external: Qt Creator Manual}{Qt Creator}
+ \o \l{external: Qt Simulator Manual}{Qt Simulator}
\o \l{linguist-manual.html}{Qt Linguist}
\o \l{assistant-manual.html}{Qt Assistant}
\endlist
diff --git a/doc/src/mainpage.qdoc b/doc/src/mainpage.qdoc
index 269dc52..cafd927 100644
--- a/doc/src/mainpage.qdoc
+++ b/doc/src/mainpage.qdoc
@@ -30,14 +30,14 @@
\title Develop with Qt
\ingroup gettingstarted
-\div {class="indexboxcont indexboxbar"}
+\div {class = "indexboxcont indexboxbar"}
Developing a Qt application involves many different steps and stages. From
configuring Creator to distributing binaries to different platforms, Qt provides
many options along the way.
\image quick_screens.png
\enddiv
-\div {class="indexboxcont indexboxbar normallist"}
+\div {class = "indexboxcont indexboxbar normallist"}
\keyword qt-creator-configure-target
\section1 Configuring Qt and Creator Targets
Qt and Creator are configurable to compile applications on many platform targets
@@ -48,15 +48,15 @@ Creator is the integrated development environment for developing Qt applications
Creator encompasses every step of application development from interface design
to application testing and deployment.
\list
-\o \l{http://doc.qt.nokia.com/qtcreator-snapshot/creator-project-managing.html}{Creating Qt Projects}
-\o \l{http://doc.qt.nokia.com/qtcreator-snapshot/creator-building-running.html}{Building and Running Applications}
+\o \l{external: Creating Qt Projects in Creator}{Creating Qt Projects}
+\o \l{external: Building and Running Applications in Creator}{Building and Running Applications}
\list
- \o \l{http://doc.qt.nokia.com/qtcreator-snapshot/creator-running-targets.html}{Targets} - edit and set compiler targets
- \o \l{http://doc.qt.nokia.com/qtcreator-snapshot/creator-build-settings.html}{Build Settings} - edit and set build configurations
- \o \l{http://doc.qt.nokia.com/qtcreator-snapshot/creator-run-settings.html}{Run Settings} - edit and set application run settings
+ \o \l{external: Set Compiler Targets in Creator}{Targets} - edit and set compiler targets
+ \o \l{external: Build Settings in Creator}{Build Settings} - edit and set build configurations
+ \o \l{external: Run Settings in Creator}{Run Settings} - edit and set application run settings
\endlist
-\o \l{http://doc.qt.nokia.com/nokia-qtsdk-1.0/creator-developing-symbian.html}{Setting Up Development Environment for Symbian}
-\o \l{http://doc.qt.nokia.com/nokia-qtsdk-1.0/creator-developing-maemo.html}{Setting Up Development Environment for Maemo}
+\o \l{external: Setting Up Development Environment for Symbian}{Setting Up Development Environment for Symbian}
+\o \l{external: Setting Up Development Environment for Maemo}{Setting Up Development Environment for Maemo}
\endlist
\keyword qt-platform-support
@@ -77,7 +77,7 @@ and their installation pages, view the \l {Supported Platforms} and the
\l {Cross-Platform and Platform-Specific Development} pages.
\enddiv
-\div {class="indexboxcont indexboxbar normallist"}
+\div {class = "indexboxcont indexboxbar normallist"}
\keyword qt-technologies
\section1 Qt Technologies
@@ -109,11 +109,11 @@ applications using layouts and Qt Quick interfaces with QML.
\list
\o \l{Qt Quick} - create UIs using QML
\list
- \o \l{http://doc.qt.nokia.com/qtcreator-snapshot/creator-visual-editor.html}{Creator's QML Design Mode} - design Qt Quick interfaces using Creator's design mode
+ \o \l{external: Developing Qt Quick Applications}{Creator's QML Design Mode} - design Qt Quick interfaces using Creator's design mode
\endlist
\o \l{Widgets and Layouts} - primary elements for C++ based interfaces
\list
- \o \l{http://doc.qt.nokia.com/qtcreator-snapshot/creator-using-qt-designer.html}{Creator's Designer} - design interfaces using Qt Designer.
+ \o \l{external: Designer in Creator}{Creator's Designer} - design interfaces using Qt Designer
\endlist
\o \l{UI Design with Qt} - covers many Qt features for UI creation
\endlist
@@ -141,13 +141,13 @@ Qt has various support for different rendering and painting methods.
\o \l{QtOpenGL Module} - module for rendering with the OpenGL API
\o \l{OpenVG Rendering in Qt}{QtOpenVG Module} - provides support for OpenVG painting
\endlist
-\o \l{Printing with Qt} - A guide to producing printed output with Qt's paint system and widgets.
+\o \l{Printing with Qt} - A guide to producing printed output with Qt's paint system and widgets
\endlist
\keyword qt-webkit
\section2 QtWebKit Module
Web applications are increasing in importance and abundance and Qt has
-\l{http://www.webkit.org/}{WebKit} support.
+\l{WebKit Open Source Project}{WebKit} support.
\list
\o \l{WebKit in Qt} - WebKit Module
\endlist
@@ -159,25 +159,25 @@ Qt supports many utilities that work on multiple platforms.
\o \l{Container Classes}{Containers} - Qt's implementation of various data structures such as linked lists and hash maps
\o \l{Rich Text Processing} - for manipulating structured rich text documents
\o \l{XML Processing} - high level manipulation of XML data using different interfaces
-\o \l{Making Applications Scriptable} - provides Qt applications with ECMAScript processor.
-\o \l{Qt Linguist Manual}{Qt Linguist} - for translating applications into local languages.
+\o \l{Making Applications Scriptable} - provides Qt applications with ECMAScript processor
+\o \l{Qt Linguist Manual}{Qt Linguist} - for translating applications into local languages
\endlist
-For more information, visit the \l{Qt's Tools}{Qt Tools} page.
+For more information, visit the \l{Qt's Tools}{Qt Tools} page.
\enddiv
-\div {class="indexboxcont indexboxbar normallist"}
+\div {class = "indexboxcont indexboxbar normallist"}
\keyword qt-testing
\section1 Testing Qt Applications
Testing and debugging are part of the development process and Qt offers the
developer multiple methods of testing their code.
\list
-\o \l{http://doc.qt.nokia.com/qtcreator-snapshot/creator-debugging.html} {Debugging Applications in Creator} - various debugging options in Creator
-\o \l {http://doc.qt.nokia.com/qtsimulator/index.html}{Simulator} - testing mobile applications by simulating a mobile environment
-\o \l {QML Viewer} - an executable that is able to run QML files
+\o \l{external: Debugging Applications in Creator}{Debugging Applications in Creator} - various debugging options in Creator
+\o \l{external: Qt Simulator Manual}{Simulator} - testing mobile applications by simulating a mobile environment
+\o \l{QML Viewer} - an executable that is able to run QML files
\o \l{QTestLib Manual}{QTestLib} - a unit testing framework built into Qt
\endlist
\enddiv
-\div {class="indexboxcont indexboxbar normallist"}
+\div {class = "indexboxcont indexboxbar normallist"}
\keyword qt-deployment
\section1 Deployment
Symbian phones, Maemo devices, desktop environments, embedded Linux devices -- Qt applications are deployable to many environments.
@@ -194,20 +194,20 @@ considerations that each platform introduce.
\o \l{Deploying Qt for Embedded Linux Applications}{Embedded Linux} - deploying Qt applications on embedded Linux
\o \l{Deploying an Application on the Symbian Platform}{Symbian} - deploying Qt applications on the Symbian platform
\endlist
-\o \l{http://doc.qt.nokia.com/qtcreator-snapshot/creator-deployment-symbian.html}{Symbian Deployment in Creator} - Symbian application deployment built into Creator
-\o \l{http://doc.qt.nokia.com/qtcreator-snapshot/creator-deployment-maemo.html}{ Deploying Qt Applications on Maemo Devices}
+\o \l{external: Symbian Deployment in Creator}{Symbian Deployment in Creator} - Symbian application deployment built into Creator
+\o \l{external: Maemo Deployment in Creator}{Deploying Qt Applications on Maemo Devices}
\endlist
\section1 Ovi Store Publishing
Creator can publish applications to Ovi Store directly.
\list
-\o \l{http://doc.qt.nokia.com/qtcreator-snapshot/creator-publish-ovi.html}{Publishing Qt Applications to Ovi Store}
+\o \l{external: Publishing Applications to Ovi Store}{Publishing Qt Applications to Ovi Store}
\endlist
For additional information, visit the \l{Cross-Platform and Platform-Specific Development}
and the \l {Supported Platforms} page.
\enddiv
-\div {class="indexboxcont indexboxbar normallist"}
+\div {class = "indexboxcont indexboxbar normallist"}
\section1 Where to Go from Here
Qt Demos and Examples
diff --git a/doc/src/qt-webpages.qdoc b/doc/src/qt-webpages.qdoc
index e915267..d0a5416 100644
--- a/doc/src/qt-webpages.qdoc
+++ b/doc/src/qt-webpages.qdoc
@@ -24,242 +24,279 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
/*!
\externalpage http://qt.nokia.com/
\title Qt website
*/
-
/*!
\externalpage http://qt.nokia.com/
\title Qt Homepage
*/
-
/*!
\externalpage http://bugreports.qt.nokia.com
\title Qt Bug Tracker
*/
-
/*!
\externalpage http://bugreports.qt.nokia.com
\title Bug Report Form
*/
-
/*!
\externalpage http://qt.nokia.com/services-partners/partners/partner-directory
\title Partner Directory
*/
-
/*!
\externalpage http://qt.nokia.com/products/add-on-products
\title Qt Solutions
*/
-
/*!
\externalpage http://qt.nokia.com/developer/books
\title Books about Qt Programming
*/
-
/*!
\externalpage http://qt.nokia.com/developer/books/3
\title GUI Programming with Qt 3
*/
-
/*!
\externalpage http://qt.nokia.com/about
\title About Qt
*/
-
/*!
\externalpage http://qt.nokia.com/products/developer-tools
\title Visual Studio Integration
*/
-
/*!
\externalpage http://qt.nokia.com/products/add-on-products/catalog/4/Widgets/qtcalendarwidget/
\title Calendar Widget
*/
-
/*!
\externalpage http://qt.nokia.com/products/add-on-products/catalog/4/Widgets/qtwizard/
\title QtWizard
*/
-
/*!
\externalpage http://qt.nokia.com/products/add-on-products/catalog/4/Utilities/qtcorba/
\title CORBA Framework
*/
-
/*!
\externalpage http://qt.nokia.com/products/add-on-products/catalog/4/Widgets/qtwindowlistmenu/
\title Window Menu
*/
-
/*!
\externalpage http://qt.nokia.com/qt-in-use
\title Customer Success Stories
*/
-
/*!
\externalpage http://qt.nokia.com/developer
\title Developer Zone
*/
-
/*!
\externalpage http://qt.nokia.com/downloads
\title Downloads
*/
-
/*!
\externalpage http://qt.nokia.com/developer/faqs/
\title FAQs
*/
-
/*!
\externalpage http://qt.nokia.com/developer/faqs/licensing/
\title License FAQ
*/
-
/*!
\externalpage http://qt.nokia.com/products/licensing/
\title Free Software and Contributions
*/
-
/*!
\externalpage http://qt.nokia.com/products/licensing/
\title Qt Licensing Overview
*/
-
/*!
\externalpage http://qt.nokia.com/products/pricing/
\title Qt License Pricing
*/
-
/*!
\externalpage http://qt.nokia.com/about/contact-us
\title How to Order
*/
-
/*!
\externalpage http://doc.qt.nokia.com/supported-platforms.html
\title Platform Support Policy
*/
-
/*!
\externalpage http://qt.nokia.com/products/
\title Product Overview
*/
-
/*!
\externalpage http://doc.qt.nokia.com/supported-platforms.html
\title Qt 4 Platforms Overview
*/
-
/*!
\externalpage http://www.qtextended.org/
\title Qt Extended
*/
-
/*!
\externalpage http://doc.qt.nokia.com/qq/
\title Qt Quarterly
*/
-
/*!
\externalpage http://bugreports.qt.nokia.com
\title Task Tracker
*/
-
/*!
\externalpage http://lists.trolltech.com
\title Qt Mailing Lists
*/
-
/*!
\externalpage http://qt.nokia.com/products/files/pdf/
\title Whitepapers
*/
-
/*!
\externalpage http://doc.qt.nokia.com/qtcanvas
\title QtCanvas
*/
-
/*!
\externalpage http://labs.qt.nokia.com/page/Projects/Itemview/Modeltest
\title ModelTest
*/
-
/*!
\externalpage http://labs.qt.nokia.com/page/Projects/Accessibility/QDBusBridge
\title D-Bus Accessibility Bridge
*/
-
/*!
\externalpage http://labs.qt.nokia.com/blogs/2008/12/05/qtestlib-now-with-nice-graphs-pointing-upwards/
\title qtestlib-tools Announcement
*/
-
/*!
\externalpage http://qt.nokia.com/products/library/modular-class-library#info_scripting
\title Qt Script for Applications (QSA)
*/
-
/*!
\externalpage http://qt.nokia.com/products/add-on-products/catalog/4/Utilities/qtsharedmemory/
\title QtSharedMemory
*/
-
/*!
\externalpage http://qt.nokia.com/qq/qq21-portingcanvas.html
\title Porting to Qt 4.2's Graphics View
*/
-
/*!
\externalpage http://qt.nokia.com/products/add-on-products/catalog/4/Windows/qtwinforms/
\title QtWinForms Solution
*/
-
/*!
\externalpage http://qt.nokia.com/developer/faqs/qt/installation
\title Installation FAQ
*/
-
/*!
\externalpage http://qt.gitorious.org
\title Public Qt Repository
*/
-
/*!
\externalpage http://get.qt.nokia.com/nokiasmartinstaller/
\title Smart Installer
*/
-
/*!
\externalpage http://qt.gitorious.org/qt-labs/qtestlib-tools
\title qtestlib-tools
*/
-
/*!
\externalpage http://labs.qt.nokia.com
\title Qt Labs
*/
/*!
- \externalpage http://doc.qt.nokia.com/qtcreator-snapshot/index.html
- \title Qt Creator Manual
+ \externalpage http://doc.qt.nokia.com/qtcreator/creator-qml-application.html
+ \title external: Developing Qt Quick Applications with Creator
*/
-
-/*!
- \externalpage http://doc.qt.nokia.com/qtcreator-snapshot/creator-qml-application.html
- \title Developing Qt Quick Applications with Creator
-*/
-
/*!
\externalpage http://qt.gitorious.org/qt/pages/QtCodingStyle
\title Qt Coding Style
*/
-
+/*!
+ \externalpage http://developer.qt.nokia.com/wiki/QtCreatorWhitepaper
+ \title Qt Creator Whitepaper
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/wiki/QtWhitepaper
+ \title Qt Whitepaper
+*/
+/*!
+ \externalpage http://doc.qt.nokia.com/qtcreator/creator-visual-editor.html
+ \title external: Developing Qt Quick Applications
+*/
+/*!
+ \externalpage http://doc.qt.nokia.com/qtcreator/creator-publish-ovi.html
+ \title external: Publishing Applications to Ovi Store
+*/
+/*!
+ \externalpage http://doc.qt.nokia.com/qtcreator/index.html
+ \title external: Qt Creator Manual
+*/
+/*!
+ \externalpage http://doc.qt.nokia.com/qtcreator/creator-developing-symbian.html
+ \title external: Setting Up Development Environment for Symbian
+*/
+/*!
+ \externalpage http://doc.qt.nokia.com/qtcreator/creator-developing-maemo.html
+ \title external: Setting Up Development Environment for Maemo
+*/
+/*!
+ \externalpage http://doc.qt.nokia.com/qtmobility/index.html
+ \title external: Qt Mobility Manual
+*/
+/*!
+ \externalpage http://doc.qt.nokia.com/qtmobility/qml-plugins.html
+ \title external: Qt Mobility QML Plugins
+*/
+/*!
+ \externalpage http://doc.qt.nokia.com/qtsimulator/index.html
+ \title external: Qt Simulator Manual
+*/
+/*!
+ \externalpage http://doc.qt.nokia.com/nokia-qtsdk-latest/index.html
+ \title external: Qt SDK Manual
+*/
+/*!
+ \externalpage http://doc.qt.nokia.com/qtcreator/creator-project-managing.html
+ \title external: Creating Qt Projects in Creator
+*/
+/*!
+ \externalpage http://doc.qt.nokia.com/qtcreator/creator-building-running.html
+ \title external: Building and Running Applications in Creator
+*/
+/*!
+ \externalpage http://doc.qt.nokia.com/qtcreator/creator-running-targets.html
+ \title external: Set Compiler Targets in Creator
+*/
+/*!
+ \externalpage http://doc.qt.nokia.com/qtcreator/creator-build-settings.html
+ \title external: Build Settings in Creator
+*/
+/*!
+ \externalpage http://doc.qt.nokia.com/qtcreator/creator-run-settings.html
+ \title external: Run Settings in Creator
+*/
+/*!
+ \externalpage http://doc.qt.nokia.com/qtcreator/creator-using-qt-designer.html
+ \title external: Designer in Creator
+*/
+/*!
+ \externalpage http://doc.qt.nokia.com/qtcreator/creator-debugging.html
+ \title external: Debugging Applications in Creator
+*/
+/*!
+ \externalpage http://doc.qt.nokia.com/qtcreator/creator-deployment-symbian.html
+ \title external: Symbian Deployment in Creator
+*/
+/*!
+ \externalpage http://doc.qt.nokia.com/qtcreator/creator-deployment-maemo.html
+ \title external: Maemo Deployment in Creator
+*/
+/*!
+ \externalpage http://doc.qt.nokia.com/qtmobility/multimedia.html
+ \title external: Mobility Multimedia
+*/
+/*!
+ \externalpage http://doc.qt.nokia.com/qtmobility/location-overview.html
+ \title external: Mobility Location
+*/
/*!
\externalpage http://qt.nokia.com/developer/learning/online/training/training-day-at-developer-days-2009/
\title Training Day at Qt Developer Days 2009
diff --git a/doc/src/snippets/accessibilityfactorysnippet.cpp b/doc/src/snippets/accessibilityfactorysnippet.cpp
index a378db7..6dc6b2a 100644
--- a/doc/src/snippets/accessibilityfactorysnippet.cpp
+++ b/doc/src/snippets/accessibilityfactorysnippet.cpp
@@ -45,9 +45,8 @@ QAccessibleInterface *sliderFactory(const QString &classname, QObject *object)
{
QAccessibleInterface *interface = 0;
- if (classname == "QSlider" && object && object->isWidgetType())
- interface = new SliderInterface(classname,
- static_cast<QWidget *>(object));
+ if (classname == QLatin1String("QSlider") && object && object->isWidgetType())
+ interface = new QAccessibleSlider(static_cast<QWidget *>(object));
return interface;
}
diff --git a/doc/src/snippets/accessibilitypluginsnippet.cpp b/doc/src/snippets/accessibilitypluginsnippet.cpp
index a7e25f0..5c28468 100644
--- a/doc/src/snippets/accessibilitypluginsnippet.cpp
+++ b/doc/src/snippets/accessibilitypluginsnippet.cpp
@@ -52,7 +52,7 @@ public:
//! [0]
QStringList SliderPlugin::keys() const
{
- return QStringList() << "QSlider";
+ return QStringList() << QLatin1String("QSlider");
}
//! [0]
@@ -61,8 +61,8 @@ QAccessibleInterface *SliderPlugin::create(const QString &classname, QObject *ob
{
QAccessibleInterface *interface = 0;
- if (classname == "QSlider" && object && object->isWidgetType())
- interface = new AccessibleSlider(classname, static_cast<QWidget *>(object));
+ if (classname == QLatin1String("QSlider") && object && object->isWidgetType())
+ interface = new QAccessibleSlider(static_cast<QWidget *>(object));
return interface;
}
diff --git a/doc/src/snippets/code/doc_src_installation.qdoc b/doc/src/snippets/code/doc_src_installation.qdoc
index 1a87566..5aaa2b0 100644
--- a/doc/src/snippets/code/doc_src_installation.qdoc
+++ b/doc/src/snippets/code/doc_src_installation.qdoc
@@ -250,12 +250,12 @@ export PATH
//! [38]
cd /home/user/qt/%VERSION%
-./configure -platform linux-g++ -xplatform symbian/linux-armcc
+./configure -platform linux-g++ -xplatform symbian-armcc
//! [38]
//! [39]
cd /home/user/qt/%VERSION%
-./configure -platform linux-g++ -xplatform symbian/linux-gcce -no-webkit
+./configure -platform linux-g++ -xplatform symbian-gcce -no-webkit
//! [39]
//! [40]
diff --git a/doc/src/snippets/declarative/arrow.png b/doc/src/snippets/declarative/arrow.png
new file mode 100644
index 0000000..f0cae21
--- /dev/null
+++ b/doc/src/snippets/declarative/arrow.png
Binary files differ
diff --git a/doc/src/snippets/declarative/componentCreation.js b/doc/src/snippets/declarative/componentCreation.js
index cf59777..7364139 100644
--- a/doc/src/snippets/declarative/componentCreation.js
+++ b/doc/src/snippets/declarative/componentCreation.js
@@ -32,13 +32,10 @@ function createSpriteObjects() {
//![finishCreation]
function finishCreation() {
if (component.status == Component.Ready) {
- sprite = component.createObject(appWindow);
+ sprite = component.createObject(appWindow, {"x": 100, "y": 100});
if (sprite == null) {
// Error Handling
- } else {
- sprite.x = 100;
- sprite.y = 100;
- // ...
+ console.log("Error creating object");
}
} else if (component.status == Component.Error) {
// Error Handling
diff --git a/doc/src/snippets/declarative/layoutmirroring.qml b/doc/src/snippets/declarative/layoutmirroring.qml
new file mode 100644
index 0000000..617f39d
--- /dev/null
+++ b/doc/src/snippets/declarative/layoutmirroring.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.1
+
+Rectangle {
+ LayoutMirroring.enabled: true
+ LayoutMirroring.childrenInherit: true
+
+ width: 300; height: 50
+ color: "yellow"
+ border.width: 1
+
+ Row {
+ anchors { left: parent.left; margins: 5 }
+ y: 5; spacing: 5
+
+ Repeater {
+ model: 5
+
+ Rectangle {
+ color: "red"
+ opacity: (5 - index) / 5
+ width: 40; height: 40
+
+ Text {
+ text: index + 1
+ anchors.centerIn: parent
+ }
+ }
+ }
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/righttoleft.qml b/doc/src/snippets/declarative/righttoleft.qml
new file mode 100644
index 0000000..c2e504a
--- /dev/null
+++ b/doc/src/snippets/declarative/righttoleft.qml
@@ -0,0 +1,149 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.1
+import "righttoleft"
+
+Column {
+ width: 200
+//![0]
+// automatically aligned to the left
+Text {
+ text: "Phone"
+ width: 200
+}
+
+// automatically aligned to the right
+Text {
+ text: "خامل"
+ width: 200
+}
+
+// aligned to the left
+Text {
+ text: "خامل"
+ horizontalAlignment: Text.AlignLeft
+ width: 200
+}
+
+// aligned to the right
+Text {
+ text: "خامل"
+ horizontalAlignment: Text.AlignLeft
+ LayoutMirroring.enabled: true
+ width: 200
+}
+//![0]
+
+//![1]
+// by default child items are positioned from left to right
+Row {
+ Child {}
+ Child {}
+}
+
+// position child items from right to left
+Row {
+ layoutDirection: Qt.RightToLeft
+ Child {}
+ Child {}
+}
+
+// position child items from left to right
+Row {
+ LayoutMirroring.enabled: true
+ layoutDirection: Qt.RightToLeft
+ Child {}
+ Child {}
+}
+//![1]
+
+//![2]
+Item {
+ height: 50; width: 150
+
+ LayoutMirroring.enabled: true
+ anchors.left: parent.left // anchor left becomes right
+
+ Row {
+ // items flow from left to right (as per default)
+ Child {}
+ Child {}
+ Child {}
+ }
+}
+//![2]
+
+//![3]
+Item {
+ height: 50; width: 150
+
+ LayoutMirroring.enabled: true
+ LayoutMirroring.childrenInherit: true
+ anchors.left: parent.left // anchor left becomes right
+
+ Row {
+ // setting childrenInherit in the parent causes these
+ // items to flow from right to left instead
+ Child {}
+ Child {}
+ Child {}
+ }
+}
+//![3]
+
+//![4]
+Rectangle {
+ color: "black"
+ height: 50; width: 50
+ x: mirror(10)
+ function mirror(value) {
+ return LayoutMirroring.enabled ? (parent.width - width - value) : value;
+ }
+}
+//![4]
+
+//![5]
+Image {
+ source: "arrow.png"
+ mirror: true
+}
+//![5]
+}
diff --git a/doc/src/snippets/declarative/righttoleft/Child.qml b/doc/src/snippets/declarative/righttoleft/Child.qml
new file mode 100644
index 0000000..48cb295
--- /dev/null
+++ b/doc/src/snippets/declarative/righttoleft/Child.qml
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 50; height: 50
+ color: "black"
+ Text {
+ color: "white"
+ text: String.fromCharCode(65 + Math.floor(26*Math.random()))
+ anchors.centerIn: parent
+ }
+}
diff --git a/doc/src/snippets/declarative/states/statechangescript.qml b/doc/src/snippets/declarative/states/statechangescript.qml
index b885137..f490a97 100644
--- a/doc/src/snippets/declarative/states/statechangescript.qml
+++ b/doc/src/snippets/declarative/states/statechangescript.qml
@@ -37,6 +37,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+import QtQuick 1.0
Item {
//! [state and transition]
diff --git a/doc/src/webkit/guide/chapter_cache.qdoc b/doc/src/webkit/guide/chapter_cache.qdoc
new file mode 100644
index 0000000..fcfd208
--- /dev/null
+++ b/doc/src/webkit/guide/chapter_cache.qdoc
@@ -0,0 +1,511 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+
+\page qtwebkit-guide-cache.html
+\title QtWebKit Guide - Client Storage
+\chapter Client Storage
+
+This section of the \l{QtWebKit Guide} serves as an introduction to the
+\l{HTML5 Web Storage} features of QtWebKit.
+
+Traditional mobile web development centered around the limitations of client
+handsets, which had very little storage for applications. As handsets become
+more powerful, however, this assumption is no longer valid. HTML5's newly
+introduced \l{HTML5 Web Storage}{Web Storage} features expand application
+storage on the client.
+
+HTML 5 standardizes access to an application's local data via \c{LocalStorage}
+and \c{SessionStorage} APIs. These APIs boost the amount of client storage
+available to web applications. They also can effectively replace cookies as a
+means to maintain application state and track user preferences.
+
+Local storage persists indefinitely, while session storage lasts only for the
+duration of a window session. Local storage is available from any page or window
+from the same site, while session storage is local to each window. Both local
+and session storage rely on simple key/value pairs, with keys and values both
+stored as strings.
+
+Local and session storage are not the only client storage available. HTML 5
+WebSQL serves as a more full-featured, client-side database. WebSQL brings
+SQLite-based structured database functionality, typically deployed on servers,
+to client browser applications. WebSQL is appropriate for data-intensive
+applications requiring complex queries rather than simple key/value access.
+WebSQL database transaction calls help avoid interfaces from locking up,
+facilitate rollback and error handling, and protect against SQL injection.
+Database versioning allows you to manage schema changes incrementally.
+
+
+\section1 Simple Data Storage
+
+The \c{localStorage} and \c{sessionStorage} APIs offer applications up to 5MB of
+data storage. They both share the same simple key/value interface, but have
+different namespaces and also differ in the extent to which data is available.
+Local storage persists indefinitely, while session storage only lasts for the
+duration of a window session. Local storage is available from any page or window
+from the same site, while session storage is local to each window.
+
+The following examples demonstrate the API interface. While these use
+\c{localStorage} as an example, the same set of API calls work for
+\c{sessionStorage}, which is also available within the \c{window} object.
+
+The following performs an initial check for support of browser-based
+storage and assigns the database to a variable:
+
+\code
+if (window.localStorage) {
+ var db = window.localStorage;
+ // storage functionality here
+}
+else {
+ // store data remotely?
+}
+\endcode
+
+The \c{getItem()} method retrieves the value of a database field named
+\c{key}:
+
+\code
+var value = db.getItem("key");
+\endcode
+
+Note that both keys and values are represented as strings. If you specify any
+other type of data, it is converted silently to a string representation. (See
+\l{Storing Non-String Data} for ways around this limitation.) If \c{getItem()}
+returns \c{null} rather than a string value, it means the specified key does not
+exist.
+
+The \c{setItem()} method establishes a new value. When adding data, it is a good
+idea to check to make sure you haven't exceeded the allotted storage space:
+
+\code
+try {
+ db.setItem("key", "string");
+}
+catch(err) {
+ if (err.QUOTA_EXCEEDED_ERR) {
+ // storage space is exceeded
+ }
+}
+\endcode
+
+The \c{removeItem()} method deletes database fields:
+
+\code
+db.removeItem("key");
+\endcode
+
+The \c{clear()} method deletes all key/value pairs within the database, either
+for an entire site in the case of \c{localStorage}, or for an individual window
+session in the case of \c{sessionStorage}:
+
+\code
+db.clear();
+\endcode
+
+Databases can be accessed as arrays using index notation, useful in cases where
+you may not know all the field names. The \c{length} property returns the number
+of fields in the database, and the \c{key()} method returns the name of the key
+corresponding to a given index. The following reflects the contents of a
+database in a JavaScript object:
+
+\code
+var obj = {};
+for ( var i = 0, l = db.length ; i < l ; i++ ) {
+ obj[ db.key(i) ] = db.getItem( db.key(i) );
+}
+\endcode
+
+Since keys correspond to array indexes, you should not add or remove keys during
+any operation that iterates over the full set of key/value pairs. Newly
+introduced keys are introduced randomly into the array's sequence.
+
+The following displays simple storage functionality. The application prompts for
+a login and password if they are unavailable. This locally stored data is
+available the next time users open the browser. However, the contents of the
+credit card field is stored only for the duration of the browing session.
+
+\l{ex_storage}{\inlineimage webkit-guide/scr_storage.png
+}
+
+\l{storage_css}{(CSS)}
+\l{storage_js}{(JavaScript)}
+
+
+ \section2 Storing Non-String Data
+
+ Since local and session storage APIs only support string values, you need to
+ be careful not to allow errors that result from passive conversions from
+ other data types. The following sample shows how such an error might come
+ about:
+
+ \code
+ var db = window.localStorage;
+ var saveCardInfo;
+ // user expresses preference NOT to save credit card info:
+ saveCardInfo = false;
+ // BUG happens here...
+ db.setItem("save_card_info", saveCardInfo);
+ // variable is now a string, not a boolean:
+ saveCardInfo = db.getItem("save_card_info");
+ // both "true" and "false" strings evaluate as true...
+ if ( saveCardInfo ) {
+ // ...so this code always executes...
+ }
+ else {
+ // ...and this code never executes.
+ }
+ \endcode
+
+ The user's preference to retain credit card information is expressed within
+ the application as a \c{true} or \c{false} boolean value. When each value is
+ passed to storage, however, it is passively converted to a string. When
+ reassigned to a JavaScript variable, it no longer serves as a valid boolean
+ test. The application falsely assumes users want to save credit card
+ information, regardless of their expressed preference.
+
+ The following sample fixes the problem. Instead of using \c{true} and
+ \c{false} boolean values, it converts \c{1} and \c{0} strings to numbers:
+
+ \code
+ var db = window.localStorage;
+ var saveCardInfo = 0;
+ db.setItem("save_card_info", saveCardInfo);
+ // multiplying forces numeric output:
+ saveCardInfo = db.getItem("save_card_info") * 1;
+ \endcode
+
+ For a more reliable alternative, store values as JSON strings and rely on
+ automatic type conversion when subsequently parsing them. The following
+ sample shows how parsing JSON preserves both boolean and numeric data:
+
+ \code
+ var saveCardInfo = true; // boolean
+ var shipMethod = 2; // number
+ var db = window.localStorage;
+
+ db.setItem("save_card_info", JSON.stringify(saveCardInfo));
+ db.setItem("ship_method", JSON.stringify(shipMethod));
+
+ saveCardInfo = JSON.parse(db.getItem("save_card_info")); // boolean
+ shipMethod = JSON.parse(db.getItem("ship_method")); // number
+ \endcode
+
+ Note that this simple approach may cause problems of its own. For example,
+ perhaps the words \c{true} and \c{false} really should be represented
+ as strings. Encapsulating data within objects accounts for such variability:
+
+ \code
+ var db = window.localStorage;
+ var obj = {
+ bool : true,
+ str : "true",
+ num : 1
+ };
+ db.setItem("appState", JSON.stringify(obj)); // to database...
+ // "appState" is "{'bool':true,'num':1,'str':'true'}"
+ obj = JSON.parse(db.getItem("appState")); // ...and back
+ // obj is same as initially defined.
+ \endcode
+
+ The ability to save objects as JSON strings means that you can save an
+ application's state within a single database field. For example, you might
+ use the following approach to save the entire contents of a shopping cart in
+ a single field for later use:
+
+ \code
+ var db = window.localStorage;
+ var cart = { items: [] };
+
+ cart.message = "From your loving uncle";
+
+ cart.items.push({
+ description : "Floor to Ceiling Shoe Rack",
+ id : 203174676,
+ price : 99.95,
+ quantity : 1,
+ weight : 20,
+ });
+
+ cart.items.push({
+ description : "Automatic Laser Toy for Cats",
+ id : 203345371,
+ price : 19.95,
+ quantity : 2,
+ weight : 0.5,
+ });
+
+ // save all cumulative items:
+ db.setItem("cart", JSON.stringify(cart));
+
+ // extract items from storage:
+ cart = JSON.parse(db.getItem("cart"));
+ \endcode
+
+ JSON allows you to store data types, but functions are ignored. That makes
+ it more difficult to preserve objects representing fully functional
+ applications.
+
+ \section2 Storage Events
+
+ The \c{storage} event allows applications to respond indirectly to modified
+ data resulting from calls to \c{setItem()}, \c{removeItem()}, or
+ \c{clear()}. This may be useful in providing users with visual feedback
+ notifying them of data that is modified locally, perhaps rather than being
+ sent to a remote server:
+
+ \code
+ window.addEventListener("storage", function(event){
+ var icon = document.querySelector("#indicator");
+ if (event.storageArea.length) {
+ icon.className = "writing";
+ }
+ else {
+ icon.className = "empty";
+ }
+ }, false);
+ \endcode
+
+ The \c{storage} event's \c{storageArea} attribute returns the
+ \c{localStorage} or \c{sessionStorage} object being modified. The \c{key} is
+ the name of the field being modified, and \c{oldValue} and \c{newValue} are
+ its values before and after the event. The \c{url} is the page that called
+ the method triggering the change.
+
+
+\section1 WebSQL Databases
+
+While common local- or session-based databases are capable of storing complex
+data structures, QtWebKit-based browsers can also rely upon the WebSQL standard,
+which brings SQLite-based structured database functionality, typically deployed
+on servers, to client browser applications. Based on SQLite version 3.6.19,
+WebSQL is appropriate for data-intensive applications requring complex queries
+rather than simple key/value access.
+
+The following test confirms support for WebSQL:
+
+\code
+if (!!window.openDatabase) {
+ // supports WebSQL
+}
+\endcode
+
+Calls to databases made via the WebSQL API are made asynchronously via
+transactions to avoid the user interface from locking up, as database
+interaction may occur from several windows at a time.
+
+The three core API methods are:
+
+\list
+\o \c{openDatabase()}
+\o \c{transaction()}
+\o \c{executeSql()}
+\endlist
+
+ \section2 Creating and Opening a New Database
+
+ To create and open a database, use \c{openDatabase()}on the Window object,
+ for example:
+
+ \code
+ var db = openDatabase('mydb', '1.0', 'my first database', 2*1024*1024);
+ var db = openDatabase('notes', '', 'The Example Notes App!', 1048576);
+ \endcode
+
+ The four required arguments are the database name, version, display name,
+ and estimated size in bytes. You can supply a function as an optional fifth
+ argument to serve as a callback when a database is created. It may be used
+ to call the \c{changeversion()} method, in which case the callback is
+ invoked with an empty string for the database version.
+
+ The second example above specifies an empty string for the version. In this
+ case, the database opens no matter what the database version is. (An
+ \c{openDatabase()} call specifying the wrong version for an existing
+ database throws an \c{INVALID_STATE_ERR} exception.) You can then query the
+ version by examining the database object's version property, for example:
+
+ \code
+ var version = db.version;
+ \endcode
+
+ Note that you don't need to close a client-side Web SQL database when
+ you're done working with it.
+
+ \section2 Transaction Calls and ExecuteSQL Method
+
+ Performing database transactions is superior to running SQL statements
+ directly because transactions are not committed if they fail and you can
+ undo them if needed. Transactions also allow you to handle errors using a
+ callback. To implement a transaction, specify a callback function such as
+ the following:
+
+ \code
+ db.transaction(function (tx) {
+ // SQL details on the tx object go here
+ }
+ \endcode
+
+ The \c{transaction()} method takes one to three arguments:
+
+ \list
+ \o a required transaction callback, in which \c{executeSQL()} calls
+ belong
+ \o an optional transaction error object
+ \o an optional success callback.
+ \endlist
+
+ Use the \c{executeSQL()} method to specify SQL statements for read and write
+ operations. The method protects against SQL injection and provides a
+ callback method to process the results of any SQL queries you specify. The
+ \c{executeSQL()} method takes from one to four arguments:
+
+ \list
+ \o a required SQL statement
+ \o an optional object array of arguments
+ \o an optional SQL statement callback
+ \o an optional SQL statement error callback
+ \endlist
+
+ The example below creates the database if it doesn't exist, adds a
+ two-column table to the database, and adds a row of data to the table:
+
+ \code
+ var db = openDatabase('mydb', '1.0', 'my first database', 2 * 1024 * 1024);
+ db.transaction(function (tx) {
+ tx.executeSql('CREATE TABLE IF NOT EXISTS foo (id unique, text)');
+ tx.executeSql('INSERT INTO foo (id, text) VALUES (1, "synergies")');
+ });
+ \endcode
+
+ To capture data from the user or an external source, use \c{?} placeholders
+ to map that data into the SQL query. This ensures the data doesn't
+ compromise database security, for example from SQL injection:
+
+ \code
+ tx.executeSql('INSERT INTO foo (id, text) VALUES (?, ?)', [id, value]);
+ \endcode
+
+ \c{id} and \c{value} are external variables, and \c{executeSql} maps
+ the items in the array to the \c{?}s.
+
+ To select values from the table, use a callback to capture the results:
+
+ \code
+ tx.executeSql('SELECT * FROM foo', [], function(tx, results) {
+ for (var i = 0 , len = results.rows.length; i < len; i++) {
+ // do something with results.rows.item(i).text
+ }
+ });
+ \endcode
+
+ No fields are mapped in the above query, but to use the third argument you
+ need to pass in an empty array as the second argument.
+
+ The SQL statement callback for \c{executeSQL()} is called with the
+ \c{transaction} object and a SQL statement \c{result} object. The \c{result}
+ gives access to the ID of the last inserted row, the number of rows
+ affected, and an indexed list representing the rows returned, in the order
+ returned.
+
+ The \c{result} object contains an array-like \c{rows} object. It has a
+ length, but to access individual rows you need to use
+ \c{results.rows.item(i)}, where \c{i} is the index of the row. This returns
+ an object representation of each row. For example, if your database has a
+ \c{name} and an \c{age} field, the \c{row} contains a \c{name} and an
+ \c{age} property. The value of the \c{age} field can be accessed using
+ \c{results.rows.item(i).age}.
+
+ \section2 Changing Database Versions
+
+ Each database has one version at a time and multiple versions cannot exist
+ at one time. Versions allow you to manage schema changes incrementally.
+
+ You can change the version of a client-side Web SQL database using the
+ \c{changeversion()} method:
+
+ \code
+ if (db.version == "1.0") {
+ try {
+ // comment out for crash recovery.
+ db.changeVersion("1.0", "2.0", cv_1_0_2_0, oops_1_0_2_0, success_1_0_2_0);
+ } catch(e) {
+ alert('changeversion 1.0 -> 2.0 failed');
+ alert('DB Version: '+db.version);
+ }
+ }
+ \endcode
+
+ \c{changeversion()} takes the following arguments: required old and new
+ version numbers, optional SQL transaction callback, optional SQL transaction
+ error callback, and optional success callback.
+
+ \section2 Errors
+
+ Asynchronous API errors are reported using callbacks that have a
+ \c{SQLError} object as one of their arguments. \c{SQLError} contains a code
+ from the table below and a localized message string.
+
+ Error codes are:
+
+ \list
+ \o 0 \c{UNKNOWN_ERROR} Transaction failed for reasons unrelated to the DB
+ \o 1 \c{DATABASE_ERROR} Statement failed for DB reasons not covered by other
+ code
+ \o 2 \c{VERSION_ERROR} DB version doesn't match expected version
+ \o 3 \c{TOO_LARGE_ERROR} Data returned from DB was too large. Try the
+ \c{SQL LIMIT} modifier.
+ \o 4 \c{QUOTA_ERROR} Insufficient remaining storage
+ \o 5 \c{SYNTAX_ERROR} Syntax error, argument mismatch, or unallowed
+ statement
+ \o 6 \c{CONSTRAINT_ERROR} An \c{INSERT}, \c{UPDATE}, or \c{REPLACE}
+ statement failed due to a constraint error
+ \o 7 \c{TIMEOUT_ERROR} Timeout waiting for transaction lock
+ \endlist
+
+ \bold{See Also:}
+ \l{HTML5 Doctor: Introducing Web SQL Databases}
+
+\list
+\o \l{QtWebKit Guide} -back to the main page
+\endlist
+*/
+
+*/
diff --git a/doc/src/webkit/guide/chapter_canvas.qdoc b/doc/src/webkit/guide/chapter_canvas.qdoc
new file mode 100644
index 0000000..eea2236
--- /dev/null
+++ b/doc/src/webkit/guide/chapter_canvas.qdoc
@@ -0,0 +1,1016 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+
+\page qtwebkit-guide-canvas.html
+\title QtWebKit Guide - Canvas Graphics
+
+\chapter Canvas Graphics
+This section of the \l{QtWebKit Guide} serves as an introduction to the
+\l{HTML5 Canvas API} features of QtWebKit.
+
+The \l{HTML5 Canvas API} enables you to draw within a Web page or Web App using
+JavaScript. After you define a rectangle that serves as your drawing canvas, you
+can draw straight and curved lines, simple and complex shapes, graphs, and
+referenced graphic images. You can add text, color, shadows, gradients, and
+patterns. The canvas API also enables you to save or export the canvas as a .png
+or .jpeg image file.
+
+To define the drawing area, set the \c{width} and \c{height} of a \c{<canvas>}
+element. For example, the following sets a drawing area with a height of 100
+pixels and width of 200 pixels:
+
+\code
+<canvas id="mycanvas" width="100" height="200"></canvas>
+\endcode
+
+By default, \c{canvas} elements are sized 150 pixels high and 300 pixels wide.
+You can also set the size of the canvas using CSS:
+
+\code
+canvas { height : 200px; width : 100px; }
+\endcode
+
+The \c{canvas} element is transparent and has no visible borders until you
+\l{Accessing the Rendering Context}{access the 2D rendering context}.
+
+Resetting the width or height of an existing canvas erases its contents and
+resets all the context properties of the canvas to their default values.
+
+\section1 Accessing the Rendering Context
+
+The rendering \bold{context} defines the methods and attributes needed to draw
+on the canvas. QtWebKit currently supports the two-dimensional rendering
+context. The following assigns the canvas rendering context to a \c{context}
+variable:
+
+\code
+var context = canvas.getContext("2d")
+\endcode
+
+The 2d context renders the canvas as a coordinate system whose origin (0,0) is
+at the top left corner, as shown in the figure below. Coordinates increase along
+the \c{x} axis from left to right and along the \c{y} axis from top to bottom of
+the canvas.
+
+\image webkit-guide/canvas_context.gif
+
+\section1 Drawing Shapes
+
+The 2D rendering context supports rectangles, lines, and arcs, which
+you can combine to build complex shapes and graphic images.
+
+ \section2 Drawing Rectangles
+
+ The rectangle is the only geometric shape that is built in to the
+ canvas API. You can draw an outline of a rectangle, a filled
+ rectangle, and a filled rectangle with clear parts. You do not have to
+ create a path to draw a rectangle.
+
+ To draw an outline of a rectangle, use the \c{strokeRect()} method.
+
+ To draw a filled rectangle, use the \c{fillRect()} method. The default
+ fill color is black.
+
+ To clear part of a filled rectangle, use the \c{clearRect()} method.
+
+ Each method accepts the following series of arguments:
+
+ \list
+ \o \c{x} is the position on the canvas to the right of the origin
+ (0,0) of the top left corner of the rectangle
+ \o \c{y} is the position on the canvas below the origin of the top
+ left corner of the rectangle
+ \o \c{width} is the width of the rectangle to be drawn
+ \o \c{height} is the height of the rectangle to be drawn
+ \endlist
+
+ For example, the following code draws concentric rectangles:
+
+ \code
+ var context = canvas.getContext("2d");
+ canvas.strokeRect(50,50,50,50);
+ canvas.fillRect(60,60,30,30);
+ canvas.clearRect(70,70,10,10);
+ \endcode
+
+ \image webkit-guide/canvas_rectangles.gif
+
+ \section2 Drawing Lines
+
+ To draw a line, you first have to \e{"put your pencil down"} on the canvas
+ by creating a path. The \c{context.beginPath()} method sets a new path
+ in the canvas. Each line that you draw is stored as a sub-path.
+ Sub-paths can be closed to form a shape, or they can be left open.
+ Each time you want to draw a new shape, you have to call the
+ \c{beginPath()} method to reset the current path.
+
+ After calling \c{beginPath()}, you set your starting position on the
+ canvas by calling the \c{context.moveTo(x,y)} method. The
+ \c{moveTo(x,y)} method creates a new subpath on the canvas that begins
+ at the Cartesian point \c{(x,y)}.
+
+ To draw a straight line, call the \c{context.lineTo(x,y)} method. This
+ adds the point (x,y) to the current subpath and connects it to the
+ previous subpath by a straight line. In other words, (x,y) are the
+ coordinates of the line's endpoint. For example:
+
+ \code
+ context.beginPath();
+ context.moveTo(10,10);
+ context.lineTo(30,30);
+ \endcode
+
+ To get the \e{pencil} to actually draw on the canvas, first use the
+ \c{strokeStyle} property to set the color to a value such as black
+ (\c{#000}):
+
+ \code
+ context.strokeStyle(#000);
+ \endcode
+
+ (The \c{strokeStyle} property can be a CSS color, a pattern, or a gradient.)
+ Then use the \c{context.stroke()} method to actually draw the line on the
+ canvas:
+
+ \code
+ context.stroke();
+ \endcode
+
+ This produces the image below. The numeric coordinates are added for clarity
+ but are not part of the image drawn by the code:
+
+ \image webkit-guide/canvas_lineStrokeTo.gif
+
+ To create a shape, call the \c{context.closePath()} method:
+
+ \code
+ context.closePath();
+ context.moveTo(10,10); // starting point
+ context.lineTo(30,30); // specify first line
+ context.moveTo(30,30); // move to end of first line
+ context.lineTo(60,10); // specify second line
+ context.moveTo(60,10); // move to end of second line
+ context.lineTo(10,10); // specify third line to close triangle
+ context.strokeStyle("#000"); // use black color for lines
+ context.stroke(); // draws the triangle lines on the canvas
+ \endcode
+
+ To fill the shape, use the \c{fillstyle} property and the \c{fill()}
+ method:
+
+ \code
+ context.fillStyle("#FF0000"); // use red color for fill
+ context.fill(); // fill the triangle
+ \endcode
+
+ The commands, if coded fully, would create the shape below:
+
+ \image webkit-guide/canvas_closepath.gif
+
+ \note It is not necessary to close the path when calling the \c{fill()}
+ method. Calling \c{fill()} closes the path and creates the completed shape.
+
+ You can draw lines of various widths, endcap types, and joining options by
+ configuring the following attributes:
+
+ \list
+ \o \c{lineWidth} sets the thickness of the current line. The value can be
+ any number greater than \c 0. For example, \c{context.lineWidth = 10} sets
+ the line thickness to \c 10 units. The default value is \c 1 unit, which is
+ not the same as \c 1 \e pixel. Instead, the line is centered on the current
+ path, with half its thickness on each side of the path.
+ \o \c{lineCap} sets the type of endpoint of the current line. The value can
+ be either \c{butt}, \c{square}, or \c{round}. (The default value is
+ \c{butt}.)
+ \list
+ \o \c{butt}- the ends of the line abutt the line guide.
+ \o \c{square} adds a box at both ends of the line.
+ \o \c{round} adds a semicircle at both ends of the line.
+ \endlist
+
+ \o \c{lineJoin} sets the style with which lines are joined. The value
+ can be either \c{bevel}, \c{round}, or \c{miter}. (The default value
+ is \c{miter}.)
+ \list
+ \o \c{bevel} flattens the corners at which the lines join
+ \o \c{round} rounds the corners at which the lines join
+ \o \c{miter} joins the lines at a single point
+ \endlist
+ \o \c{miterLimit} sets the \e{miter limit ratio}. The value can be any
+ number greater than \c 0. The miter limit ratio determines how far the
+ connection point of the outside of the lines can be from the connection
+ point of the inside of the lines. (The default value is \c 10.)
+ \endlist
+
+ \image webkit-guide/canvas_linecap.png
+
+ \section2 Drawing Arcs
+
+ To draw an arc, you begin with the same steps your followed to create
+ a line:
+
+ \list 1
+ \o Call the \c{context.beginPath()} method to \e{"put your pencil down"} on
+ the canvas and set a new path.
+ \o Call the \c{context.moveTo(x,y)} method to set your starting position on
+ the canvas at the point (x,y).
+ \o To draw an arc or circle, call the \c{context.arcTo(x1,y1,x2,y2,radius)}
+ method. This adds an arc with starting point \c{(x1,y1)}, ending point
+ \c{(x2,y2)}, and radius \c{radius} to the current subpath and connects it to
+ the previous subpath by a straight line.
+
+ \image webkit-guide/canvas_arcTo.png
+
+ \o An alternative way to draw an arc or circle is to call the
+ \c{context.arc(x,y,radius,startAngle,endAngle,anticlockwise)} method. This
+ adds an arc to the current subpath that lies on the circumference of the
+ circle whose center is at the point (x,y) and whose radius is \c{radius}.
+
+ \image webkit-guide/canvas_arcTo2.png
+
+ Both \c{startAngle} and \c{endAngle} are measured from the x axis in units
+ of radians.
+
+ A complete circle is \c 360 degrees, or 2\pi radians. A semicircle is \c 180
+ degrees, or \pi radians. The number of radians is the number of degrees
+ multiplied by \pi/180, expressed in JavaScript as:
+
+ \code
+ var radians = (Math.PI/180)*degrees;
+ \endcode
+
+ \image webkit-guide/canvas_startAngle.png
+
+ \c{anticlockwise} has the value \c{TRUE} for each arc in the figure
+ above because they are all drawn in the counterclockwise direction.
+
+ \o To create a shape, call the \c{context.closePath()} method. This
+ marks the current subpath as closed and draws a straight line from the
+ current point to the first point in the path.
+
+ \o To draw only the outline of the shape, call the \c{context.stroke()}
+ method.
+
+ \o To fill in the shape, call the \c{context.fill()} method.
+
+ \o To set the color of the fill, set the \c{strokeStyle}. For example,
+ the code
+
+ \code
+ context.strokeStyle = "#FF0000";
+ \endcode
+
+ sets the fill color to red.
+
+ \endlist
+
+ \note It is not necessary to close the path if you are going to call
+ the \c{fill()} method. The fill closes the path and creates the completed
+ shape.
+
+ To create complex shapes, combine lines and arcs:
+
+ \list 1
+ \o Call the \c{context.beginPath()} method to \e{"put your pencil down"} on
+ the canvas and set a new path.
+ \o Call the \c{context.moveTo(x,y)} method to set your starting position on
+ the canvas at the point (x,y).
+ \o Draw any combination of lines and arcs by calling the \c{lineTo},
+ \c{arcTo}, \c{arc}, \c{moveTo}, \c{closePath}, \c{stroke}, and \c{fill}
+ methods and setting the line attributes and fill colors as described above.
+ \endlist
+
+ You can also create complex shapes by removing portions of the shapes you
+ draw. The \c{clip()} method creates a clipping path that defines the area
+ along which your "scissor" will cut. Any parts of the shape outside the
+ clipping path are not displayed. To create a complex shape using the
+ \c{clip()} method:
+
+ \list 1
+ \o Call the \c{context.beginPath()} method to set the clipping path.
+ \o Define the clipping path by calling any combination of the \c{lineTo},
+ \c{arcTo}, \c{arc}, \c{moveTo}, and \c{closePath} methods.
+ \o Call the \c{context.clip()} method.
+ \endlist
+
+ The new shape displays. The following shows how a clipping path can
+ modify how an image displays:
+
+ \image webkit-guide/canvas_clip-complex.png
+
+\section1 Compositing
+
+You can build complex shapes by drawing shapes on top of each other. It is also
+possible to draw shapes behind existing shapes and to mask parts of shapes by
+using \e{compositing operations}. The \c{globalCompositeOperation} attribute
+sets the way shapes can be combined.
+
+The first shape drawn on the canvas to which additional shapes are added is
+called the \e{destination} shape. The shape drawn on the canvas afterwards to
+create the composite image is called the \e{source} shape. The value of the
+\c{globalCompositeOperation} attribute must be set to one of the following:
+
+\list
+\o \c{source-over} displays the source (newer) shape over the destination
+(older) shape unless the source shape is transparent. (This is the default
+value)
+
+\o \c{source-in} displays only the portion of the source shape that is opaque
+and overlaps the destination shape. Everything else is transparent.
+
+\o \c{source-out} displays only the portion of the source shape that does not
+overlap the destination shape.
+
+\o \c{source-atop} displays only the portion of the opaque source shape that
+overlaps the destination shape and the portion of the destination shape that is
+not covered by the opaque source shape.
+
+\o \c{destination-over} displays the destination shape over the source shape. In
+areas where both shapes are opaque and overlap, the older shape displays.
+
+\o \c{destination-in} displays only the portion of the destination shape that is
+opaque and overlaps the source shape. Everything else is transparent. The source
+(newer) shape is not visible.
+
+\o \c{destination-out} displays only the portion of the destination shape that
+does not overlap the source shape. The source shape is not visible.
+
+\o \c{destination-atop} displays only the portion of the opaque destination
+shape that overlaps the source shape and the portion of the source shape that is
+not covered by the opaque destination shape.
+
+\o \c{lighter} displays both the source and destination shapes. Where the shapes
+overlap, the their color values are added, producing a lighter color.
+
+\o \c{copy} displays only the source shape. The destination shape is ignored.
+
+\o \c{xor} displays both the source and the destination shapes except the areas
+of overlap, in which both shapes are completely transparent.
+\endlist
+
+The following figure shows the various compositing effects:
+\image webkit-guide/canvas_composite.png
+
+\section1 Saving and Exporting Canvas Drawings as Image Files
+
+You can save or export your canvas drawings as .png or .jpeg image files by
+calling the \c{toDataURL()} method:
+
+\code
+canvas.toDataURL([type, ...])
+\endcode
+where:
+\list
+\o \c{type} is the MIME type to which you want to save or export your canvas.
+Possible values are:
+ \list
+ \o \c{"image\png"} (Default value)
+ \o \c{"image\jpeg"}
+ \endlist
+\o\c{...} represents additional arguments that depend on the MIME type.
+ \list
+ \o If \c{type} is \c{png}, this argument is \c{" "}
+ \o If \c{type} is \c{jpeg}, this argument is the desired quality level of the
+ image. The value is a number in the range 0.0 to 1.0, inclusive.
+ \endlist
+\endlist
+
+\section1 Drawing Text
+
+You can draw text on your canvas by setting the following font attributes on the
+2d drawing context:
+
+\list
+\o \c{font} refers to any font, expressed the same way as in CSS properties.
+This attribute's value can include any font style, variant, weight, size,
+height, and family. For example:
+
+ \code
+ context.font = "12pt Arial";
+ \endcode
+
+ The default value is \c{10px sans-serif}.
+
+ If you set the \c{font} attribute to a
+ relative font size, the browser multiplies it by the computed font size of the
+ \c{<canvas>} element itself. For example:
+
+ \code
+ context.font = "200%";
+ \endcode
+
+\o \c{textAlign} specifies the alignment of the text. The values can be one of
+the following:
+ \list
+ \o \c{left} for left-aligned text
+ \o \c{right} for right-aligned text
+ \o \c{center} for text that is centered within each line
+ \o \c{start} (default) - the text is aligned at the beginning of the line. Text
+ is left- or right-justified based on locale-specific writing method: left when
+ text is left-to-right, right when text is right-to-left.
+ \o \c{end} - the text is aligned at the end of the line, either left or right
+ depending on locale-specific writing method.
+ \endlist
+
+\o \c{textBaseline} specifies the position at which text is drawn relative to a
+baseline. The figure below, from \l{HTML5 Canvas API}, illustrates the possible
+values for the \c{textBaseline} attribute:
+ \list
+ \o \c{top} is the top of the em square, which approximates the top of the glyphs
+ in a font
+ \o \c{hanging} specifies a hanging baseline, where the tops of some glyphs are
+ anchored.
+ \o \c{middle} is the mid-point of the em square
+ \o \c{alphabetic} (default) is the anchor point of many alphabetic characters
+ \o \c{ideographic} is the anchor point of many ideograms, such as the characters
+ used in the writing systems of many Asian languages
+ \o \c{bottom} is the bottom of the em square
+ \endlist
+\endlist
+
+\image webkit-guide/canvas_text.png
+
+To draw text on a canvas:
+\list 1
+\o Set the \c{font} attribute on the drawing context. For example:
+ \code
+ context.font = "bold 11px arial"
+ \endcode
+\o Measure the text that you want to draw by calling the \c{measureText} method:
+ \code
+ TextMetrics measureText("Text to draw");
+ \endcode
+where \c{TextMetrics} is the object returned. Its \c{width} attribute is the
+width, in pixels, that the \c{"Text to draw"} would be when drawn with the font
+specified by the \c{font} attribute.
+\o Call either of the following methods:
+ \list
+ \o \c{fillText} draws the text with the font style specified by the \c{font}
+ attribute, the alignment specified by the \c{textAlign} attribute, and the
+ baseline specified by the \c{textBaseline} attribute. For example:
+ \code
+ context.fillText("Text to draw",x,y,maximumWidth);
+ \endcode
+where \c{x} and \c{y} are the coordinates at which the drawing begins (the
+anchor point), and \c{maximumWidth} is the maximum width of the text string
+(optional). If the \c{width} returned in step 2 is larger than the
+\c{maximumWidth}, the font is scaled down until the width of the text string is
+less than the \c{maximumWidth} specified.
+
+If you don't specify the \c{font} attribute, the text inherits the font size and
+style of the \c{<canvas>} element itself.
+
+\o \c{strokeText} is the same as the \c{fillText} method, except that
+a stroke style is applied to the text instead of a fill style,
+creating outlines of glyphs. For example:
+
+\code
+context.fillText("Text to stroke",x,y,maximumWidth);
+\endcode
+
+\endlist
+
+\endlist
+
+\section1 Working with Images
+
+You can insert existing images onto your canvas, you can scale or crop
+them, and you can combine them to create composite images. You can
+also draw new images by creating an \c{Image()} object with JavaScript.
+
+To insert an existing image onto a canvas, call the \c{drawImage} method:
+
+\code
+context.drawImage(image, dx, dy, dw, dh)
+\endcode
+
+where:
+
+\list
+
+\o \c{image} is a reference to an HTML \c{<image>} or \c{<canvas>}
+element. The image must be fully loaded before you can draw it on the
+canvas. The reference cannot be a URL. Instead, it should be
+referenced using standard DOM methods such as \c{document.images()} or
+\c{document.getElementById()}. For example:
+
+\code
+<canvas id="demo1" width="100" height="150"></canvas>
+
+var canvas = document.getElementById("demo1");
+var context = canvas.getContext("2d");
+\endcode
+
+
+\o \c{dx} is the x coordinate of the upper left corner of the image to be
+drawn on the canvas (the destination image)
+
+\o \c{dy} is the y coordinate of the upper left corner of the destination
+image
+
+\o \c{dw} is the width of the destination image (optional)
+
+\o \c{dh} is the height of the destination image (optional)
+
+\endlist
+
+If \c{dw} and \c{dh} are not specified, the image retains its source
+dimensions when drawn on the canvas. When \c{dw} and \c{dh} are
+specified, the image is scaled to width \c{dw} and height \c{dh} when
+drawn on the canvas.
+
+If you want to crop the source image, the \c{drawImage} method can be
+overloaded with the following arguments:
+
+\code
+context.drawImage(image, sx, sy, sw, sh, dx, dy, dw, dh)
+\endcode
+
+where:
+\list
+\o \c{sx} is the x coordinate of the upper left corner of the cropped source
+image
+\o \c{sy} is the y coordinate of the upper left corner of the cropped source
+image
+\o \c{sw} is the width of the cropped source image
+\o \c{sh} is the height of the cropped source image
+\endlist
+
+Use this method if you want to crop the source image to the rectangle (sx, sy,
+sw, sh) before drawing it on the canvas. The destination image will have width
+\c dw, height \c dh, and upper left corner at coordinates \c{(dx,dy)} on the
+canvas.
+
+To create a new image using JavaScript, create an \c{Image} object and define
+its source. Use an \c{onload} event handler to ensure that the \c{drawImage}
+method is not called until the image has finished loading. For example:
+
+\code
+var graphic = new Image();
+graphic.src = "clipart/graphic.png";
+\endcode
+
+The image begins to load.
+
+\code
+graphic.onload = function(){
+ context.drawImage(graphic,x,y);
+};
+\endcode
+
+ \section2 Creating Patterns with Images
+
+ You can create patterns with an image by repeating it horizontally,
+ vertically, or both. The top left corner of the first image must be
+ anchored at the origin of the coordinate space. To repeat an image,
+ call the \c{createPattern} method:
+
+ \code
+ context.createPattern(image, repetition);
+ \endcode
+
+ where:
+
+ \list
+
+ \o \c{image} is a reference to an HTML \c{<image>} or \c{<canvas>}element
+ that is repeated to form a pattern. The image must
+ be fully loaded before you can draw it on the canvas. The reference
+ cannot be a URL. Instead, it should be referenced via standard DOM
+ methods such as
+ \list
+ \o \c{document.images} and
+ \o \c{document.getElementById}. For example:
+
+ \code
+ <canvas id="demo1" width="100" height="150"></canvas>
+
+ var canvas = document.getElementById("demo1");
+ var context = canvas.getContext("2d");
+ \endcode
+ \endlist
+ \o \c{repetition} is the direction in which the image repeats to form the
+ pattern. Possible values are:
+ \list
+ \o \c{repeat} (default) the image repeats both horizontally and vertically
+ \o \c{repeat-x} the image repeats horizontally
+ \o \c{repeat-y} the image repeats vertically
+ \endlist
+ \endlist
+
+ The repeated images are the same size as the source image. The
+ \c{createPattern} method does not scale the images.
+
+ For example, to create a horizontal pattern of roses, create an
+ \c{Image} object to use as a pattern and define its source. Use an
+ \c{onload} event handler to ensure that the \c{createPattern} method
+ is not called until the image has finished loading. For example:
+
+ \code
+ var roses = new Image();
+ roses.src = "clipart/roses.jpg";
+ \endcode
+
+ The image begins to load.
+
+ \code
+ roses.onload = function(){
+ var pattern = context.createPattern(roses,repeat-x);
+ };
+ \endcode
+
+ \image webkit-guide/canvas_pattern.png
+
+\section1 Applying Colors
+
+To draw the outline of a shape in color, set the \c{strokeStyle} attribute to
+any valid \l{CSS Color Value}{CSS color value}. The color value can be in
+hexadecimal notation or in RGB/HSL notation, as described in \l{Specifying Color
+and Opacity}. For example, either of the following sets a shape's outline to
+red:
+
+\code
+context.strokeStyle = "#FF0000"
+context.strokeStyle = "rgb(255,0,0)"
+\endcode
+
+To fill a shape with color, set the \c{fillStyle} attribute to a l{CSS Color
+Value}{CSS color value}. The color value can be in hexadecimal notation or in
+RGB/HSL notation. For example, either of the following colors a shape's interior
+as blue:
+
+\code
+context.fillStyle = "#0000FF"
+context.fillStyle = "rgb(0,0,255)"
+\endcode
+
+The \l{CSS3 Color Module specification} extends both RGB and HSL color models to
+include a color's opacity, referred to as its \e{alpha}. These extended
+models are known as RGBA and HSLA. There are no hexadecimal notations for RGBA
+and HSLA values. The following specifies varying levels of opacity for a blue
+shape:
+
+\code
+context.fillStyle = rgba(0, 0, 255, 0) // transparent
+context.fillStyle = rgba(0, 0, 255, 0.5) // semi-transparent
+context.fillStyle = rgba(0, 0, 255, 1) // opaque
+\endcode
+
+When you set the \c{context.strokeStyle} or \c{context.fillStyle} attributes,
+whatever value you set becomes the default value for all subsequently drawn
+shapes, until you set a new value.
+
+ \section2 Applying Gradients
+
+ A gradient is a smooth transition between colors. There are two types of
+ gradients: linear and radial.
+
+ A linear gradient transitions the color along a line between two points. To
+ create a linear gradient, call the \c{createLinearGradient} method:
+
+ \code
+ createLinearGradient(x0, y0, x1, y1)
+ \endcode
+
+ where \c{(x0, y0)} is the starting point and \c{(x1, y1)} is the ending
+ point for the linear gradient.
+
+ A radial gradient transitions the color along a cone between two circles. To
+ create a radial gradient, call the \c{createRadialGradient} method:
+
+ \code
+ createRadialGradient(x0, y0, r0, x1, y1, r1)
+ \endcode
+ where:
+ \list
+ \o \c{(x0, y0, r0)} represents the starting circle, whose origin is \c{(x0,
+ y0)} and whose radius is \c{r0}.
+ \o \c{(x1, y1, r1)} represents the ending circle, whose origin is \c{(x1, y1)}
+ and whose radius is \c{r1}.
+ \endlist
+
+ Gradients must have two or more \e{color stops}, representing color
+ shifts positioned from \c 0 to \c 1 between to the gradient's starting and
+ end points or circles:
+
+ \code
+ addColorStop(position,color)
+ \endcode
+
+ where:
+ \list
+ \o \c{position} specifies the position of the color within the already
+ defined starting and end points or circles, expressed as a number from \c 0
+ to \c 1.
+ \o \c{color} specifies the CSS color at that position.
+ \endlist
+
+ For example, to define a gradient that varies from red to blue horizontally
+ along a rectangular area:
+ \list 1
+ \o Create a gradient object:
+ \code
+ var redbluegradient = context.createLinearGradient(0,0,100,0);
+ \endcode
+ \o Define the color stops:
+ \code
+ redbluegradient.addColorStop(0, "rgb(255,0,0)"); // red at the left side of the rectangle
+ redbluegradient.addColorStop(1, "rgb(0,0,255)"); // blue at the right side of the rectangle
+ \endcode
+ \o Draw the shape and set a \c{fillStyle} or \c{strokeStyle}:
+ \code
+ context.fillStyle = redbluegradient;
+ context.fillRect(0,0,100,150);
+ \endcode
+ \endlist
+
+ To define a gradient that varies from red to blue vertically along a
+ rectangle:
+ \list 1
+ \o Create a gradient object:
+ \code
+ var redbluegradient = context.createLinearGradient(0,0,0,150);
+ \endcode
+ \o Define the color stops:
+ \code
+ redbluegradient.addColorStop(0, "rgb(255,0,0)"); // red at the top of the rectangle
+ redbluegradient.addColorStop(1, "rgb(0,0,255)"); // blue at the bottom of the rectangle
+ \endcode
+ \o Draw the shape and set a \c{fillStyle} or \c{strokeStyle}:
+ \code
+ context.fillStyle = redbluegradient;
+ context.fillRect(0,0,100,150);
+ \endcode
+ \endlist
+
+ \note A canvas gradient's color stops behave slightly differently than those
+ used within non-canvas \l{Gradients}{gradients}. Webkit gradients specify
+ mandatory \c{from} and \c{to} colors, with optional \c{color-stop} values
+ for additional color shifts within the overall range of the gradient. For
+ canvas gradients, even the initial and final colors are defined as color
+ stops.
+
+ \section2 Applying Shadows
+
+ To add a shadow effect to a drawing on a canvas, set the following
+ attributes:
+
+ \list
+ \o \c{shadowColor} sets the color of the shadow. The value can be any CSS
+ color value. The default value is transparent black (\c{"rgba(0,0,0,0)"}).
+
+ \o \c{shadowBlur} sets the amount of blur in the shadow, in pixels. The
+ value can be any positive number or 0. A value of 0 produces a sharp shadow
+ with no blur.
+
+ \o \c{shadowOffsetX} sets the number of pixels the shadow extends
+ horizontally from the object drawn. If this value is a positive number, the
+ shadow extends to the right of the object. If negative, the shadow extends
+ to the left of the object. The default value is 0 pixels.
+
+ \o \c{shadowOffsetY} sets the number of pixels the shadow extends vertically
+ from the object drawn. If this value is a positive number, the shadow
+ extends below the object. If negative, the shadow extends above the object.
+ The default value is 0 pixels.
+ \endlist
+
+ The following example code adds a semi-transparent black shadow to the
+ bottom right of a blue rectangle:
+
+ \code
+ var context = canvas.getContext("2d");
+ context.shadowOffsetX = 5;
+ context.shadowOffsetY = 5;
+ context.shadowBlur = 10;
+ context.shadowColor = "rgba(0,0,0,0.5)";
+ context.fillStyle = "#0000FF";
+ context.fillRect = (0,0,100,50)
+ \endcode
+
+\section1 Transforming Graphics
+
+When drawing shapes and paths, you can translate the canvas's origin, rotate the
+canvas around the origin, scale the units in the canvas grid, and modify the
+transformation matrix directly.
+
+ \section2 Translating the Canvas Origin
+
+ Translating the origin enables you to draw patterns of different objects on
+ the canvas without having to measure the coordinates manually for each
+ shape. To translate the origin of the canvas, use the \c{translate} method:
+ \code
+ context.translate(x,y);
+ \endcode
+ where:
+ \list
+ \o \c{x} is the horizontal distance that the origin is translated, in
+ coordinate space units
+ \o \c{y} is the vertical distance that the origin is translated, in
+ coordinate space units
+ \endlist
+
+ \section2 Rotating the Canvas
+
+ To rotate the canvas around the current origin, call the \c{rotate()}
+ method:
+ \code
+ context.rotate(angle);
+ \endcode
+ where \c{angle} is the clockwise rotation angle in radians.
+ The number of radians is the number of degrees multiplied by \pi/180,
+ expressed in JavaScript as:
+ \code
+ var radians = (Math.PI/180)*degrees;
+ \endcode
+ \image webkit-guide/canvas_rotate.png
+
+ \section2 Scaling the Canvas Grid
+
+ To increase or decrease the size of each unit in the canvas grid, call the
+ \c{scale} method:
+
+ \code
+ context.scale(x,y);
+ \endcode
+
+ where:
+
+ \list
+
+ \o \c{x} is the scale factor in the horizontal direction
+
+ \o \c{y} is the scale factor in the vertical direction
+
+ \endlist
+
+ The scale factors are in multiples. For example, \c{scale(2.0, 0.5)} would
+ double the horizontal size of an object drawn on the canvas and half its
+ vertical size, as shown below:
+
+ \image webkit-guide/canvas_scale.png
+
+ \section2 Manipulating the Transformation Matrix
+
+ Modifying the transformation matrix directly enables you to perform scaling,
+ rotating, and translating transformations in a single step.
+
+ The transformation matrix is an \e{affine transformation} matrix from linear
+ algebra. Affine transformations preserve colinearity and relative distance
+ in the transformed coordinate space. This means that points in a line remain
+ in a line, parallel lines remain parallel, and the distance between lines
+ and objects maintains the same ratio, even if a scale factor is applied.
+ Repositioning by translation, rotation, or skewing is also possible.
+
+ Each point on the canvas is multiplied by the matrix before anything is
+ drawn. The \l{HTML5 Canvas API} defines the transformation matrix as:
+
+ \image webkit-guide/canvas_math.png
+ where:
+ \list
+ \o \c{a} is the scale factor in the horizontal (x) direction
+ \image webkit-guide/canvas_scalex.png
+ \o \c{c} is the skew factor in the x direction
+ \image webkit-guide/canvas_skewx.png
+ \o \c{e} is the translation in the x direction
+ \image webkit-guide/canvas_translate.png
+ \o \c{b} is the skew factor in the y (vertical) direction
+ \image webkit-guide/canvas_skewy.png
+ \o \c{d} is the scale factor in the y direction
+ \image webkit-guide/canvas_scaley.png
+ \o \c{f} is the translation in the y direction
+ \image webkit-guide/canvas_translatey.png
+ \o the last row remains constant
+ \endlist
+
+ The scale factors and skew factors are multiples; \c{e} and \c{f} are
+ coordinate space units, just like the units in the \c{translate(x,y)}
+ method.
+
+ The rotation transformation matrix is as follows:
+
+ \image webkit-guide/canvas_math_rotate.png
+
+ where the \c angle of rotation is in radians.
+
+ \bold{See Also:}
+ \l{http://www.senocular.com/flash/tutorials/transformmatrix/}{senocular.com}
+ for a good explanation of how transformation matrices are used
+ identically within Adobe Flash.
+
+\section1 Canvas Animations
+
+You can animate a canvas drawing by repeatedly redrawing the canvas for each
+frame and translating, rotating, skewing, and scaling the drawn objects.
+
+To draw each frame by employing the HTML5 canvas API, you should define the
+original canvas state and save it for future reference. The drawing context
+maintains a stack of drawing states. Each state consists of the current
+transformation matrix, current clipping region, and current values of the
+following attributes:
+\list
+\o\c{strokeStyle}
+\o\c{fillStyle}
+\o\c{globalAlpha}
+\o\c{lineWidth}
+\o\c{lineCap}
+\o\c{lineJoin}
+\o\c{miterLimit}
+\o\c{shadowOffsetX}
+\o\c{shadowOffsetY}
+\o\c{shadowBlur}
+\o\c{shadowColor}
+\o\c{globalCompositeOperation}
+\o\c{font}
+\o\c{textAlign}
+\o\c{textBaseline}
+\endlist
+The current path and the current bitmap are NOT part of the drawing state.
+The path can be reset only by invoking the \c{beginPath()} method. The current
+bitmap is a property of the canvas, not of the context.
+
+To save the original canvas state, call the \c{save()} method:
+\code
+context.save();
+\endcode
+
+Before drawing each new frame, you must clear the canvas:
+\code
+canvas.clearRect(x,y,width,height);
+\endcode
+where:
+\list
+\o \c{x} is the position of the top left corner of the canvas on the horizontal
+axis
+\o \c{y} is the position of the top left corner of the canvas on the vertical
+axis
+\o \c{width} is the width of the canvas
+\o \c{height} is the height of the canvas
+\endlist
+
+Draw the new frame using any of the methods provided by the canvas API. Then
+save it by calling the \c{save()} method.
+
+If you wish to return to the state of the original frame as the basis for each
+new frame that you draw, call the \c{context.restore()} method.
+
+To execute the drawing methods repeatedly, use the standard JavaScript-based
+animation technique, calling the \c{setInterval()} and \c{clearInterval()}
+methods. The following shows how to execute an animation function every \c 50
+milliseconds (corresponding to 20 times per second, a typical animation frame
+rate), then subsequently halt the animation:
+\code
+var id = setInterval(functionName, 50);
+clearInterval(id);
+\endcode
+
+\bold{See Also:}
+\list
+\o
+\l{http://www.canvasdemos.com/2009/10/09/html-5-canvas-animation/}{CanvasDemos.com: animated cartoon}, which discusses how to use Canvas as an animation framework.
+
+\o
+\l{http://blog.nihilogic.dk/2009/02/html5-canvas-cheat-sheet.html}{nihilogic.dk:
+HTML5 Canvas Cheat Sheet}
+
+\o \l{QtWebKit Guide} -back to the main page
+\endlist
+
+*/
diff --git a/doc/src/webkit/guide/chapter_css.qdoc b/doc/src/webkit/guide/chapter_css.qdoc
new file mode 100644
index 0000000..71005fc
--- /dev/null
+++ b/doc/src/webkit/guide/chapter_css.qdoc
@@ -0,0 +1,1519 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+
+\page qtwebkit-guide-css.html
+
+\title QtWebKit Guide - Level 3 CSS
+
+\chapter Level 3 CSS
+This section of the \l{QtWebKit Guide} serves as an introduction to various
+Level 3 CSS features supported by QtWebKit:
+
+\list
+
+\o The \l{Media Queries} section discusses a simple client-based technique to
+present different interfaces and functionality from a single source of content
+to different classes of mobile device.
+
+\o The \l{Selectors} section concentrates on recently introduced syntax elements
+that make applying formatting and gathering DOM elements more flexible.
+
+\o The \l{Visual Effects} section surveys numerous formatting properties,
+including new color models and advanced WebKit effects.
+
+\o Finally, the \l{Dynamic CSS} section discusses 2D transforms, transitions,
+and keyframe animations.
+
+\endlist
+
+This section features links to numerous sample pages that demonstrate how
+various CSS3 features may be applied within a mobile interface. For best
+results, view these samples with a modern Webkit-based browser such as Apple
+Safari or Google Chrome. Resize the window in which the sample appears to
+roughly match the dimensions of a touch-screen mobile device.
+
+\section1 Media Queries
+
+CSS \e{media queries} extend \e{media types} with more detailed capabilities.
+Media queries offer a simple client-side mechanism to customize interfaces
+comprehensively via CSS.
+
+Media queries are especially useful when extending a body of content for
+presentation on mobile browsers. Prior to support for this feature, there were
+two basic approaches to provisioning mobile web content, both server-based:
+
+\list
+\o \e{Mobile-specific domains}. Content providers might provide a separate
+access points for default content at \c{www.website.com}, with mobile content
+available at \c{m.website.com} or \c{website.mobi}. There might also be an
+additional \c{touch.website.com} access point targeted for higher-end
+touch-screen browsers.
+
+\o \e{Dynamic Server-based Adaptation}. In this case, there is a single access
+point, but the server sends different content, typically depending on the
+\e{User-Agent} header included in all browsers' HTTP requests.
+This approach may leverage databases of device characteristics such as
+\l{WURFL} or \l{DeviceAtlas}.
+\endlist
+
+This section describes how to provision CSS entirely on the mobile
+client.
+
+ \section2 Media Types and Media Queries
+
+ If you only want to serve interfaces for desktop browsers and low-end mobile
+ browsers, specify external CSS files within your HTML's \c{head} region
+ using media types:
+
+ \code
+ <link media="screen" href="/path/to/desktop.css" type="text/css" rel="stylesheet"/>
+ <link media="handheld" href="/path/to/mobile.css" type="text/css" rel="stylesheet"/>
+ \endcode
+
+ The \c{media} attribute specifies different \e{types} of browser: \c{screen}
+ for large-screen desktop browsers, and \c{handheld} for mobile browsers.
+ Browsers identifying themselves as \c{handheld} are served the
+ \c{mobile.css} file, which should specify a dramatically simplified
+ mobile interface.
+
+ A problem arises, however, when the majority of higher-end touch browsers
+ identify themselves as the \c{screen} media type, to avoid being served
+ overly simplified content that is beneath their capabilities. The example
+ above serves a desktop-oriented design to later-generation mobile browsers.
+ To target a higher-end mobile design to these browsers, you need to specify
+ additional media \c{queries}:
+
+ \code
+ <link media="only screen and (min-device-width: 481px)" href="/path/to/desktop.css" type="text/css" rel="stylesheet"/>
+ <link media="only screen and (max-device-width: 480px)" href="/path/to/touch.css" type="text/css" rel="stylesheet"/>
+ <link media="handheld" href="/path/to/mobile.css" type="text/css" rel="stylesheet"/>
+ \endcode
+
+ The first two lines specify any \c{screen}-typed browser whose window
+ is wider or narrower than 480 pixels.
+
+ Regions of content that are inappropriate for presentation within
+ either the touch-based or lower-end mobile design can then be easily
+ removed within the corresponding CSS files:
+
+ \code
+ .widget, .nested_nav, .sidebar, .video_ad, .related_items {
+ display: none;
+ }
+ \endcode
+
+ The following example demonstrates a simple message identifying your class
+ of browser, which appears dynamically based on CSS that is linked using
+ media types and media query syntax:
+
+ \l{mob_mediaquery}{\inlineimage webkit-guide/scr_mob_mediaquery.png
+ }
+
+ \e{Click on the image to view the example live in a browser or click on the
+ following links to view the CSS files.}
+
+ \l{mq_desktop_css}{(Desktop CSS)}
+ \l{mq_touch_css}{(Touch-Screen CSS)}
+ \l{mq_mobile_css}{(Low-end Mobile CSS)}
+
+ The following example shows a skeletal interface that appears differently
+ based on the type of browser viewing it. The image below shows how it
+ appears when viewed on a touch-based browser, but a desktop browser renders
+ a more elaborate three-column layout:
+
+ \l{mob_layout}{\inlineimage webkit-guide/scr_mob_layout.png
+ }
+
+ \l{mqlayout_desktop_css}{(Desktop CSS)}
+ \l{mqlayout_touch_css}{(Touch-Screen CSS)}
+ \l{mqlayout_mobile_css}{(Low-end Mobile CSS)}
+
+ When viewed with a desktop browser,
+ the page displays a typical desktop-style layout:
+ a main content column surrounded by navigation and sidebar columns,
+ with banner headers and footers that straddle the top and bottom of
+ the screen.
+ When viewed with a touch-based browser,
+ the sidebar element does not appear.
+ The main content extends to the full width of the screen,
+ while header and navigation elements share the top of the screen.
+ When viewed with other mobile browsers,
+ even the top of the screen is simplified to replace header information
+ with a simple icon.
+
+ Note that you can also use media queries to customize interfaces for
+ tablet devices such as the Apple iPad:
+
+ \code
+ <link rel="stylesheet" media="all and (min-device-width: 481px)
+ and (max-device-width: 1024px)" href="/path/to/ipad.css"/>
+ \endcode
+
+ \section2 In-line Media Queries
+
+ While it's generally good practice to keep CSS for different designs within
+ separate files, you can also consolidate them. The following example
+ provides a default san-serif font styling for \c{h1} elements, then
+ different sets of style sheets for three browser categories:
+
+ \code
+ h1 { font-family : Arial, sans-serif }
+ @media screen {
+ h1 { color: #00008B; }
+ }
+ @media only screen and (max-device-width: 480px) {
+ h1 { color: #00008B; font-size: medium; }
+ }
+ @media handheld {
+ h1 { font-size: medium; font-weight: bold }
+ }
+ \endcode
+
+ Consolidating style sheets in this manner may reduce the number of separate
+ HTTP requests, help web designers to keep track of variations among designs,
+ and reduce style sheet properties defined redundantly in more than one file.
+
+ \section2 Media Queries via JavaScript
+
+ Browsers that support media queries also support APIs to test them from
+ within JavaScript. Browsers based on QtWebKit use the \c{matchMedia} API.
+ Some other browsers use a slightly different (and older) \c{styleMedia} API,
+ which itself used to be called the \c{media} API. Each can be called from
+ the \c{window} object. The following function accounts for all three cases:
+
+ \code
+ function matchesMediaQuery(query) {
+ if (!!window.matchMedia)
+ return window.matchMedia(query).matches;
+ if (!!window.styleMedia && !!window.styleMedia.matchMedium)
+ return window.styleMedia.matchMedium(query);
+ if (!!window.media && window.media.matchMedium)
+ return window.media.matchMedium(query);
+ return false;
+ }
+ \endcode
+
+ The \c{query} argument corresponds to the media query string used to
+ activate the CSS. For example, the following higher-level function tests
+ whether the browser matches design categories provided simple labels such as
+ \c{desktop}, \c{touch}, or \c{mobile}:
+
+ \code
+ function isDesign(str) {
+ var design;
+ if (matchesMediaQuery('only screen and (min-device-width: 481px)')) {
+ design = 'desktop';
+ }
+ else if (matchesMediaQuery('only screen and (max-device-width: 480px)')) {
+ design = 'touch';
+ }
+ else if (matchesMediaQuery('handheld')) {
+ design = 'mobile';
+ }
+ return str == design;
+ }
+ \endcode
+
+ You can then use the test whenever there is a need to assign functionality
+ for a specific design. The following gathers a series of images and assigns
+ different panel-viewing functions for \c{desktop} and \c{touch} designs,
+ with no functionality assigned to the lower-end \c{mobile} design:
+
+ \code
+ var imgs = document.querySelectorAll("img.panel");
+ for ( var i = 0, len = imgs.length ; i < len ; i++ ) {
+ el = imgs[i];
+ if ( isDesign("desktop") ) {
+ imgs[i].addEventListener("mouseover", showHoverPanel);
+ imgs[i].addEventListener("mouseout", hideHoverPanel);
+ }
+ else if ( isDesign("touch") ) {
+ imgs[i].addEventListener("click", showTouchPanel);
+ }
+ }
+ \endcode
+
+ The following example uses this technique to produce a simple message,
+ dynamically generated by JavaScript,
+ that corresponds to the message generated by CSS:
+
+ \l{mob_condjs}{\inlineimage webkit-guide/scr_mob_condjs.png
+ }
+
+ \l{mob_condjs_css}{(CSS)}
+ \l{mob_condjs_js}{(JavaScript)}
+
+\section1 Selectors
+
+Level 3 CSS provides many useful new \e{selectors} that make it easier to apply
+formatting to page elements. In addition, the \l{Selectors API} makes DOM
+elements accessible using the same CSS expressions you use to apply formatting
+to them. The following show alternate ways to access elements:
+
+\code
+var element = document.getElementById('map');
+var element = document.querySelector('#map');
+
+var elements = document.getElementByClassName('active');
+var elements = document.querySelectorAll('ul > li.active');
+\endcode
+
+This section provides examples of how different kinds of Level 3
+selectors might be applied when formatting mobile interfaces.
+
+ \section2 Attribute Matching
+
+ It is often useful to offer visual hints marking different kinds of link.
+ Users might want to know the difference between a link to a page on the same
+ website and one on an external site. Links to non-HTML file types might pose
+ special challenges to mobile users. Alternately, mobile users might get
+ special benefit from telephone links.
+
+ You can automate this by using the CSS attribute prefix and suffix matching
+ selectors. The following uses \c{^=} to mark external HTTP links, email,
+ SMS, and telephone links, by inserting an icon after the text of the link:
+
+ \code
+ a[href^="http://"]:after, a[href^="https://"]:after
+ { content : url(icon/external.png); }
+ a[href^="mailto:"]:after { content : url(icon/email.png); }
+ a[href^="sms:"]:after { content : url(icon/sms.png); }
+ a[href^="tel:"]:after { content : url(icon/tel.gif); }
+ \endcode
+
+ The following uses \c{$=} to identify various file types by common suffixes:
+
+ \code
+ a[href$=".doc"]:after { content : url(icon/ms_word.gif) }
+ a[href$=".ppt"]:after { content : url(icon/powerpoint.gif) }
+ a[href$=".rss"]:after, a[href$=".xml"]:after
+ { content : url(icon/feed.gif) }
+ a[href$=".pdf"]:after { content : url(icon/pdf.jpg) }
+ a[href$=".xls"]:after { content : url(icon/excel.jpg) }
+ \endcode
+
+ You can also use \c{*=} to freely match substrings within any attribute
+ value. The following might distinguish links to a site's blog area based on
+ how the URL is organized:
+
+ \code
+ a[href*="/blog/"]:after { content : url(icon/blog.jpg )}
+ \endcode
+
+ The following example demonstrates links identified by dynamically generated
+ icons:
+
+ \l{layout_link-fmt}{\inlineimage webkit-guide/scr_layout_link-fmt.png
+ }
+
+ \l{layout_link-fmt_css}{(CSS)}
+
+ \section2 Form Input State
+
+ The \c{:checked} dynamic class allows you to style radio and checkbox inputs
+ based on their selection state:
+
+ \code
+ input[type=radio],
+ input[type=checkbox]
+ { text-align : right }
+
+ input[type=radio]:checked,
+ input[type=checkbox]:checked
+ { text-align : left }
+ \endcode
+
+ This enables the following mobile-friendly interface, which converts small
+ radio and check boxes to much more accessible toggle buttons:
+
+ \l{form_toggler}{\inlineimage webkit-guide/scr_form_toggler.png
+ }
+
+ \l{form_toggler_css}{(CSS)}
+
+ Using the dynamic \c{:checked} CSS class, the \c{text-align} property
+ toggles from \c{left} to \c{right} depending on whether the \c{input} is
+ checked or not. Note that to display button text, dynamic classes can be
+ chained together to form complex expressions:
+ \c{input[type=radio]:checked:before}.
+
+ The example also relies on the \c{-webkit-appearance} property, which allows
+ you to override the default visual presentation of specialized interface
+ elements such as radio and checkbox inputs.
+
+ The following example provides alternate styling for radio and checkbox
+ inputs, presenting them as tappable buttons:
+
+ \l{form_tapper}{\inlineimage webkit-guide/scr_form_tapper.png
+ }
+
+ \l{form_tapper_css}{(CSS)}
+
+ Form elements may also be re-styled based on whether they are \c{:enabled}
+ or \c{:disabled}. In addition, the \c{:focus} dynamic class allows you to
+ style text form inputs or other editable content regions that users have
+ currently selected for editing.
+
+ \section2 Navigational Selectors
+
+ Elements within a page that are the target of navigation can receive
+ distinct styling using the \c{:target} dynamic class. The act of navigating
+ to an element can alter its appearance, or even determine if it is to appear
+ at all.
+
+ The following example relies on anchor navigation to display successive rows
+ of a table within a mobile interface:
+
+ \l{layout_tbl-keyhole}{\inlineimage webkit-guide/scr_layout_tbl-keyhole.png
+ }
+
+ \l{layout_tbl-keyhole_css}{(CSS)}
+
+ While the example relies on table-related tags, they are re-styled with
+ block formatting to confine each row of information within the screen. Each
+ row features links to other rows, triggering their display. Other links
+ navigate away from the table, which suppresses its display altogether. This
+ is the main CSS driving the interface:
+
+ \code
+ .mobile > tbody > tr { display : none }
+ .mobile > tbody > tr:target { display : block }
+ \endcode
+
+ The same technique may be used to display or dismiss optional interface
+ elements such as panels, simply by providing navigation links to them within
+ the page.
+
+ \section2 Indirect Sibling Selector
+
+ The Level 2 \c{+} selector allows you to style elements that immediately
+ follow other specified elements. For example, the following refers to a
+ paragraph that immediately follows a heading at the same level of markup:
+
+ \code
+ h1 + p { font-weight: bold }
+ \endcode
+
+ In contrast, the Level 3 \c{~} indirect sibling selector allows you to style
+ any subsequent element at the same level within the markup. The following
+ example styles any element that follows an \c{h2} that is classed
+ \c{pullquote}:
+
+ \code
+ h2 ~ .pullquote { font-size: 90% }
+ \endcode
+
+ \note Webkit-based browsers do not yet allow you to style
+ elements dynamically via indirect sibling selectors.
+
+ \section2 Positional Selectors
+
+ Various dynamic classes allow you to style elements depending on their
+ position with a series of elements: either elements of the same type, or
+ other child elements of the same parent. The following example aligns a
+ series of icons to a grid:
+
+ \l{css3_sel-nth}{\inlineimage webkit-guide/scr_css3_sel-nth.png
+ }
+
+ \l{css3_sel-nth_css}{(CSS)}
+
+ Columns are specified with the \c{:nth-of-type()} selector, which accepts
+ numeric expressions as arguments. The following selectors refer to every
+ fourth \c{img} element, but offset by a specified number:
+
+ \code
+ img { position: absolute }
+ img:nth-of-type(4n-3) { left: 2% }
+ img:nth-of-type(4n-2) { left: 27% }
+ img:nth-of-type(4n-1) { left: 52% }
+ img:nth-of-type(4n-0) { left: 77% }
+ \endcode
+
+ Alternately, keywords \c{odd} and \c{even} correspond to \c{2n-1} and \c{2n}
+ expressions. These are useful, for example, when styling table rows with
+ alternating background colors.
+
+ Rows are represented as the number of the element within the series, plus a
+ fixed number. Each selector redefines the previous selector's upper range
+ of values:
+
+ \code
+ img:nth-of-type(n) { top: 5% }
+ img:nth-of-type(n+5) { top: 20% }
+ img:nth-of-type(n+9) { top: 35% }
+ img:nth-of-type(n+13) { top: 50% }
+ img:nth-of-type(n+17) { top: 65% }
+ img:nth-of-type(n+21) { top: 80% }
+ \endcode
+
+ Level 3 CSS defines the following positional selectors:
+
+ \list
+ \o \c{:first-child}, \c{:last-child}, and \c{:only-child} refer to the first
+ or last child element within a series, or when it is the only one.
+
+ \o \c{:first-of-type}, \c{:last-of-type}, and \c{:only-of-type} refer to the
+ first or last specified element within a series, or when it is the only one.
+
+ \o \c{:nth-first-child()} and \c{:nth-last-child()} refer to the specified
+ child element positioned from the start or end of the series.
+
+ \o \c{:nth-first-of-type()} and \c{:nth-last-of-type()} refer to the
+ specified element positioned from the start or end of the series.
+
+ \o \c{:nth-of-type()} refers to any series of specified elements.
+
+ \o \c{:nth-child()} refers to any series of child elements.
+
+ \endlist
+
+ \section2 Other Selectors
+
+ Level 3 CSS specifies several other potentially useful dynamic
+ classes that can be added to selectors:
+
+ \list
+
+ \o \c{:empty} refers to an element that contains no child elements,
+ including text nodes.
+
+ \o \c{:root} is a markup-independent way to refer to elements that are
+ postioned at the root of the document,
+ in most cases the \c{html} tag.
+
+ \o The \c{:not()} dynamic class allows you to narrow a range of
+ selectors.
+ This may be more useful when gathering elements via the Selectors API.
+ For example,
+ the following JavaScript gathers form inputs,
+ but not including submit buttons:
+
+ \code
+ var inputs = document.querySelectorAll("input:not([type=submit])");
+ \endcode
+
+ \endlist
+
+\section1 Visual Effects
+
+QtWebKit supports numerous Level 3 CSS visual features. This section briefly
+demonstrates how many of these recently available visual features may be used to
+refine mobile web designs.
+
+These more advanced CSS3 effects tend to be available only on the latest
+generation of mobile browsers. Still, it is safe to use them, even if the design
+degrades somewhat for devices that don't support them. When a browser
+encounters CSS properties or values it can't interpret, it simply ignores them.
+Designers can respond by providing fallback options to allow for \e{graceful
+degradation}. For example, the following CSS specifies a plain gray background
+in case the browser does not support gradients:
+
+\code
+background: #aaaaaa;
+background: -webkit-gradient(linear, center top, center bottom,
+ from(#777777), color-stop(50%,#dddddd), to(#777777) );
+\endcode
+
+Note that many of the CSS properties discussed in this section were implemented
+relatively recently, and vendors of browser rendering engines (such as WebKit)
+may still be in the process of testing and standardizing their behavior. These
+property names feature \e{vendor prefixes} such as \c{-webkit-} for WebKit,
+\c{-moz-} for Mozilla, and \c{-o-} for Opera.
+
+It may be possible to extend CSS properties to these various browsers by
+providing vendor-specific syntax. The following example shows how to extend the
+\c{border-image} property to the Opera browser or Mozilla-based Fennec or the
+Maemo Browser for Nokia N900. It also shows the property's final name following
+the process of standardization:
+
+\code
+-webkit-border-image : url(img/border-frame.gif) 10 stretch stretch;
+-moz-border-image : url(img/border-frame.gif) 10 stretch stretch;
+-o-border-image : url(img/border-frame.gif) 10 stretch stretch;
+border-image : url(img/border-frame.gif) 10 stretch stretch;
+\endcode
+
+In some cases, there are slight variations in the syntax each vendor expects as
+property values.
+
+ \section2 Specifying Color and Opacity
+
+ Prior to CSS3, there were three options when specifying color values: named
+ colors, hexadecimal color values, or RGB values. CSS3 provides additional
+ ways to specify colors:
+
+ \list
+ \o \e{HSL}. Colors defined with the HSL model specify the \e{hue} as a
+ radial or degree coordinate, then its \e{saturation} and \e{luminence}
+ as percentages. The following example specifies red and green values:
+
+ \code
+ background: hsl(0 , 100%, 60%);
+ background: hsl(128, 75% , 33%);
+ \endcode
+
+ \o \e{HSLA}.
+ Same as HSL,
+ but specifying an additional decimal \e{alpha} value that
+ corresponds to opacity.
+ The following specifies a fully opaque red,
+ followed by a partial transparency:
+
+ \code
+ background: hsla(0, 100%, 60%, 1.0);
+ background: hsla(0, 100%, 60%, 0.5);
+ \endcode
+
+ \o \e{RGBA}.
+ Same as RGB,
+ but specifying an additional decimal \e{alpha} value that
+ corresponds to opacity.
+ The following the same transition from opaque to transparent as shown
+ above:
+
+ \code
+ background: rgba(100%, 0%, 0%, 1.0);
+ background: rgba(100%, 0%, 0%, 0.5);
+ \endcode
+ \endlist
+
+ With the addition of opacity to color definitions, you can now also specify
+ \c{transparent} as a color name. Note that while RGBA and HSLA options are
+ now available, you can still use the familiar \c{opacity} property
+ independently of color definitions.
+
+ \section2 Rounded Corners
+
+ In addition to removing harsh edges, rounded corners often help distinguish
+ active items from static background elements. Rounded corners are
+ implemented using the \c{border-radius} property. The following rounds off
+ an edge to the same extent that interior elements are offset:
+
+ \code
+ .rounded {
+ border-radius : 1em;
+ padding : 1em;
+ }
+ \endcode
+
+ The following example demonstrates how rounded corners can enhance a mobile
+ design, by marking the start and end of large regions of content, such as a
+ list of links:
+
+ \l{layout_link-fmt}{\inlineimage webkit-guide/scr_layout_link-fmt.png
+ }
+
+ \l{layout_link-fmt_css}{(CSS)}
+
+ The greater the measurement applied to an element's \c{border-radius}, the
+ more dramatically rounded are its corners. For example, applying a
+ \c{border-radius} that is half an element's overall dimensions results in a
+ circle:
+
+ \code
+ .circle {
+ width : 4em;
+ height : 4em;
+ border-radius : 2em;
+ }
+ \endcode
+
+ You can also set each corner individually, and specify a pair of values to
+ achieve oval-shaped borders:
+
+ \code
+ border-top-left-radius : 2em/1em;
+ \endcode
+
+ \section2 Border Images
+
+ Border images allow you to apply customized marquee effects, as in the
+ following example:
+
+ \l{css3_border-img}{\inlineimage webkit-guide/scr_css3_border-img.png
+ }
+
+ \l{css3_border-img_css}{(CSS)}
+
+ In this case, the image stretches to fit an element's dimensions:
+
+ \code
+ -webkit-border-image : url(img/border-frame.gif) 10 stretch stretch;
+ \endcode
+
+ As is true of the \c{border} property, a single numeric argument specifies
+ the width of the border as a whole, or up to four values to modify the width
+ of each side.
+
+ Any border image you specify substitutes some or all of an element's normal
+ border. The \c{border-image} and \c{border-corner-image} each collectively
+ represent four more specific properties.
+
+ For \c{border-image}, these properties are:
+
+ \list
+ \o \c{border-top-image}
+ \o \c{border-right-image}
+ \o \c{border-bottom-image}
+ \o \c{border-left-image}
+ \endlist
+
+ For \c{border-corner-image}, these properties are:
+ \list
+ \o \c{border-top-left-image}
+ \o \c{border-top-right-image}
+ \o \c{border-bottom-right-image}
+ \o \c{border-bottom-left-image}
+ \endlist
+
+ The \c{border-image} property specifies a single image for all four edge
+ borders. The \c{border-corner-image} property specifies an image for all
+ four corner borders. To specify images individually for any of the edge or
+ corner borders, use any of the eight individual properties.
+
+ When specifying any border edge or corner image values:
+
+ \list
+ \o A \c{stretch} value stretches one image to fill the element border area,
+ as shown in the example above.
+
+ \o A \c{repeat} value repeats one image until it fills the element border
+ area and clips any overflow, for example:
+
+ \code
+ -webkit-border-image : url(img/border-frame.gif) 10 repeat repeat;
+ \endcode
+
+ In this case the first \c{repeat} applies to top and bottom edge borders,
+ and the second applies to left and right edge borders.
+ \endlist
+
+ \section2 Backgrounds
+
+ CSS3 allows you to specify more than one background image at a time.
+ The following example shows an accordion-style tabbed interface:
+
+ \l{css3_backgrounds}{\inlineimage webkit-guide/scr_css3_backgrounds.png
+ }
+
+ \l{css3_backgrounds_css}{(CSS)}
+ \l{css3_backgrounds_js}{(JavaScript)}
+
+ By default, tabs display a single icon image, but when selected feature an
+ additional gradient background image. The following CSS shows how both icon
+ and background can receive their own series of specifications, affecting
+ their offset or whether each image repeats:
+
+ \code
+ background-image : url(img/select.png) , url(img/gradient.jpg);
+ background-repeat : no-repeat , repeat-x;
+ background-position : 12px 12px , 0 0;
+ \endcode
+
+ In addition, you may set the \c{background-size} property to \c{contain} to
+ scale images to the size of the containing element. (Level 2 CSS allowed
+ only specific measurements or percentages of the image's size.)
+
+ \section2 Text Shadow and Stroke
+
+ Shadows can be applied to text. As the following example shows, text shadows
+ may interfere with the legibility of text, and are seldom appropriate unless
+ they're used for large, sans-serif display headings:
+
+ \l{css3_text-shadow}{\inlineimage webkit-guide/scr_css3_text-shadow.png
+ }
+
+ \l{css3_text-shadow_css}{(CSS)}
+
+ In addition to the shadow's color, the property accepts two measurements to
+ represent its offset from the text, while the third specifies the extent to
+ which the shadow is blurred:
+
+ \code
+ h1,h2,h3,h4 { text-shadow : 0.25em 0.25em 0.25em #aaaaaa; }
+ \endcode
+
+ CSS3 also allows you to apply a different colored fill to characters,
+ suitable mainly for larger display type or subtle animations:
+
+ \l{css3_text-stroke}{\inlineimage webkit-guide/scr_css3_text-stroke.png
+ }
+
+ \l{css3_text-stroke_css}{(CSS)}
+
+ In the following CSS, \c{-webkit-text-fill-color} is synonymous with the
+ standard \c{color} property:
+
+ \code
+ -webkit-text-stroke-color : #000000;
+ -webkit-text-stroke-width : 1px;
+ -webkit-text-fill-color : purple;
+ \endcode
+
+ \section2 Text Overflow
+
+ Web developers are familiar with the \c{overflow} property, which can be
+ used to hide content that exceeds an element's dimensions, or else to make
+ it accessible via scrolling. CSS3 specifies an additional \c{text-overflow}
+ property that allows you to add ellipses as a suffix to any text that
+ overflows the element, to indicate the presence of additional text.
+
+ The following example shows how the \c{text-overflow} property allows you to
+ present user-selectable links to expanded regions of text within a page:
+
+ \l{css3_text-overflow}{\inlineimage webkit-guide/scr_css3_text-overflow.png
+ }
+
+ \l{css3_text-overflow_css}{(CSS)}
+ \l{css3_text-overflow_js}{(JavaScript)}
+
+ Use the \c{text-overflow} property in conjunction with \c{overflow} and
+ \c{white-space}:
+
+ \code
+ text-overflow : ellipsis;
+ overflow : hidden;
+ white-space : nowrap;
+ \endcode
+
+ For \c{text-overflow} to work, the element's \c{white-space} must be set to
+ \c{nowrap}, overriding the default \c{normal} value. This prevents words
+ from wrapping onto another line as is standard behavior outside the \c{pre}
+ tag, and forces text past the right edge of the element.
+
+ (The element's \c{text-overflow} may specify both \c{ellipsis} and
+ \c{ellipsis-word}, the latter of which is not as widely implemented.)
+
+ \section2 Custom Scrollbars
+
+ In general, scrollable elements should be avoided wherever possible within
+ mobile interfaces. Drag gestures already allow users to scroll windows
+ vertically, and narrow mobile screens are not suitable for overly wide
+ content.
+
+ In cases where content can only be viewed within a scrolling window,
+ scrollbars can be reformatted to make them more accessible to mobile users.
+ The following example presents a block of code within a touch-enabled mobile
+ interface:
+
+ \l{css3_scroll}{\inlineimage webkit-guide/scr_css3_scroll.png
+ }
+
+ \l{css3_scroll_css}{(CSS)}
+
+ This interface uses standard scrollbars, but their appearance is enhanced
+ using low-level \e{pseudo-element} CSS classes that refer to individual
+ components within the scrollbar.
+
+ Simply by invoking the following CSS selector, you disable scrollbars'
+ default appearance:
+
+ \code
+ pre::-webkit-scrollbar { height : 3em }
+ \endcode
+
+ In this case, the specified property increases the scrollbar's default
+ \c{height} to make it easier for mobile users to tap it with their fingers.
+
+ Each additional scrollbar component must then be explicitly defined,
+ otherwise it does not render. The following CSS provides custom styling for
+ the horizontal panning buttons:
+
+ \code
+ ::-webkit-scrollbar-button:increment {
+ background-image : url(img/arrow_right.png);
+ background-size : contain;
+ background-repeat : no-repeat;
+ width : 3em;
+ height : 3em;
+ }
+ ::-webkit-scrollbar-button:decrement {
+ background-image : url(img/arrow_left.png);
+ background-size : contain;
+ background-repeat : no-repeat;
+ width : 3em;
+ height : 3em;
+ }
+ \endcode
+
+ In this case, the scrollbar region between the two navigation icons is still
+ active, but not obviously so since its visual formatting has been
+ overridden. The simpler set of controls is far more suitable for a mobile
+ interface.
+
+ Webkit provides pseudo-elements for the following components:
+
+ \list
+ \o \c{scrollbar} refers to scrollbar as a whole. Additional dynamic classes
+ can be appended to specify \c{:vertical} and \c{:horizontal} scrollbars. The
+ \c{:corner-present} dynamic class activates when both scrollbars are
+ present.
+
+ \o \c{scrollbar-button} refers to incremental navigation buttons. Each
+ button can be styled separately with \c{:increment} and \c{:decrement}
+ dynamic classes.
+
+ \o \c{scrollbar-thumb} refers to the scrollbar's slider control.
+
+ \o \c{scrollbar-track} refers to the active navigation region between
+ buttons.
+
+ \o \c{scrollbar-track-piece} refers to each portion of the track on either
+ side of the thumb control. These can be styled separately using \c{:start}
+ and \c{:end} dynamic classes.
+
+ \o \c{scrollbar-corner} refers to the corner where scrollbar tracks meet.
+ The \c{resizer} pseudo-element also refers to this corner, but for resizable
+ elements such as \c{textarea}.
+
+ \o The \c{:double-button} and \c{:single-button} dynamic classes refer to
+ whether incrementor and decrementors are paired together redundantly at each
+ end of the track, while \c{:no-button} refers to whether they display at
+ all.
+ \endlist
+
+ \bold{See Also:}
+ \l{http://webkit.org/blog/363/styling-scrollbars/}{Surfin' Safari:
+ Styling Scrollbars}
+
+ \section2 Gradients
+
+ Gradients provide a graduated shading effect that can add subtle texture to
+ background elements, and can provide buttons a three-dimensional, beveled
+ appearance. Explicit support for gradients means there's no longer a need to
+ implement them as repeating background images.
+
+ Specify gradients using CSS properties such as the following:
+
+ \code
+ background: #aaaaaa;
+ background: -webkit-gradient(linear, center top, center bottom,
+ from(#dddddd), to(#777777) );
+ \endcode
+
+ Note the pair of \c{background} statements. The first specifies a monochrome
+ fallback color for browsers that do not support gradients.
+
+ The function specifies a simple \c{linear} gradient from the top to the
+ bottom of the element, shifting from a light to a darker gray.
+
+ The following example shows how this gradient can be applied to a background
+ element:
+
+ \l{css3_gradientBack}{\inlineimage webkit-guide/scr_css3_gradientBack.png
+ }
+
+ \l{css3_gradientBack_css}{(CSS)}
+
+ Gradients cannot be applied to the \c{body} element. Instead, they are here
+ applied to an element that covers the background.
+
+ You can specify more than one gradient for the same element. The following
+ shifts from a dark to a light gray halfway down the element, then back to
+ dark:
+
+ \code
+ background: -webkit-gradient(linear, center top, center bottom,
+ from(#777777), color-stop(50%, #dddddd), to(#777777) );
+ \endcode
+
+ Here is how the additional \c{color-stop} appears when applied to the same
+ background element:
+
+ \l{css3_gradientBackStop}{\inlineimage webkit-guide/scr_css3_gradientBackStop.png
+ }
+
+ \l{css3_gradientBackStop_css}{(CSS)}
+
+ Gradients can also provide a textured, three-dimensional appearance for
+ buttons. In the following example, the gradient is inverted and darkened
+ when each button is pressed:
+
+ \l{css3_gradientButton}{\inlineimage webkit-guide/scr_css3_gradientButton.png
+ }
+
+ \l{css3_gradientButton_css}{(CSS)}
+
+ In addition to linear gradients, CSS3 also specifies \bold{radial} gradients
+ that emanate from a single point. The following example demonstrates a
+ colorful radial gradient used to mark where users touch the screen:
+
+ \l{css3_grad-radial}{\inlineimage webkit-guide/scr_css3_grad-radial.png
+ }
+
+ \l{css3_grad-radial_css}{(CSS)}
+ \l{css3_grad-radial_js}{(JavaScript)}
+
+ The syntax is slightly different than for linear gradients. The first two
+ comma-separated arguments after the \c{radial} statement specify the
+ coordinates of the inner circle, and its radius. The next two arguments
+ specify the coordinates and radius of the outer circle:
+
+ \code
+ background: -webkit-gradient(radial, 90 120, 5, 100 130, 48,
+ from(#777777), color-stop(50%, #dddddd), to(#777777) );
+ \endcode
+
+ The use of \c{from}, \c{to} values and \c{color-stop} in radial gradients
+ are the same as for linear gradients.
+
+ \section2 Reflections
+
+ Reflections offer a mirror-like effect which, in the following example, adds
+ a sense of weight to headings and images:
+
+ \l{css3_reflect}{\inlineimage webkit-guide/scr_css3_reflect.png
+ }
+
+ \l{css3_reflect_css}{(CSS)}
+
+ The property's syntax specifies the edge of the element at which to reflect,
+ the offset, and an overlay color. In this case, the color is a gradient,
+ which causes the reflection to gradually fade:
+
+ \code
+ -webkit-box-reflect : below -0.25em -webkit-gradient(linear, center
+ top, center bottom, from(transparent), color-stop(0.25,
+ transparent), to(black));
+ \endcode
+
+ \section2 Masks
+
+ Masks offer a way to modify an image by overlaying either another image, or
+ a gradient. The following example shows a series of thumbnail images that
+ appear faded at their bottom edge until selected:
+
+ \l{css3_mask-grad}{\inlineimage webkit-guide/scr_css3_mask-grad.png
+ }
+
+ \l{css3_mask-grad_css}{(CSS)}
+ \l{css3_mask-grad_js}{(JavaScript)}
+
+ The gradient's opacity shifts from \c 1 to \c 0, an effect that translates
+ to the image:
+
+ \code
+ -webkit-mask-box-image : -webkit-gradient(linear, left top, left
+ bottom, from(rgba(0, 0, 0, 1)), to(rgba(0, 0, 0, 0)));
+ \endcode
+
+ The following example demonstrates an image used as a mask to frame another
+ image:
+
+ \l{css3_mask-img}{\inlineimage webkit-guide/scr_css3_mask-img.png
+ }
+
+ \l{css3_mask-img_css}{(CSS)}
+
+ Separately, the component images look like these:
+
+ \inlineimage webkit-guide/mask0.png
+ \inlineimage webkit-guide/mask1.png
+
+
+ The syntax is the same for border images, and allows you to stretch one
+ image over the other:
+
+ \code
+ -webkit-mask-box-image : url(img/mask.png) 5% stretch;
+ \endcode
+
+\section1 Dynamic CSS
+
+Animations help enhance touch-based mobile interfaces in many ways. They help
+ease transitions from one display state to another that might otherwise appear
+jarring. They help provide a sense of navigational orientation. They also often
+simulate tactile feedback as users' touches result in a tangible visual effect.
+Overall, they add a sense of vibrancy that increases users' engagement with the
+content on display.
+
+Support by QtWebKit for HTML5 allows you to choose from among several flavors of
+web-based animation: Canvas, SVG, and Level 3 CSS. Web developers may also be
+familiar with lower-level JavaScript-based animation techniques, which form the
+basis of many popular JavaScript libraries such as jQuery and Prototype. This
+section focuses on CSS-based animations, since they are more appropriate to
+integrate throughout a web design, without the additional overhead JavaScript
+libraries require. Like Adobe Flash, SVG and Canvas offer more specialized,
+low-level graphics frameworks whose animation features are more appropriate for
+generating standalone effects.
+
+This section demonstrates animation techniques by offering a series of examples
+that apply to common mobile design tasks. While some of these tasks are
+addressed by existing JavaScript frameworks such as jQuery and Prototype, the
+examples provided here illustrate some CSS-only alternatives.
+
+ \section2 CSS Animation Concepts
+
+ Level 3 CSS introduces three distinct concepts that are relevant when
+ crafting dynamic effects, which are discussed in the following sections:
+
+ \list
+ \o \e{Transforms} offer a series of manipulations to screen elements. By
+ themselves, transforms present only static visual effects, but they become
+ especially useful as part of dynamic transitions and animations. Simple
+ transforms are two-dimensional, with three-dimensional transforms gaining
+ gradual support.
+
+ \o \e{Transitions} entail a graduated shift from one explicit display
+ state to another. Transitional shifts apply to any CSS property that
+ specifies numeric or color values.
+
+ \o \e{Animations} offer more complex sequences of transitions that can
+ specify many intermediate display states. Unlike simple transitions,
+ animations can also be initiated more freely.
+ \endlist
+
+ \section2 2D Transforms
+
+ Transforms allow you to freely displace box elements from where they would
+ ordinarily appear. Several transform functions are available, allowing you
+ to \e{scale}, \e{rotate}, \e{skew}, or \e{translate} (move) objects.
+
+ The \c{translate} function moves an element from its default location, and
+ accepts \c{x} and \c{y} measurements as arguments. The following moves an
+ element off the right edge of the screen:
+
+ \code
+ -webkit-transform: translate(120%, 0);
+ \endcode
+
+ Alternately, \c{translateX} and \c{translateY} functions allow you to
+ specify each axis independently. This moves the element off the top of the
+ screen:
+
+ \code
+ -webkit-transform: translateX(0.0) translateY(-120%);
+ \endcode
+
+ Scale transforms allow you enlarge or shrink an element, with the scale
+ expressed as a decimal. By itself, \c{scale} modifies height and width
+ proportionately, but the alternative \c{scaleX} and \c{scaleY} functions
+ allow you to constrain scaling to a single axis.
+
+ The following animation demonstrates a \c{translate} function, which moves
+ the element from off the screen, followed by series of \c{scale},
+ \c{scaleX}, and \c{scaleY} functions:
+
+ \l{anim_demo-scale}{\inlineimage webkit-guide/scr_anim_demo-scale.png
+ }
+
+ \l{anim_demo-scale_css}{(CSS)}
+
+ By default, transforms originate from the center of the element, but you can
+ specify any edge using the \c{-webkit-transform-origin} property. The
+ following reduces an element to 75% of its original size, while keeping it
+ at its original bottom edge:
+
+ \code
+ -webkit-transform : scale(0.75);
+ -webkit-transform-origin : bottom;
+ \endcode
+
+ The following example uses this scale transform to shrink icons that are
+ assigned to in-line links, with icons aligning to the text's baseline:
+
+ \l{layout_link-fmt}{\inlineimage webkit-guide/scr_layout_link-fmt.png
+ }
+
+ \l{layout_link-fmt_css}{(CSS)}
+
+ The \c{rotate} function accepts degree or radian arguments, with negative
+ arguments specifying counter-clockwise motion. The following animation
+ demonstrates two rotations: the first clockwise around the element's center
+ point, and the second counter-clockwise around the top left corner:
+
+ \l{anim_demo-rotate}{\inlineimage webkit-guide/scr_anim_demo-rotate.png
+ }
+
+ \l{anim_demo-rotate_css}{(CSS)}
+
+ The \c{skew} function also accepts positive or negative degree arguments,
+ specifying the extent to which to modify the bottom left corner's 90-degree
+ angle. The \c{skew} and \c{skewX} functions shift the element horizontally,
+ but the alternative \c{skewY} function shifts the element vertically. The
+ following animation demonstrates a \c{skewX} followed by a \c{skewY}:
+
+ \l{anim_demo-skew}{\inlineimage webkit-guide/scr_anim_demo-skew.png
+ }
+
+ \l{anim_demo-skew_css}{(CSS)}
+
+ In the following example, a variety of transforms make a set of three
+ navigational tab icons appear to be part of a cube:
+
+ \l{anim_tabbedSkew}{\inlineimage webkit-guide/scr_anim_tabbedSkew.png
+ }
+
+ \l{anim_tabbedSkew_css}{(CSS)}
+
+ The example also implements the tab icons as internal links that activate
+ display of content using the \c{:target} dynamic class. See the
+ \l{Navigational Selectors} section for more information.
+
+ Note that transforms can include any combination of the functions described
+ above:
+
+ \code
+ nav > a:nth-of-type(3) {
+ background-image : url(img/S_google.jpg);
+ -webkit-transform : rotate(-60deg) skew(-30deg) translate(1.7em, 0em);
+ }
+ \endcode
+
+ \section2 Transitions
+
+ Transitions allow you to gradually shift from one defined CSS state to
+ another. Any CSS property expressed as a numeric or color value (including a
+ color name or hex value) can be transitioned between two style sheets.
+ Properties such as \c{display} that have discrete sets of named values, such
+ as the \c{display} property's \c{block} or \c{none} values, cannot be
+ transitioned. In cases where named values translate internally to numeric
+ values, such as the \c{border-width} property's \c{thin} and \c{thick}
+ values, they can be transitioned.
+
+ The following example shows a series of transitions from a collapsed icon
+ state to an expanded panel:
+
+ \l{anim_panel}{\inlineimage webkit-guide/scr_anim_panel.png
+ }
+
+ \l{anim_panel_css}{(CSS)}
+ \l{anim_panel_js}{(JavaScript)}
+
+ Each style sheet specifies a different \c{max-width} value, and each
+ accompanying transition, defined separately for each state, allows the value
+ to shift over the course of half of a second:
+
+ \code
+ nav.expanded {
+ max-width : 95%;
+ -webkit-transition : max-width 0.5s ease-in-out;
+ }
+ nav.collapsed {
+ max-width : 10%;
+ -webkit-transition : max-width 0.5s ease-in-out;
+ }
+ \endcode
+
+ That shorthand syntax can be expanded to several different properties:
+
+ \code
+ nav.expanded {
+ max-width : 95%;
+ -webkit-transition-property : max-width;
+ -webkit-transition-duration : 0.5s;
+ -webkit-transition-timing-function : ease-in-out;
+ }
+ nav.collapsed {
+ max-width : 10%;
+ -webkit-transition-property : max-width;
+ -webkit-transition-duration : 0.5s;
+ -webkit-transition-timing-function : ease-in-out;
+ }
+ \endcode
+
+ Available transition functions include \c{linear}, \c{ease-in},
+ \c{ease-out}, \c{ease-in-out} and \c{cubic-bezier}.
+
+ Note that the \c{max-width} properties in both style sheets both use
+ percentages to specify measurements. Transitions may not work properly if
+ you shift from one unit to another.
+
+ The example above specifies an additional set of transitions affecting the
+ icons nested within the navigation panel:
+
+ \code
+ nav.expanded > .option {
+ opacity : 1;
+ -webkit-transform : scale(1.0);
+ -webkit-transition : all 0.5s linear;
+ }
+ nav.collapsed > .option {
+ opacity : 0;
+ -webkit-transform : scale(0.0);
+ -webkit-transition : all 0.5s linear;
+ }
+ \endcode
+
+ The shifting \c{scale} transform makes icons appear to zoom in to fill the
+ space, while \c{opacity} makes them fade in. Specifying \c{all} as the
+ transition property applies to any valid property that differs between the
+ two states.
+
+ These nested transitions execute at the same time as those assigned to the
+ parent \c{nav} element. The combined effect appears to be a single
+ transition.
+
+ \section2 Transitional Sequences
+
+ The prior example showed a single transition, but transitions can also be
+ run in sequence to form more complex animations. The following example
+ demonstrates an embedded navigation panel that, when pressed, expands
+ horizontally, then vertically to reveal numerous navigation options:
+
+ \l{anim_accord}{\inlineimage webkit-guide/scr_anim_accord.png
+ }
+
+ \l{anim_accord_css}{(CSS)}
+ \l{anim_accord_js}{(JavaScript)}
+
+ The style sheets specify separate, comma-separated transitions for \c{width}
+ and \c{height} properties:
+
+ \code
+ #accordion.expanded {
+ width: 80%;
+ height: 90%;
+ -webkit-transition:
+ width 0.5s ease-in-out 0.0s,
+ height 0.5s ease-in-out 0.5s
+ ;
+ }
+ #accordion.collapsed {
+ width: 10%;
+ height: 7%;
+ -webkit-transition:
+ height 0.5s ease-in-out 0.0s,
+ width 0.5s ease-in-out 0.5s
+ ;
+ }
+ \endcode
+
+ Each transition's additional time measurement specifies a delay. The
+ long-form syntax may make this clearer:
+
+ \code
+ #accordion.expanded {
+ width: 80%;
+ height: 90%;
+ -webkit-transition-property : width , height;
+ -webkit-transition-duration : 0.5s , 0.5s;
+ -webkit-transition-timing-function : ease-in-out , ease-in-out;
+ -webkit-transition-delay : 0.0s , 0.5s;
+ }
+ #accordion.collapsed {
+ width : 10%;
+ height : 7%;
+ -webkit-transition-property : height , width;
+ -webkit-transition-duration : 0.5s , 0.5s;
+ -webkit-transition-timing-function : ease-in-out , ease-in-out;
+ -webkit-transition-delay : 0.0s , 0.5s;
+ }
+ \endcode
+
+ The shift to the \c{expanded} state involves two transitions, each of which
+ lasts half a second and relies on the same \c{ease-in-out} function. The
+ first takes place immediately and affects the \c{width} property. The
+ second, affecting the \c{height} property, takes place after a delay that
+ matches the first transition's duration. The reverse transition is much the
+ same, only the \c{height} property transitions before the \c{width} to
+ reverse the effect.
+
+ In addition to the navigation element's sequence of transitions, nested
+ accordion-style animations activate when users expand top-level headings.
+ Subheadings are revealed using a \c{scaleY} transform, which makes them
+ appear as if they are flipping upwards.
+
+ The following example shows a photo gallery interface that uses the same
+ techniques. (Size the window to emulate a smaller mobile screen.)
+
+ \l{anim_gallery}{\inlineimage webkit-guide/scr_anim_gallery.png
+ }
+
+ \l{anim_gallery_css}{(CSS)}
+ \l{anim_gallery_js}{(JavaScript)}
+
+ The main interface uses simple transitions affecting \c{opacity}, along with
+ \c{scale} and \c{translate} transforms, which combined make queued images
+ appear dimmer, smaller, and horizontally offset from the main image.
+
+ A separate sequence of transitions activates when users tap selected images.
+ The first transition uses a \c{scaleX} transform to flip the image towards
+ the center. The second then flips out a panel featuring details on the
+ photo. When users navigate away to adjacent photos, the panel automatically
+ flips back to its original state as it is moved to the side.
+
+ Another example shows an interface featuring a simple list of items:
+
+ \l{anim_skew}{\inlineimage webkit-guide/scr_anim_skew.png
+ }
+
+ \l{anim_skew_css}{(CSS)}
+ \l{anim_skew_js}{(JavaScript)}
+
+ When dismissed, items are wiped off the screen using a \c{skew} transform
+ that provides the illusion of speed. Remaining items move upwards to fill
+ the space vacated by items that have been removed.
+
+ This example uses the same technique of sequential transitions. The first
+ transition applies to the combined \c{translate}/\c{skew} transform. The
+ second, delayed transition modifies the \c{top} property to align remaining
+ items to a grid.
+
+ Note that for items to reposition themselves in this example, a vertical
+ grid must be explicitly specified. You can only apply transitions between
+ properties you explicitly define and activate, not between values the
+ browser assigns internally to automatically position elements relative to
+ each other.
+
+ \section2 Keyframe Animations
+
+ The previous section showed how you can chain sequences of transitions to
+ produce complex effects. Animations also allow you to define many
+ intermediary interface states, but using a far simpler syntax, and not
+ assigned to transitions between CSS states.
+
+ The following example shows a simple animation of icons that pulse when
+ selected:
+
+ \l{anim_pulse}{\inlineimage webkit-guide/scr_anim_pulse.png
+ }
+
+ \l{anim_pulse_css}{(CSS)}
+
+ It uses the following CSS, shown here in both abbreviated and long form:
+
+ \code
+ nav > a:target { -webkit-animation : pulse 1s infinite; }
+
+ nav > a:target {
+ -webkit-animation-name : pulse;
+ -webkit-animation-duration : 1s;
+ -webkit-animation-iteration-count : infinite;
+ }
+ \endcode
+
+ You supply a \c{name} for the animation that corresponds to a
+ \c{keyframes} rule defined separately within your CSS:
+
+ \code
+ @-webkit-keyframes pulse {
+ 0% { opacity : 1.0 }
+ 50% { opacity : 0.7 }
+ }
+ \endcode
+
+ Percentages mark new animation states within the course of the animation,
+ and behave much like CSS selectors. In this case, the animation shifts
+ between two separate states over the course of a second: opaque and slightly
+ dimmed. With its \c{iteration-count} set to \c{infinite} rather than a set
+ number, the animation only stops when the link is no longer selected.
+
+ The following example demonstrates a popular mobile design pattern
+ implemented with CSS. Navigation to nested subheads appears to wipe to the
+ right, while navigating upwards in the hierarchy appears to wipe to the
+ left:
+
+ \l{anim_slide1}{\inlineimage webkit-guide/scr_anim_slide1.png
+ }
+
+ \l{anim_slide_css}{(CSS)}
+
+ It relies on keyframes rules such as the following, which define a simple
+ start and end state:
+
+ \code
+ @-webkit-keyframes slide_in {
+ from {
+ left : 80%;
+ right : -80%;
+ }
+ to {
+ left : 0em;
+ right : 0em;
+ }
+ }
+ \endcode
+
+ Unlike a transition, the animation is triggered immediately when the page
+ loads, but only if the target of navigation is an anchor whose ID is
+ \c{in} or \c{out}. If you navigate to the page itself, no animation
+ occurs.
+
+ The following example uses a keyframe animation to scroll through banner
+ options at the top of the screen:
+
+ \l{css3_multicol}{\inlineimage webkit-guide/scr_css3_multicol.png
+ }
+
+ \l{css3_multicol_css}{(CSS)}
+
+ The animation defines a set of rapid shifts alternating with long static
+ phases. It modifies the left offset of an element that is five times the
+ width of the window.
+
+ \code
+ @-webkit-keyframes banner_scroll {
+ 0% { left : 0%; }
+ 18% { left : 0%; }
+ 20% { left : -100%; }
+ 38% { left : -100%; }
+ 40% { left : -200%; }
+ 58% { left : -200%; }
+ 60% { left : -300%; }
+ 78% { left : -300%; }
+ 80% { left : -400%; }
+ 95% { left : -400%; }
+ 100% { left : 0%; }
+ }
+ \endcode
+
+ Finally, the demonstrations of \l{anim_demo-rotate}{rotate},
+ \l{anim_demo-scale}{scale}, and \l{anim_demo-skew}{skew} 2D transforms that
+ opened this section all rely on separate keyframe animations to slide in and
+ manipulate a series of panels. Separate \c{-webkit-animation-delay} settings
+ for each panel control the sequence of each presentation.
+
+
+\list
+\o \l{QtWebKit Guide} -back to the main page
+\endlist
+*/
+
+/*!
+\example webkit/webkit-guide
+\title QtWebKit Guide Files
+This is a listing of \l{QtWebKit Guide} code.
+\note The links to the HTML5 code is found within the guide.
+*/
+
diff --git a/doc/src/webkit/guide/guidelinks.qdoc b/doc/src/webkit/guide/guidelinks.qdoc
new file mode 100644
index 0000000..b4f7f98
--- /dev/null
+++ b/doc/src/webkit/guide/guidelinks.qdoc
@@ -0,0 +1,488 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+\externalpage webkit-guide/storage.htm
+\title ex_storage
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-storage-css.html
+\title storage_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-js-storage-js.html
+\title storage_js
+*/
+
+/*!
+\externalpage webkit-guide/anim_accord.htm
+\title anim_accord
+*/
+
+/*!
+\externalpage webkit-guide/anim_demo-rotate.htm
+\title anim_demo-rotate
+*/
+
+/*!
+\externalpage webkit-guide/anim_demo-scale.htm
+\title anim_demo-scale
+*/
+
+/*!
+\externalpage webkit-guide/anim_demo-skew.htm
+\title anim_demo-skew
+*/
+
+/*!
+\externalpage webkit-guide/anim_gallery.htm
+\title anim_gallery
+*/
+
+/*!
+\externalpage webkit-guide/anim_panel.htm
+\title anim_panel
+*/
+
+/*!
+\externalpage webkit-guide/anim_pulse.htm
+\title anim_pulse
+*/
+
+/*!
+\externalpage webkit-guide/anim_skew.htm
+\title anim_skew
+*/
+
+/*!
+\externalpage webkit-guide/anim_slide1.htm
+\title anim_slide1
+*/
+
+/*!
+\externalpage webkit-guide/anim_tabbedSkew.htm
+\title anim_tabbedSkew
+*/
+
+/*!
+\externalpage webkit-guide/css3_backgrounds.htm
+\title css3_backgrounds
+*/
+
+/*!
+\externalpage webkit-guide/css3_border-img.htm
+\title css3_border-img
+*/
+
+/*!
+\externalpage webkit-guide/css3_grad-radial.htm
+\title css3_grad-radial
+*/
+
+/*!
+\externalpage webkit-guide/css3_gradientBack.htm
+\title css3_gradientBack
+*/
+
+/*!
+\externalpage webkit-guide/css3_gradientBackStop.htm
+\title css3_gradientBackStop
+*/
+
+/*!
+\externalpage webkit-guide/css3_gradientButton.htm
+\title css3_gradientButton
+*/
+
+/*!
+\externalpage webkit-guide/css3_mask-grad.htm
+\title css3_mask-grad
+*/
+
+/*!
+\externalpage webkit-guide/css3_mask-img.htm
+\title css3_mask-img
+*/
+
+/*!
+\externalpage webkit-guide/css3_multicol.htm
+\title css3_multicol
+*/
+
+/*!
+\externalpage webkit-guide/css3_reflect.htm
+\title css3_reflect
+*/
+
+/*!
+\externalpage webkit-guide/css3_scroll.htm
+\title css3_scroll
+*/
+
+/*!
+\externalpage webkit-guide/css3_sel-nth.htm
+\title css3_sel-nth
+*/
+
+/*!
+\externalpage webkit-guide/css3_text-overflow.htm
+\title css3_text-overflow
+*/
+
+/*!
+\externalpage webkit-guide/css3_text-shadow.htm
+\title css3_text-shadow
+*/
+
+/*!
+\externalpage webkit-guide/css3_text-stroke.htm
+\title css3_text-stroke
+*/
+
+/*!
+\externalpage webkit-guide/form_tapper.htm
+\title form_tapper
+*/
+
+/*!
+\externalpage webkit-guide/form_toggler.htm
+\title form_toggler
+*/
+
+/*!
+\externalpage webkit-guide/layout_link-fmt.htm
+\title layout_link-fmt
+*/
+
+/*!
+\externalpage webkit-guide/layout_tbl-keyhole.htm
+\title layout_tbl-keyhole
+*/
+
+/*!
+\externalpage webkit-guide/mob_condjs.htm
+\title mob_condjs
+*/
+
+/*!
+\externalpage webkit-guide/mob_layout.htm
+\title mob_layout
+*/
+
+/*!
+\externalpage webkit-guide/mob_mediaquery.htm
+\title mob_mediaquery
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-anim-accord-css.html
+\title anim_accord_css
+*/
+
+/*!
+\externalpage wwebkit-webkit-guide-js-anim-accord-js.html
+\title anim_accord_js
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-anim-demo-rotate-css.html
+\title anim_demo-rotate_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-anim-demo-scale-css.html
+\title anim_demo-scale_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-anim-demo-skew-css.html
+\title anim_demo-skew_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-anim-gallery-css.html
+\title anim_gallery_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-js-anim-gallery-js.html
+\title anim_gallery_js
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-anim-panel-css.html
+\title anim_panel_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-js-anim-panel-js.html
+\title anim_panel_js
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-anim-pulse-css.html
+\title anim_pulse_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-anim-skew-css.html
+\title anim_skew_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-js-anim-skew-js.html
+\title anim_skew_js
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-anim-slide-css.html
+\title anim_slide_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-anim-tabbedskew-css.html
+\title anim_tabbedSkew_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-form-tapper-css.html
+\title form_tapper_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-form-toggler-css.html
+\title form_toggler_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-layout-link-fmt-css.html
+\title layout_link-fmt_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-layout-tbl-keyhole-css.html
+\title layout_tbl-keyhole_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-css3-backgrounds-css.html
+\title css3_backgrounds_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-js-css3-backgrounds-js.html
+\title css3_backgrounds_js
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-css3-border-img-css.html
+\title css3_border-img_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-css3-grad-radial-css.html
+\title css3_grad-radial_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-js-css3-grad-radial-js.html
+\title css3_grad-radial_js
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-css3-gradientback-css.html
+\title css3_gradientBack_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-css3-gradientbackstop-css.html
+\title css3_gradientBackStop_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-css3-gradientbutton-css.html
+\title css3_gradientButton_css
+*/
+
+/*!
+\externalpage webkit-guide/css/webkit-webkit-guide-css-css3-mask-grad-css.html
+\title css3_mask-grad_css
+*/
+
+/*!
+\externalpage webkit-guide/js/webkit-webkit-guide-js-css3-mask-grad-js.html
+\title css3_mask-grad_js
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-css3-mask-img-css.html
+\title css3_mask-img_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-css3-multicol-css.html
+\title css3_multicol_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-css3-reflect-css.html
+\title css3_reflect_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-css3-scroll-css.html
+\title css3_scroll_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-css3-sel-nth-css.html
+\title css3_sel-nth_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-css3-text-overflow-css.html
+\title css3_text-overflow_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-js-css3-text-overflow-js.html
+\title css3_text-overflow_js
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-css3-text-shadow-css.html
+\title css3_text-shadow_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-css3-text-stroke-css.html
+\title css3_text-stroke_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-mob-condjs-css.html
+\title mob_condjs_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-js-mob-condjs-js.html
+\title mob_condjs_js
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-mqlayout-desktop-css.html
+\title mqlayout_desktop_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-mqlayout-touch-css.html
+\title mqlayout_touch_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-mqlayout-mobile-css.html
+\title mqlayout_mobile_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-mq-desktop-css.html
+\title mq_desktop_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-mq-touch-css.html
+\title mq_touch_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-mq-mobile-css.html
+\title mq_mobile_css
+*/
+
+/*!
+\externalpage webkit-webkit-guide-css-mob-mediaquery-css.html
+\title mob_mediaquery_css
+*/
+
+/*!
+\externalpage http://deviceatlas.com/
+\title DeviceAtlas
+*/
+
+/*!
+\externalpage http://wurfl.sourceforge.net/
+\title WURFL
+*/
+
+/*!
+\externalpage http://www.w3.org/TR/selectors-api/
+\title Selectors API
+*/
+
+/*!
+\externalpage http://dev.w3.org/html5/webstorage/
+\title HTML5 Web Storage
+*/
+
+/*!
+\externalpage http://html5doctor.com/introducing-web-sql-databases
+\title HTML5 Doctor: Introducing Web SQL Databases
+*/
+
+/*!
+\externalpage http://dev.w3.org/html5/canvas-api/canvas-2d-api.html
+\title HTML5 Canvas API
+*/
+
+/*!
+\externalpage http://www.w3schools.com/css/css_colors.asp
+\title CSS Color Value
+*/
+
+/*!
+\externalpage http://www.w3.org/TR/2003/CR-css3-color-20030514/#numerical
+\title CSS3 Color Module specification
+*/
+
+/*!
+\externalpage http://www.canvasdemos.com/2009/10/09/html-5-canvas-animation
+\title CanvasDemos.com: animated cartoon
+*/
diff --git a/doc/src/webkit/webkit.qdoc b/doc/src/webkit/webkit.qdoc
new file mode 100644
index 0000000..759a7f7
--- /dev/null
+++ b/doc/src/webkit/webkit.qdoc
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+\page qtwebkit-guide.html
+
+\title QtWebKit Guide
+
+\section1 Introduction to QtWebKit
+
+Qt WebKit is a web content rendering engine based on the open source
+WebKit project, featuring broad support for standard web technologies.
+QtWebKit is developed as a part of the WebKit community,
+which enables every new release of Qt WebKit
+to include the latest developments from the WebKit project.
+
+Qt SDK 1.1 supports the following Qt WebKit releases:
+
+\list
+\o QtWebKit 2.1 for Symbian^3 when using Qt 4.7.
+\o QtWebKit 2.0, as a standard part of Qt 4.7,
+for all other platforms when using Qt 4.7.
+\o When using Qt 4.6,
+the QtWebKit version of Qt 4.6 is used on all platforms.
+\endlist
+
+\section1 QtWebKit 2.1 for Web Developers
+
+The highlights of the QtWebKit 2.1 release for web developers
+are listed below.
+Please note that HTML5 and CSS3 features are based on draft
+specifications that are subject to change.
+
+\list
+\o HTML5 progress and meter elements
+\o HTML5 canvas element
+\o Web SQL Database
+\o Web Storage
+\o CSS Animations
+\o CSS Transitions
+\o CSS 2D Transforms
+\o CSS Text
+\o CSS Masks
+\o CSS Scrollbar Styles
+\o Native JSON parser
+\endlist
+
+\section1 Qt WebKit Module
+
+Information regarding the classes and API introduced in the Qt WebKit module
+are found in the \l{WebKit in Qt} page.
+
+\section1 Mobile HTML5 Developer's Guide for QtWebKit (BETA)
+
+This is a beta release of a guide for mobile web development with
+QtWebKit 2.1. It discusses how to use several standard web
+technologies to create mobile applications with QtWebKit.
+
+Contents:
+\list
+\o \l{QtWebKit Guide - Level 3 CSS}{Level 3 CSS: media queries, selectors, visual
+effects, transforms, transitions, and animations}
+\o \l{Canvas Graphics}{HTML5 canvas element}
+\o \l{QtWebKit Guide - Client Storage}{Client Storage}
+\endlist
+*/
+
diff --git a/examples/declarative/positioners/addandremove/Button.qml b/examples/declarative/positioners/Button.qml
index 25907c0..25907c0 100644
--- a/examples/declarative/positioners/addandremove/Button.qml
+++ b/examples/declarative/positioners/Button.qml
diff --git a/examples/declarative/positioners/addandremove/add.png b/examples/declarative/positioners/add.png
index 1ee4542..1ee4542 100644
--- a/examples/declarative/positioners/addandremove/add.png
+++ b/examples/declarative/positioners/add.png
Binary files differ
diff --git a/examples/declarative/positioners/addandremove/del.png b/examples/declarative/positioners/del.png
index 8d2eaed..8d2eaed 100644
--- a/examples/declarative/positioners/addandremove/del.png
+++ b/examples/declarative/positioners/del.png
Binary files differ
diff --git a/examples/declarative/positioners/layoutdirection/layoutdirection.qml b/examples/declarative/positioners/layoutdirection/layoutdirection.qml
deleted file mode 100644
index 3e23b15..0000000
--- a/examples/declarative/positioners/layoutdirection/layoutdirection.qml
+++ /dev/null
@@ -1,151 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 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:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 1.1
-
-Rectangle {
-
- width: column.width + 100
- height: column.height + 100
- property int direction: Qt.application.layoutDirection
-
- Column {
- id: column
- spacing: 10
- anchors.centerIn: parent
- width: 230
-
- Text {
- text: "Row"
- anchors.horizontalCenter: parent.horizontalCenter
- }
- Row {
- layoutDirection: direction
- spacing: 10
- move: Transition {
- NumberAnimation {
- properties: "x"
- }
- }
- Repeater {
- model: 4
- Loader {
- property int value: index
- sourceComponent: delegate
- }
- }
- }
- Text {
- text: "Grid"
- anchors.horizontalCenter: parent.horizontalCenter
- }
- Grid {
- layoutDirection: direction
- spacing: 10; columns: 4
- move: Transition {
- NumberAnimation {
- properties: "x"
- }
- }
- Repeater {
- model: 11
- Loader {
- property int value: index
- sourceComponent: delegate
- }
- }
- }
- Text {
- text: "Flow"
- anchors.horizontalCenter: parent.horizontalCenter
- }
- Flow {
- layoutDirection: direction
- spacing: 10; width: parent.width
- move: Transition {
- NumberAnimation {
- properties: "x"
- }
- }
- Repeater {
- model: 10
- Loader {
- property int value: index
- sourceComponent: delegate
- }
- }
- }
- Rectangle {
- height: 50; width: parent.width
- color: mouseArea.pressed ? "black" : "gray"
- Text {
- text: direction ? "Right to left" : "Left to right"
- color: "white"
- font.pixelSize: 16
- anchors.centerIn: parent
- }
- MouseArea {
- id: mouseArea
- onClicked: {
- if (direction == Qt.LeftToRight) {
- direction = Qt.RightToLeft;
- } else {
- direction = Qt.LeftToRight;
- }
- }
- anchors.fill: parent
- }
- }
- }
-
- Component {
- id: delegate
- Rectangle {
- width: 50; height: 50
- color: Qt.rgba(0.8/(parent.value+1),0.8/(parent.value+1),0.8/(parent.value+1),1.0)
- Text {
- text: parent.parent.value+1
- color: "white"
- font.pixelSize: 20
- anchors.centerIn: parent
- }
- }
- }
-}
diff --git a/examples/declarative/positioners/addandremove/addandremove.qml b/examples/declarative/positioners/positioners.qml
index 7d6d8fe..7d6d8fe 100644
--- a/examples/declarative/positioners/addandremove/addandremove.qml
+++ b/examples/declarative/positioners/positioners.qml
diff --git a/examples/declarative/positioners/layoutdirection/layoutdirection.qmlproject b/examples/declarative/positioners/positioners.qmlproject
index e526217..e526217 100644
--- a/examples/declarative/positioners/layoutdirection/layoutdirection.qmlproject
+++ b/examples/declarative/positioners/positioners.qmlproject
diff --git a/examples/declarative/righttoleft/layoutdirection/layoutdirection.qml b/examples/declarative/righttoleft/layoutdirection/layoutdirection.qml
new file mode 100644
index 0000000..b4efebe
--- /dev/null
+++ b/examples/declarative/righttoleft/layoutdirection/layoutdirection.qml
@@ -0,0 +1,246 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 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:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.1
+
+Rectangle {
+ id: root
+ property bool mirror
+ property int direction: Qt.application.layoutDirection
+ LayoutMirroring.enabled: mirror
+ LayoutMirroring.childrenInherit: true
+ width: column.width + 80
+ height: column.height + 40
+ Column {
+ id: column
+ width: 190
+ spacing: 10
+ anchors.centerIn: parent
+
+ Text {
+ text: "Row"
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+
+ Row {
+ layoutDirection: root.direction
+ spacing: 10
+ move: Transition {
+ NumberAnimation {
+ properties: "x"
+ }
+ }
+ Repeater {
+ model: 4
+ Loader {
+ property int value: index
+ sourceComponent: positionerDelegate
+ }
+ }
+ }
+
+ Text {
+ text: "Grid"
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+
+ Grid {
+ layoutDirection: root.direction
+ spacing: 10; columns: 4
+ move: Transition {
+ NumberAnimation {
+ properties: "x"
+ }
+ }
+ Repeater {
+ model: 11
+ Loader {
+ property int value: index
+ sourceComponent: positionerDelegate
+ }
+ }
+ }
+
+ Text {
+ text: "Flow"
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+
+ Flow {
+ layoutDirection: root.direction
+ spacing: 10; width: parent.width
+ move: Transition {
+ NumberAnimation {
+ properties: "x"
+ }
+ }
+ Repeater {
+ model: 10
+ Loader {
+ property int value: index
+ sourceComponent: positionerDelegate
+ }
+ }
+ }
+
+ Text {
+ text: "ListView"
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+
+ ListView {
+ id: listView
+ clip: true
+ width: parent.width; height: 40
+ layoutDirection: root.direction
+ orientation: Qt.Horizontal
+ model: 48
+ delegate: viewDelegate
+ }
+
+ Text {
+ text: "GridView"
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+
+ GridView {
+ clip: true
+ width: 200; height: 160
+ cellWidth: 50; cellHeight: 50
+ layoutDirection: root.direction
+ model: 48
+ delegate: viewDelegate
+ }
+
+ Rectangle {
+ height: 50; width: parent.width
+ color: mouseArea.pressed ? "black" : "gray"
+ Column {
+ anchors.centerIn: parent
+ Text {
+ text: root.direction ? "Right to left" : "Left to right"
+ color: "white"
+ font.pixelSize: 16
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Text {
+ text: "(click here to toggle)"
+ color: "white"
+ font.pixelSize: 10
+ font.italic: true
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: {
+ if (root.direction == Qt.LeftToRight) {
+ root.direction = Qt.RightToLeft;
+ } else {
+ root.direction = Qt.LeftToRight;
+ }
+ }
+ }
+ }
+
+ Rectangle {
+ height: 50; width: parent.width
+ color: mouseArea2.pressed ? "black" : "gray"
+ Column {
+ anchors.centerIn: parent
+ Text {
+ text: root.mirror ? "Mirrored" : "Not mirrored"
+ color: "white"
+ font.pixelSize: 16
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Text {
+ text: "(click here to toggle)"
+ color: "white"
+ font.pixelSize: 10
+ font.italic: true
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+ MouseArea {
+ id: mouseArea2
+ anchors.fill: parent
+ onClicked: {
+ root.mirror = !root.mirror;
+ }
+ }
+ }
+ }
+
+ Component {
+ id: positionerDelegate
+ Rectangle {
+ width: 40; height: 40
+ color: Qt.rgba(0.8/(parent.value+1),0.8/(parent.value+1),0.8/(parent.value+1),1.0)
+ Text {
+ text: parent.parent.value+1
+ color: "white"
+ font.pixelSize: 18
+ anchors.centerIn: parent
+ }
+ }
+ }
+ Component {
+ id: viewDelegate
+ Item {
+ width: (listView.effectiveLayoutDirection == Qt.LeftToRight ? (index == 48 - 1) : (index == 0)) ? 40 : 50
+ Rectangle {
+ width: 40; height: 40
+ color: Qt.rgba(0.5+(48 - index)*Math.random()/48,
+ 0.3+index*Math.random()/48,
+ 0.3*Math.random(),
+ 1.0)
+ Text {
+ text: index+1
+ color: "white"
+ font.pixelSize: 18
+ anchors.centerIn: parent
+ }
+ }
+ }
+ }
+}
+
diff --git a/examples/declarative/positioners/addandremove/addandremove.qmlproject b/examples/declarative/righttoleft/layoutdirection/layoutdirection.qmlproject
index e526217..e526217 100644
--- a/examples/declarative/positioners/addandremove/addandremove.qmlproject
+++ b/examples/declarative/righttoleft/layoutdirection/layoutdirection.qmlproject
diff --git a/examples/declarative/righttoleft/layoutmirroring/layoutmirroring.qml b/examples/declarative/righttoleft/layoutmirroring/layoutmirroring.qml
new file mode 100644
index 0000000..0d1b871
--- /dev/null
+++ b/examples/declarative/righttoleft/layoutmirroring/layoutmirroring.qml
@@ -0,0 +1,313 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 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:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.1
+
+Rectangle {
+ id: root
+ property bool mirror: Qt.application.layoutDirection == Qt.RightToLeft
+ LayoutMirroring.enabled: mirror
+ LayoutMirroring.childrenInherit: true
+ width: 400
+ height: 875
+ color: "lightsteelblue"
+
+ Column {
+ spacing: 10
+ anchors { left: parent.left; right: parent.right; top: parent.top; margins: 10 }
+
+ Text {
+ text: "Positioners"
+ anchors.left: parent.left
+ }
+
+ Column {
+ id: positioners
+ spacing: 5
+ anchors.left: parent.left
+ Row {
+ id: row
+ spacing: 4
+ property string text: "THISISROW"
+ anchors.left: parent.left
+ Repeater {
+ model: parent.text.length
+ delegate: positionerDelegate
+ }
+ }
+ Flow {
+ id: flow
+ spacing: 4
+ width: 90
+ property string text: "THISISFLOW"
+ anchors.left: parent.left
+ Repeater {
+ model: parent.text.length
+ delegate: positionerDelegate
+ }
+ }
+ Grid {
+ id: grid
+ spacing: 4
+ columns: 6
+ property string text: "THISISGRID"
+ anchors.left: parent.left
+ Repeater {
+ model: parent.text.length
+ delegate: positionerDelegate
+ }
+ }
+ Component {
+ id: positionerDelegate
+ Text {
+ color: "white"
+ font.pixelSize: 20
+ text: parent.text[index]
+ Rectangle {
+ z: -1
+ opacity: 0.7
+ color: "black"
+ anchors.fill: parent
+ }
+ }
+ }
+ }
+
+ Text {
+ text: "Text alignment"
+ anchors.left: parent.left
+ }
+
+ Rectangle {
+ id: textStrings
+ width: 148
+ height: 85
+ color: "white"
+ anchors.left: parent.left
+ Column {
+ spacing: 5
+ width: parent.width
+ anchors { fill: parent; margins: 5 }
+ Text {
+ id: englishText
+ width: parent.width
+ text: "English text"
+ }
+ Text {
+ id: arabicText
+ width: parent.width
+ text: "النص العربي"
+ }
+ Text {
+ id: leftAlignedText
+ width: parent.width
+ text: "Text aligned to left"
+ horizontalAlignment: Text.AlignLeft
+ }
+ Text {
+ id: rightAlignedText
+ width: parent.width
+ text: "Text aligned to right"
+ horizontalAlignment: Text.AlignRight
+ }
+ }
+ }
+
+ Text {
+ text: "Model views"
+ anchors.left: parent.left
+ }
+
+ Column {
+ id: views
+ spacing: 10
+ anchors.left: parent.left
+ ListView {
+ id: listView
+ z: -1
+ clip: true
+ model: text.length
+ width: 360; height: 45
+ orientation: Qt.Horizontal
+ property string text: "LISTVIEWLISTVIEWLISTVIEWLISTVIEWLISTVIEWLISTVIEW"
+ delegate: Rectangle {
+ color: "black"
+ width: 45; height: 45
+ Rectangle {
+ anchors { fill: parent; margins: 1 }
+ color: "red"
+ }
+ Text {
+ text: listView.text[index]
+ font.pixelSize: 30
+ anchors.centerIn: parent
+ }
+ }
+ }
+ GridView {
+ id: gridView
+ z: -1
+ clip: true
+ model: text.length
+ width: 180; height: 90
+ cellWidth: 45; cellHeight: 45
+ property string text: "GRIDVIEWGRIDVIEWGRIDVIEWGRIDVIEWGRIDVIEWGRIDVIEW"
+ anchors.left: parent.left
+ delegate: Rectangle {
+ color: "black"
+ width: 45; height: 45
+ Rectangle {
+ anchors { fill: parent; margins: 1 }
+ color: "red"
+ }
+ Text {
+ anchors.centerIn: parent
+ font.pixelSize: 30
+ text: gridView.text[index]
+ }
+ }
+ }
+ }
+
+ Text {
+ text: "Item x"
+ anchors.left: parent.left
+ }
+ Rectangle {
+ id: items
+ color: Qt.rgba(0.2, 0.2, 0.2, 0.6)
+ width: 275; height: 95
+ anchors.left: parent.left
+ Rectangle {
+ y: 5; x: 5
+ width: 130; height: 40
+ Text {
+ text: "Item with x: 5\n(not mirrored)"
+ anchors.centerIn: parent
+ }
+ }
+ Rectangle {
+ color: Qt.rgba(0.7, 0.7, 0.7)
+ y: 50; x: mirror(5)
+ width: 130; height: 40
+ function mirror(value) {
+ return LayoutMirroring.enabled ? (parent.width - width - value) : value;
+ }
+ Text {
+ text: "Item with x: " + parent.x + "\n(manually mirrored)"
+ anchors.centerIn: parent
+ }
+ }
+ }
+ Text {
+ text: "Item anchors"
+ anchors.left: parent.left
+ }
+
+ Rectangle {
+ id: anchoredItems
+ color: Qt.rgba(0.2, 0.2, 0.2, 0.6)
+ width: 270; height: 170
+ anchors.left: parent.left
+ Rectangle {
+ id: blackRectangle
+ color: "black"
+ width: 180; height: 90
+ anchors { horizontalCenter: parent.horizontalCenter; horizontalCenterOffset: 30 }
+ Text {
+ text: "Horizontal center anchored\nwith offset 30\nto the horizontal center\nof the parent."
+ color: "white"
+ anchors.centerIn: parent
+ }
+ }
+ Rectangle {
+ id: whiteRectangle
+ color: "white"
+ width: 120; height: 70
+ anchors { left: parent.left; bottom: parent.bottom }
+ Text {
+ text: "Left side anchored\nto the left side\nof the parent."
+ color: "black"
+ anchors.centerIn: parent
+ }
+ }
+ Rectangle {
+ id: grayRectangle
+ color: Qt.rgba(0.7, 0.7, 0.7)
+ width: 140; height: 90
+ anchors { right: parent.right; bottom: parent.bottom }
+ Text {
+ text: "Right side anchored\nto the right side\nof the parent."
+ anchors.centerIn: parent
+ }
+ }
+ }
+ Rectangle {
+ id: mirrorButton
+ color: mouseArea2.pressed ? "black" : "gray"
+ height: 50; width: parent.width
+ anchors.left: parent.left
+ Column {
+ anchors.centerIn: parent
+ Text {
+ text: root.mirror ? "Mirrored" : "Not mirrored"
+ color: "white"
+ font.pixelSize: 16
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Text {
+ text: "(click here to toggle)"
+ color: "white"
+ font.pixelSize: 10
+ font.italic: true
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+ MouseArea {
+ id: mouseArea2
+ anchors.fill: parent
+ onClicked: {
+ root.mirror = !root.mirror;
+ }
+ }
+ }
+ }
+}
+
diff --git a/examples/declarative/righttoleft/layoutmirroring/layoutmirroring.qmlproject b/examples/declarative/righttoleft/layoutmirroring/layoutmirroring.qmlproject
new file mode 100644
index 0000000..e526217
--- /dev/null
+++ b/examples/declarative/righttoleft/layoutmirroring/layoutmirroring.qmlproject
@@ -0,0 +1,18 @@
+/* File generated by QtCreator */
+
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/righttoleft/textalignment/textalignment.qml b/examples/declarative/righttoleft/textalignment/textalignment.qml
new file mode 100644
index 0000000..4c40c3c
--- /dev/null
+++ b/examples/declarative/righttoleft/textalignment/textalignment.qml
@@ -0,0 +1,426 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 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:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.1
+
+Rectangle {
+ id: root
+ color: "white"
+ width: containerColumn.width
+ height: containerColumn.height + containerColumn.anchors.topMargin
+
+ property bool mirror: false
+ property variant horizontalAlignment: undefined
+
+ property variant editorType: ["Plain Text", "Styled Text", "Plain Rich Text", "Italic Rich Text", "Plain TextEdit", "Italic TextEdit", "TextInput"]
+ property variant text: ["", " ", "Hello world!", "مرحبا العالم!", "Hello world! Hello!\nHello world! Hello!", "مرحبا العالم! مرحبا! مرحبا العالم! مرحبا!" ,"مرحبا العالم! مرحبا! مرحبا Hello world!\nالعالم! مرحبا!"]
+ property variant description: ["empty text", "white-space-only text", "left-to-right text", "right-to-left text", "multi-line left-to-right text", "multi-line right-to-left text", "multi-line bidi text"]
+ property variant textComponents: [plainTextComponent, styledTextComponent, richTextComponent, italicRichTextComponent, plainTextEdit, italicTextEdit, textInput]
+
+ function shortText(horizontalAlignment) {
+
+ // all the different QML editors have
+ // the same alignment values
+ switch (horizontalAlignment) {
+ case Text.AlignLeft:
+ return "L";
+ case Text.AlignRight:
+ return "R";
+ case Text.AlignHCenter:
+ return "C";
+ case Text.AlignJustify:
+ return "J";
+ default:
+ return "Error";
+ }
+ }
+ Column {
+ id: containerColumn
+ spacing: 10
+ width: editorTypeRow.width
+ anchors { top: parent.top; topMargin: 5 }
+ Row {
+ id: editorTypeRow
+ Repeater {
+ model: editorType.length
+ Item {
+ width: editorColumn.width
+ height: editorColumn.height
+ Column {
+ id: editorColumn
+ spacing: 5
+ width: textColumn.width+10
+ Text {
+ text: root.editorType[index]
+ font.pixelSize: 16
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Column {
+ id: textColumn
+ spacing: 5
+ anchors.horizontalCenter: parent.horizontalCenter
+ Repeater {
+ model: textComponents.length
+ delegate: textComponents[index]
+ }
+ }
+ }
+ }
+ }
+ }
+ Column {
+ spacing: 2
+ width: parent.width
+ Rectangle {
+ // button
+ height: 50; width: parent.width
+ color: mouseArea.pressed ? "black" : "lightgray"
+ Column {
+ anchors.centerIn: parent
+ Text {
+ text: root.mirror ? "Mirrored" : "Not mirrored"
+ color: "white"
+ font.pixelSize: 16
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Text {
+ text: "(click here to toggle)"
+ color: "white"
+ font.pixelSize: 10
+ font.italic: true
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+ MouseArea {
+ id: mouseArea
+ property int index: 0
+ anchors.fill: parent
+ onClicked: root.mirror = !root.mirror
+ }
+ }
+ Rectangle {
+ // button
+ height: 50; width: parent.width
+ color: mouseArea2.pressed ? "black" : "gray"
+ Column {
+ anchors.centerIn: parent
+ Text {
+ text: {
+ if (root.horizontalAlignment == undefined)
+ return "Implict alignment";
+ switch (root.horizontalAlignment) {
+ case Text.AlignLeft:
+ return "Left alignment";
+ case Text.AlignRight:
+ return "Right alignment";
+ case Text.AlignHCenter:
+ return "Center alignment";
+ case Text.AlignJustify:
+ return "Justify alignment";
+ }
+ }
+ color: "white"
+ font.pixelSize: 16
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Text {
+ text: "(click here to toggle)"
+ color: "white"
+ font.pixelSize: 10
+ font.italic: true
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+ MouseArea {
+ id: mouseArea2
+ property int index: 0
+ anchors.fill: parent
+ onClicked: {
+ if (index < 0) {
+ root.horizontalAlignment = undefined;
+ } else {
+ root.horizontalAlignment = Math.pow(2, index);
+ }
+ index = (index + 2) % 5 - 1;
+ }
+ }
+ }
+ }
+ }
+
+ Component {
+ id: plainTextComponent
+ Text {
+ width: 180
+ text: root.text[index]
+ font.pixelSize: 24
+ wrapMode: Text.WordWrap
+ horizontalAlignment: root.horizontalAlignment
+ LayoutMirroring.enabled: root.mirror
+ textFormat: Text.RichText
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.8, 0.2, 0.2, 0.3)
+ anchors.fill: parent
+ }
+ Text {
+ text: root.description[index]
+ color: Qt.rgba(1,1,1,1.0)
+ anchors.centerIn: parent
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.3, 0, 0, 0.3)
+ anchors { fill: parent; margins: -3 }
+ }
+ }
+ Text {
+ color: "white"
+ text: shortText(parent.horizontalAlignment)
+ anchors { top: parent.top; right: parent.right; margins: 2 }
+ }
+ }
+ }
+
+ Component {
+ id: styledTextComponent
+ Text {
+ width: 180
+ text: root.text[index]
+ font.pixelSize: 24
+ wrapMode: Text.WordWrap
+ horizontalAlignment: root.horizontalAlignment
+ LayoutMirroring.enabled: root.mirror
+ textFormat: Text.RichText
+ style: Text.Sunken
+ styleColor: "white"
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.8, 0.2, 0.2, 0.3)
+ anchors.fill: parent
+ }
+ Text {
+ text: root.description[index]
+ color: Qt.rgba(1,1,1,1.0)
+ anchors.centerIn: parent
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.3, 0, 0, 0.3)
+ anchors { fill: parent; margins: -3 }
+ }
+ }
+ Text {
+ color: "white"
+ text: shortText(parent.horizontalAlignment)
+ anchors { top: parent.top; right: parent.right; margins: 2 }
+ }
+ }
+ }
+
+ Component {
+ id: richTextComponent
+ Text {
+ width: 180
+ text: root.text[index]
+ font.pixelSize: 24
+ wrapMode: Text.WordWrap
+ horizontalAlignment: root.horizontalAlignment
+ LayoutMirroring.enabled: root.mirror
+ textFormat: Text.RichText
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.8, 0.2, 0.2, 0.3)
+ anchors.fill: parent
+ }
+ Text {
+ text: root.description[index]
+ color: Qt.rgba(1,1,1,1.0)
+ anchors.centerIn: parent
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.3, 0, 0, 0.3)
+ anchors { fill: parent; margins: -3 }
+ }
+ }
+ Text {
+ color: "white"
+ text: shortText(parent.horizontalAlignment)
+ anchors { top: parent.top; right: parent.right; margins: 2 }
+ }
+ }
+ }
+
+ Component {
+ id: italicRichTextComponent
+ Text {
+ width: 180
+ text: "<i>" + root.text[index] + "</i>"
+ font.pixelSize: 24
+ wrapMode: Text.WordWrap
+ horizontalAlignment: root.horizontalAlignment
+ LayoutMirroring.enabled: root.mirror
+ textFormat: Text.RichText
+ property variant backgroundColor: Qt.rgba(0.8, 0.2, 0.2, 0.3)
+ Rectangle {
+ z: -1
+ color: parent.backgroundColor
+ anchors.fill: parent
+ }
+ Text {
+ text: root.description[index]
+ color: Qt.rgba(1,1,1,1.0)
+ anchors.centerIn: parent
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.3, 0, 0, 0.3)
+ anchors { fill: parent; margins: -3 }
+ }
+ }
+ Text {
+ color: "white"
+ text: shortText(parent.horizontalAlignment)
+ anchors { top: parent.top; right: parent.right; margins: 2 }
+ }
+ }
+ }
+
+ Component {
+ id: plainTextEdit
+ TextEdit {
+ width: 180
+ text: root.text[index]
+ font.pixelSize: 24
+ cursorVisible: true
+ wrapMode: TextEdit.WordWrap
+ horizontalAlignment: root.horizontalAlignment
+ LayoutMirroring.enabled: root.mirror
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.5, 0.5, 0.2, 0.3)
+ anchors.fill: parent
+ }
+ Text {
+ text: root.description[index]
+ color: Qt.rgba(1,1,1,1.0)
+ anchors.centerIn: parent
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.3, 0, 0, 0.3)
+ anchors { fill: parent; margins: -3 }
+ }
+ }
+ Text {
+ color: "white"
+ text: shortText(parent.horizontalAlignment)
+ anchors { top: parent.top; right: parent.right; margins: 2 }
+ }
+ }
+ }
+
+ Component {
+ id: italicTextEdit
+ TextEdit {
+ width: 180
+ text: "<i>" + root.text[index] + "<i>"
+ font.pixelSize: 24
+ cursorVisible: true
+ wrapMode: TextEdit.WordWrap
+ horizontalAlignment: root.horizontalAlignment
+ LayoutMirroring.enabled: root.mirror
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.5, 0.5, 0.2, 0.3)
+ anchors.fill: parent
+ }
+ Text {
+ text: root.description[index]
+ color: Qt.rgba(1,1,1,1.0)
+ anchors.centerIn: parent
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.3, 0, 0, 0.3)
+ anchors { fill: parent; margins: -3 }
+ }
+ }
+ Text {
+ color: "white"
+ text: shortText(parent.horizontalAlignment)
+ anchors { top: parent.top; right: parent.right; margins: 2 }
+ }
+ }
+ }
+
+ Component {
+ id: textInput
+ Item {
+ width: 180
+ height: textInput.text.length > 20 ? 3*textInput.height : textInput.height
+ TextInput {
+ id: textInput
+ width: 180
+ text: root.text[index]
+ font.pixelSize: 24
+ cursorVisible: true
+ horizontalAlignment: root.horizontalAlignment
+ LayoutMirroring.enabled: root.mirror
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.6, 0.4, 0.2, 0.3)
+ anchors.fill: parent
+ }
+ Text {
+ text: root.description[index]
+ color: Qt.rgba(1,1,1,1.0)
+ anchors.centerIn: parent
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.3, 0, 0, 0.3)
+ anchors { fill: parent; margins: -3 }
+ }
+ }
+ Text {
+ color: "white"
+ text: shortText(parent.horizontalAlignment)
+ anchors { top: parent.top; right: parent.right; margins: 2 }
+ }
+ }
+ }
+ }
+}
+
diff --git a/examples/declarative/righttoleft/textalignment/textalignment.qmlproject b/examples/declarative/righttoleft/textalignment/textalignment.qmlproject
new file mode 100644
index 0000000..e526217
--- /dev/null
+++ b/examples/declarative/righttoleft/textalignment/textalignment.qmlproject
@@ -0,0 +1,18 @@
+/* File generated by QtCreator */
+
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/touchinteraction/pincharea/flickresize.qml b/examples/declarative/touchinteraction/pincharea/flickresize.qml
index a2f81ff..9439ace 100644
--- a/examples/declarative/touchinteraction/pincharea/flickresize.qml
+++ b/examples/declarative/touchinteraction/pincharea/flickresize.qml
@@ -54,14 +54,21 @@ Rectangle {
PinchArea {
width: Math.max(flick.contentWidth, flick.width)
height: Math.max(flick.contentHeight, flick.height)
+
+ property real initialWidth
+ property real initialHeight
+ onPinchStarted: {
+ initialWidth = flick.contentWidth
+ initialHeight = flick.contentHeight
+ }
+
onPinchUpdated: {
// adjust content pos due to drag
flick.contentX += pinch.previousCenter.x - pinch.center.x
flick.contentY += pinch.previousCenter.y - pinch.center.y
// resize content
- var scale = 1.0 + pinch.scale - pinch.previousScale
- flick.resizeContent(flick.contentWidth * scale, flick.contentHeight * scale, pinch.center)
+ flick.resizeContent(initialWidth * pinch.scale, initialHeight * pinch.scale, pinch.center)
}
onPinchFinished: {
diff --git a/examples/phonon/phonon.pro b/examples/phonon/phonon.pro
index aa6ac13..c6a0bff 100644
--- a/examples/phonon/phonon.pro
+++ b/examples/phonon/phonon.pro
@@ -3,6 +3,9 @@ CONFIG += ordered
SUBDIRS = qmusicplayer \
capabilities
+# Disable capabilities example for symbian-gcce due to a bug in elf2e32.
+symbian-gcce:SUBDIRS -= capabilities
+
# install
target.path = $$[QT_INSTALL_EXAMPLES]/phonon
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS phonon.pro README
diff --git a/examples/webkit/webkit-guide/_copyright.txt b/examples/webkit/webkit-guide/_copyright.txt
new file mode 100644
index 0000000..e545ac3
--- /dev/null
+++ b/examples/webkit/webkit-guide/_copyright.txt
@@ -0,0 +1,40 @@
+<!--
+
+This file is part of _PACKAGE_NAME_
+
+Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+\1
diff --git a/examples/webkit/webkit-guide/_image_assets.htm b/examples/webkit/webkit-guide/_image_assets.htm
new file mode 100644
index 0000000..5c3f3a0
--- /dev/null
+++ b/examples/webkit/webkit-guide/_image_assets.htm
@@ -0,0 +1,331 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<title>image assets</title>
+
+<style>
+img { max-height: 72px; }
+</style>
+
+</head>
+<body>
+<h1>image assets</h1>
+
+Notes:
+
+<ul>
+
+<li>Some of these may be redundant; feel free to merge
+
+<li>Feel free to rename files, but give me before & after list of filenames so I can reflect the change
+
+<li>use neutral grayscale if possible
+
+<li>use PNG file format if possible
+
+<li>I plan to cut new set of generic icons
+(e.g., <a href="anim_skew.htm">HERE</a> to be white text on darkish
+gray, probably #777777)
+
+<li>No more need for online/offline indicators (red/green circles) for
+this draft.
+
+</ul>
+
+<table border="1" width="100%">
+
+<tr>
+<th>FILENAME</th>
+<th>IMAGE (thumbnail & link)</th>
+<th>USED ON PAGE</th>
+<th>DESCRIPTION</th>
+</tr>
+
+<tr>
+<td>icon_dismiss.png,<br/>icon_dismiss_x22.png</td>
+<td>
+<a target="elsewhere" href="img/icon_dismiss.png"><img src="img/icon_dismiss.png"/></a>
+<a target="elsewhere" href="img/icon_dismiss_x22.png"><img src="img/icon_dismiss_x22.png"/></a>
+</td>
+<td>
+<a target="elsewhere" href="anim_skew.htm">HERE</a>
+<a target="elsewhere" href="storage.htm">HERE</a>
+<a target="elsewhere" href="css3_text-overflow.htm">HERE</a>
+<a target="elsewhere" href="layout_tbl-keyhole.htm">HERE</a>
+</td>
+<td>Dismiss panel or listed item</td>
+</tr>
+
+<tr>
+<td>icon_expand-nav.png</td>
+<td><a target="elsewhere" href="img/icon_expand-nav.png"><img src="img/icon_expand-nav.png"/></a></td>
+<td><a target="elsewhere" href="anim_accord.htm">HERE</a></td>
+<td>expand complex set of navigation options</td>
+</tr>
+
+<tr>
+<td>icon_nav-up.png</td>
+<td><a target="elsewhere" href="img/icon_nav-up.png"><img src="img/icon_nav-up.png"/></a></td>
+<td><a target="elsewhere" href="layout_tbl-keyhole.htm">HERE</a></td>
+<td>navigate within listings (up arrow also serves as down arrow using rotate transform)</td>
+</tr>
+
+<tr>
+<td>icon_drill-up.png,<br/>icon_drill-up_x32.png</td>
+<td>
+<a target="elsewhere" href="img/icon_drill-up.png"><img src="img/icon_drill-up.png"/></a>
+<a target="elsewhere" href="img/icon_drill-up_x32.png"><img src="img/icon_drill-up_x32.png"/></a>
+</td>
+<td><a target="elsewhere" href="anim_slide1.htm">HERE</a></td>
+<td>navigate up one level within sliding drilldown UI</td>
+</tr>
+
+<tr>
+<td>icon_drill-down.png,<br/>icon_drill-down_x32.png</td>
+<td>
+<a target="elsewhere" href="img/icon_drill-down.png"><img src="img/icon_drill-down.png"/></a>
+<a target="elsewhere" href="img/icon_drill-down_x32.png"><img src="img/icon_drill-down_x32.png"/></a>
+</td>
+<td><a target="elsewhere" href="anim_slide1.htm">HERE</a></td>
+<td>navigate down one level within sliding drilldown UI</td>
+</tr>
+
+<tr>
+<td>icon_scroll-left.png</td>
+<td><a target="elsewhere" href="img/icon_scroll-left.png"><img src="img/icon_scroll-left.png"/></a></td>
+<td><a target="elsewhere" href="css3_scroll.htm">HERE</a></td>
+<td>custom horizontal scroll button</td>
+</tr>
+
+<tr>
+<td>icon_scroll-right.png</td>
+<td><a target="elsewhere" href="img/icon_scroll-right.png"><img src="img/icon_scroll-right.png"/></a></td>
+<td><a target="elsewhere" href="css3_scroll.htm">HERE</a></td>
+<td>custom horizontal scroll button</td>
+</tr>
+
+<tr>
+<td>icon_head-expanded.png,<br/>icon_head-expanded_x13.png</td>
+<td>
+<a target="elsewhere" href="img/icon_head-expanded.png"><img src="img/icon_head-expanded.png"/></a>
+<a target="elsewhere" href="img/icon_head-expanded_x13.png"><img src="img/icon_head-expanded_x13.png"/></a>
+</td>
+<td><a target="elsewhere" href="anim_accord.htm">HERE</a>
+<a target="elsewhere" href="css3_backgrounds.htm">HERE</a></td>
+<td>marks accordion heading expanded state</td>
+</tr>
+
+<tr>
+<td>icon_head-collapsed.png,<br/>icon_head-collapsed_x13.png</td>
+<td>
+<a target="elsewhere" href="img/icon_head-collapsed.png"><img src="img/icon_head-collapsed.png"/></a>
+<a target="elsewhere" href="img/icon_head-collapsed_x13.png"><img src="img/icon_head-collapsed_x13.png"/></a>
+</td>
+<td><a target="elsewhere" href="anim_accord.htm">HERE</a>
+<a target="elsewhere" href="css3_backgrounds.htm">HERE</a></td>
+<td>marks accordion heading collapsed state</td>
+</tr>
+
+<tr>
+<td>icon_info.png,<br/>icon_info_x24.png</td>
+<td>
+<a target="elsewhere" href="img/icon_info.png"><img src="img/icon_info.png"/></a>
+<a target="elsewhere" href="img/icon_info_x24.png"><img src="img/icon_info_x24.png"/></a>
+</td>
+<td><a target="elsewhere" href="storage.htm">HERE</a></td>
+<td>link to panel specifying user preferences</td>
+</tr>
+
+<tr>
+<td>icon_list-all.png,<br/>icon_list-all_circ.png</td>
+<td>
+<a target="elsewhere" href="img/icon_list-all.png"><img src="img/icon_list-all.png"/></a>
+<a target="elsewhere" href="img/icon_list-all_circ.png"><img src="img/icon_list-all_circ.png"/></a>
+</td>
+<td><a target="elsewhere" href="anim_skew.htm">HERE</a></td>
+<td>within UI listing items users can filter by category, this indicates LIST ALL ITEMS</td>
+</tr>
+
+<tr>
+<td>gradient.jpg</td>
+<td><a target="elsewhere" href="img/gradient.jpg"><img src="img/gradient.jpg"/></a></td>
+<td><a target="elsewhere" href="css3_backgrounds.htm">HERE</a></td>
+<td>serves as background for expanded accordion heads (demonstrates CSS's >1 background image feature)</td>
+</tr>
+
+<tr>
+<td>border-frame.png</td>
+<td><a target="elsewhere" href="img/border-frame.png"><img src="img/border-frame.png"/></a></td>
+<td><a target="elsewhere" href="css3_border-img.htm">HERE</a></td>
+<td>border around chunk of text (got this from Wei Lu's sample; simply demo's this feature)</td>
+</tr>
+
+<tr>
+<td>mask.png</td>
+<td><a target="elsewhere" href="img/mask.png"><img src="img/mask.png"/></a></td>
+<td><a target="elsewhere" href="css3_mask-img.htm">HERE</a></td>
+<td>Used as a gradient to mask an image; think I got this one from <a href="http://webkit.org/blog/181/css-masks/">webkit.org</a></td>
+</tr>
+
+<tr>
+<td>icon_check.png,<br/>icon_check_x24green.png</td>
+<td>
+<a target="elsewhere" href="img/icon_check.png"><img src="img/icon_check.png"/></a>
+<a target="elsewhere" href="img/icon_check_x24green.png"><img src="img/icon_check_x24green.png"/></a>
+</td>
+<td><a target="elsewhere" href="form_tapper.htm">HERE</a></td>
+<td>This is not available as a separate file; it's specified within
+CSS using the "data:" URL scheme. It indicates radio/checkbox
+selection state within tappable UI; keep green if possible to match
+border</td>
+</tr>
+
+<tr>
+<th colspan="4">FILE FORMATS</th>
+<tr>
+
+<tr>
+<td>icon_link-sms.png</td>
+<td><a target="elsewhere" href="img/icon_link-sms.png"><img src="img/icon_link-sms.png"/></a></td>
+<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
+<td>provides visual hint marking context of hyperlink, in this case a link to initiate an instant message</td>
+</tr>
+
+<tr>
+<td>icon_link-tel.png</td>
+<td><a target="elsewhere" href="img/icon_link-tel.png"><img src="img/icon_link-tel.png"/></a></td>
+<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
+<td>...link to make phone call</td>
+</tr>
+
+<tr>
+<td>icon_link-xls.png</td>
+<td><a target="elsewhere" href="img/icon_link-xls.png"><img src="img/icon_link-xls.png"/></a></td>
+<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
+<td>...link to excel file</td>
+</tr>
+
+<tr>
+<td>icon_link-doc.png</td>
+<td><a target="elsewhere" href="img/icon_link-doc.png"><img src="img/icon_link-doc.png"/></a></td>
+<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
+<td>...link to MS Word file</td>
+</tr>
+
+<tr>
+<td>icon_link-email.png</td>
+<td><a target="elsewhere" href="img/icon_link-email.png"><img src="img/icon_link-email.png"/></a></td>
+<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
+<td>...email link</td>
+</tr>
+
+<tr>
+<td>icon_link-external.png</td>
+<td><a target="elsewhere" href="img/icon_link-external.png"><img src="img/icon_link-external.png"/></a></td>
+<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
+<td>...link to web page external to current site</td>
+</tr>
+
+<tr>
+<td>icon_link-pdf.png</td>
+<td><a target="elsewhere" href="img/icon_link-pdf.png"><img src="img/icon_link-pdf.png"/></a></td>
+<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
+<td>...loink to PDF file</td>
+</tr>
+
+<tr>
+<td>icon_link-ppt.png</td>
+<td><a target="elsewhere" href="img/icon_link-ppt.png"><img src="img/icon_link-ppt.png"/></a></td>
+<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
+<td>...link to PowerPoint file</td>
+</tr>
+
+<tr>
+<td>icon_link-rss.png</td>
+<td><a target="elsewhere" href="img/icon_link-rss.png"><img src="img/icon_link-rss.png"/></a></td>
+<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
+<td>...link to RSS feed</td>
+</tr>
+
+<tr>
+<th colspan="4">UNUSED</th>
+<tr>
+
+<tr>
+<td>icon_nav-top.png</td>
+<td><a target="elsewhere" href="img/icon_nav-top.png"><img src="img/icon_nav-top.png"/></a></td>
+<td></td>
+<td></td>
+</tr>
+
+<tr>
+<td>icon_nav-start.png</td>
+<td><a target="elsewhere" href="img/icon_nav-start.png"><img src="img/icon_nav-start.png"/></a></td>
+<td></td>
+<td></td>
+</tr>
+
+<tr>
+<td>icon_nav_end.png</td>
+<td><a target="elsewhere" href="img/icon_nav_end.png"><img src="img/icon_nav_end.png"/></a></td>
+<td></td>
+<td></td>
+</tr>
+
+<tr>
+<td>icon_question.png</td>
+<td><a target="elsewhere" href="img/icon_question.png"><img src="img/icon_question.png"/></a></td>
+<td></td>
+<td></td>
+</tr>
+
+<tr>
+<td>icon_trash.png</td>
+<td><a target="elsewhere" href="img/icon_trash.png"><img src="img/icon_trash.png"/></a></td>
+<td></td>
+<td></td>
+</tr>
+
+</table>
+
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/_index.html b/examples/webkit/webkit-guide/_index.html
new file mode 100644
index 0000000..709f951
--- /dev/null
+++ b/examples/webkit/webkit-guide/_index.html
@@ -0,0 +1,322 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<!-- examples.qdoc -->
+ <title>CSS: SAMPLE PAGES</title>
+ <link rel="stylesheet" type="text/css" href="style/style.css" />
+ <script src="scripts/jquery.js" type="text/javascript"></script>
+ <script src="scripts/functions.js" type="text/javascript"></script>
+ <script src="./scripts/superfish.js" type="text/javascript"></script>
+ <link rel="stylesheet" type="text/css" href="style/superfish.css" /> <script src="./scripts/narrow.js" type="text/javascript"></script>
+ <link rel="stylesheet" type="text/css" href="style/narrow.css" />
+</head>
+<body class="" onload="CheckEmptyAndLoadList();">
+
+ <style>
+div.header, div.toolbar, div.feedback, div#feedbackBox, div.footer, div.sidebar { display: none; background: pink }
+div.toc {
+ background: #dddddd;
+ border: thin solid #777777;
+ padding: 1em;
+ border-radius: 1em;
+ margin: 1em
+}
+div.toc li:before { color: lightcoral; text-transform: uppercase; }
+h3 { border-top: thick pink solid }
+h4 { border-top: medium gold solid }
+h5 { border-top: medium lightgreen solid }
+h3,h4,h5 { padding-top: 1em }
+li.level1 { margin-left: 0 }
+li.level2 { margin-left: 2em }
+li.level3 { margin-left: 4em }
+li.level4 { margin-left: 6em }
+li.level5 { margin-left: 8em }
+table { border: solid #777777 thin }
+tr:nth-of-type(even) { background: beige }
+tr:nth-of-type(odd) { background: lightblue }
+th {
+ background: #777777;
+ color: #ffffff;
+}
+
+img[src^='images/cnd_'] { float: right; margin: 1em ; padding: 1em; border-radius: 1em; border: thin #777777 solid; }
+tt, pre { background: #dddddd; border: thin #dddddd solid; }
+a[href^='http://waplabdc.nokia-boston.com'] { color: black; }
+a[href^='http://waplabdc.nokia-boston.com']:before { content: url(http://waplabdc.nokia-boston.com/browser/users/sierra/x/img/html.jpg); }
+ </style>
+ <div class="header" id="qtdocheader">
+ <div class="content">
+ <div id="nav-logo">
+ <a href="index.html">Home</a></div>
+ <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
+ <div id="narrowsearch"></div>
+ <div id="nav-topright">
+ <ul>
+ <li class="nav-topright-home"><a href="http://qt.nokia.com/">Qt HOME</a></li>
+ <li class="nav-topright-dev"><a href="http://developer.qt.nokia.com/">DEV</a></li>
+ <li class="nav-topright-labs"><a href="http://labs.qt.nokia.com/blogs/">LABS</a></li>
+ <li class="nav-topright-doc nav-topright-doc-active"><a href="http://doc.qt.nokia.com/">
+ DOC</a></li>
+ <li class="nav-topright-blog"><a href="http://blog.qt.nokia.com/">BLOG</a></li>
+ </ul>
+ </div>
+ <div id="shortCut">
+ <ul>
+ <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.7</a></span></li>
+ <li class="shortCut-topleft-active"><a href="http://doc.qt.nokia.com">ALL VERSIONS </a></li>
+ </ul>
+ </div>
+ <ul class="sf-menu" id="narrowmenu">
+ <li><a href="#">API Lookup</a>
+ <ul>
+ <li><a href="classes.html">Class index</a></li>
+ <li><a href="functions.html">Function index</a></li>
+ <li><a href="modules.html">Modules</a></li>
+ <li><a href="namespaces.html">Namespaces</a></li>
+ <li><a href="qtglobal.html">Global Declarations</a></li>
+ <li><a href="qdeclarativeelements.html">QML elements</a></li>
+ </ul>
+ </li>
+ <li><a href="#">Qt Topics</a>
+ <ul>
+ <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>
+ <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>
+ <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>
+ <li><a href="developing-with-qt.html">Cross-platform and Platform-specific</a></li>
+ <li><a href="platform-specific.html">Platform-specific info</a></li>
+ <li><a href="technology-apis.html">Qt and Key Technologies</a></li>
+ <li><a href="best-practices.html">How-To's and Best Practices</a></li>
+ </ul>
+ </li>
+ <li><a href="#">Examples</a>
+ <ul>
+ <li><a href="all-examples.html">Examples</a></li>
+ <li><a href="tutorials.html">Tutorials</a></li>
+ <li><a href="demos.html">Demos</a></li>
+ <li><a href="qdeclarativeexamples.html">QML Examples</a></li>
+ </ul>
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="wrapper">
+ <div class="hd">
+ <span></span>
+ </div>
+ <div class="bd group">
+ <div class="sidebar">
+ <div class="searchlabel">
+ Search index:</div>
+ <div class="search" id="sidebarsearch">
+ <form id="qtdocsearch" action="" onsubmit="return false;">
+ <fieldset>
+ <input type="text" name="searchstring" id="pageType" value="" />
+ <div id="resultdialog">
+ <a href="#" id="resultclose">Close</a>
+ <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p>
+ <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p>
+ <ul id="resultlist" class="all">
+ </ul>
+ </div>
+ </fieldset>
+ </form>
+ </div>
+ <div class="box first bottombar" id="lookup">
+ <h2 title="API Lookup"><span></span>
+ API Lookup</h2>
+ <div id="list001" class="list">
+ <ul id="ul001" >
+ <li class="defaultLink"><a href="classes.html">Class index</a></li>
+ <li class="defaultLink"><a href="functions.html">Function index</a></li>
+ <li class="defaultLink"><a href="modules.html">Modules</a></li>
+ <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
+ <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
+ <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
+ </ul>
+ </div>
+ </div>
+ <div class="box bottombar" id="topics">
+ <h2 title="Qt Topics"><span></span>
+ Qt Topics</h2>
+ <div id="list002" class="list">
+ <ul id="ul002" >
+ <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li>
+ <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>
+ <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li>
+ <li class="defaultLink"><a href="developing-with-qt.html">Cross-platform and Platform-specific</a></li>
+ <li class="defaultLink"><a href="platform-specific.html">Platform-specific info</a></li>
+ <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li>
+ <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li>
+ </ul>
+ </div>
+ </div>
+ <div class="box" id="examples">
+ <h2 title="Examples"><span></span>
+ Examples</h2>
+ <div id="list003" class="list">
+ <ul id="ul003">
+ <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
+ <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
+ <li class="defaultLink"><a href="demos.html">Demos</a></li>
+ <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <div class="wrap">
+ <div class="toolbar">
+ <div class="breadcrumb toolblock">
+ <ul>
+ <li class="first"><a href="index.html">Home</a></li>
+ <!-- Bread crumbs goes here -->
+ <li>CSS: SAMPLE PAGES</li> </ul>
+ </div>
+ <div class="toolbuttons toolblock">
+ <ul>
+ <li id="smallA" class="t_button">A</li>
+ <li id="medA" class="t_button active">A</li>
+ <li id="bigA" class="t_button">A</li>
+ <li id="print" class="t_button"><a href="javascript:this.print();">
+ <span>Print</span></a></li>
+ </ul>
+ </div>
+ </div>
+ <div class="content mainContent">
+<div class="toc">
+<h3><a name="toc">Contents</a></h3>
+<ul>
+<li class="level1"><a href="#css-sample-pages">CSS: SAMPLE PAGES</a></li>
+<li class="level2"><a href="#media-queries">Media Queries</a></li>
+<li class="level2"><a href="#selectors">Selectors</a></li>
+<li class="level2"><a href="#visual-effects">Visual Effects</a></li>
+<li class="level2"><a href="#dynamic-css">Dynamic CSS</a></li>
+<li class="level1"><a href="#storage">Storage</a></li>
+</ul>
+</div>
+<h1 class="title">CSS: SAMPLE PAGES</h1>
+<span class="subtitle"></span>
+<!-- $$$examples-description -->
+<div class="descr"> <a name="details"></a>
+<a name="css-sample-pages"></a>
+<h2>CSS: SAMPLE PAGES</h2>
+<a name="media-queries"></a>
+<h3>1. Media Queries</h3>
+<ol type="1">
+<li><a target="test" href="mob_mediaquery.htm">MEDIA-QUERY, BASIC</a>: produces message indicating browser class (desktop/touch/low-end mobile)</li>
+<li><a target="test" href="mob_layout.htm">MEDIA-QUERY, LAYOUT</a>: same, but produces various skeletal layouts using media query criteria; large 3-column layout must appear only on desktop browser</li>
+<li><a target="test" href="mob_condjs.htm">MEDIA-QUERY, STYLEMEDIA</a>: Same as #1, but JS produces corresponding message via StyleMedia API</li>
+</ol>
+<a name="selectors"></a>
+<h3>2. Selectors</h3>
+<ol type="1">
+<li><a target="test" href="layout_link-fmt.htm">SELECTOR, ATTRIBUTE PREFIX/SUFFIX</a>: links appear w/different icons based on URL prefix/suffix; linebreaks should not appear within inline links</li>
+<li><a target="test" href="form_tapper.htm">SELECTOR, FORMS, TAP</a>: radio/checkbox inputs can be tapped (only 1 at a time within 'radio' set; any number within 'checkbox' set)</li>
+<li><a target="test" href="form_toggler.htm">SELECTOR, FORMS, TOGGLE</a>: radio/checkbox inputs can be toggled (only 1 at a time within 'radio' inputs; any number within 'checkbox' inputs); 2 "binary" examples at bottom use custom text</li>
+<li><a target="test" href="layout_tbl-keyhole.htm">SELECTOR, NAVIGATIONAL, TABLE</a>: pressing &quot;view listings&quot; displays stacked table rows, one at a time</li>
+<li><a target="test" href="css3_sel-nth.htm">SELECTOR, POSITIONAL</a>: displays 4x6 icon grid, implemted via nth-of-type()</li>
+</ol>
+<a name="visual-effects"></a>
+<h3>3. Visual Effects</h3>
+<ol type="1">
+<li><a target="test" href="css3_backgrounds.htm">CSS, BACKGROUNDS</a>: selected accordion tabs display both gradient background and icon; unselected only displays icon; uses scaleY transition</li>
+<li><a target="test" href="css3_border-img.htm">CSS, BORDER IMAGE</a>: border image surrounds box</li>
+<li><a target="test" href="css3_shadow.htm">CSS, BOX-SHADOW, PLAIN</a>: nav element has shadow; icons appear smaller while pressed</li>
+<li><a target="test" href="css3_gradientBack.htm">CSS, GRADIENT, BACKGROUND</a>: background fades vertically from light to dark</li>
+<li><a target="test" href="css3_gradientBackStop.htm">CSS, GRADIENT, BACKGROUND, COLOR-STOP</a>: as you scroll down page, background fades vertically from dark to light and back to dark again</li>
+<li><a target="test" href="css3_gradientButton.htm">CSS, GRADIENT, BUTTON</a>: buttons appear with vertical shading, appearing w/inverted gradient when pressed</li>
+<li><a target="test" href="css3_grad-radial.htm">CSS, GRADIENT, RADIAL</a>: touching within box produces colorful *splat* effect for duration of touch</li>
+<li><a target="test" href="css3_mask-grad.htm">CSS, MASK, GRADIENT</a>: images appear w/gradient; touching them removes gradient</li>
+<li><a target="test" href="css3_mask-img.htm">CSS, MASK, IMAGE</a>: image fills screen but fades to black around the edges</li>
+<li><a target="test" href="css3_reflect.htm">CSS, REFLECTION</a>: heading and image both appear w/mirror reflections along bottom</li>
+<li><a target="test" href="css3_scroll.htm">CSS, SCROLLBARS</a>: code block scrollable via big buttons</li>
+<li><a target="test" href="css3_text-overflow.htm">CSS, TEXT-OVERFLOW</a>: items appear w/ellipses; touching them expands them; pressing (X) collapses them</li>
+<li><a target="test" href="css3_text-shadow.htm">CSS, TEXT-SHADOW</a>: heading text appears with shadow</li>
+<li><a target="test" href="css3_text-stroke.htm">CSS, TEXT-STROKE</a>: first heading appears w/black outline</li>
+</ol>
+<a name="dynamic-css"></a>
+<h3>4. Dynamic CSS</h3>
+<ol type="1">
+<li><a target="test" href="anim_demo-rotate.htm">ANIMATION, DEMO, ROTATE</a>: animated demo of rotating boxes</li>
+<li><a target="test" href="anim_demo-scale.htm">ANIMATION, DEMO, SCALE</a>: animated demo of shrinking/expanding box</li>
+<li><a target="test" href="anim_demo-skew.htm">ANIMATION, DEMO, SKEW</a>: animated demo of box being pushed and piulled around</li>
+<li><a target="test" href="anim_pulse.htm">ANIMATION, KEYFRAME, PULSE</a>: pressing icons causes them to pulse indefinitely</li>
+<li><a target="test" href="anim_slide1.htm">ANIMATION, KEYFRAME, SLIDING</a>: drill-down menus</li>
+<li><a target="test" href="css3_multicol.htm">ANIMATION, KEYFRAME, BANNER</a>: banner scrolls through 5 colorful items</li>
+<li><a target="test" href="anim_tabbedSkew.htm">ANIMATION, TRANSFORM, SKEWED TABS</a>: touching parts of cube displays different tabbed text</li>
+<li><a target="test" href="anim_accord.htm">ANIMATION, TRANSITION, CHAINED, ACCORDION</a>: tapping icon animates in collapsed accordions; tapping them animates in display of subheads; tapping anywhere else reverses animation sequence, collapsing back to initial icon</li>
+<li><a target="test" href="anim_panel.htm">ANIMATION, TRANSITION, MAX-WIDTH, PANEL</a>: pressing icon animates to expand panel of choices; pressing anywhere collapses panel back down to initial icon</li>
+<li><a target="test" href="anim_skew.htm">ANIMATION, TRANSITION, SKEW</a>: tapping items causes them to wipe off right edge w/skew effect; remainder re-pack vertically; touching each category icon removes non-matching items and drops down matching ones</li>
+<li><a target="test" href="anim_gallery.htm">ANIMATION, TRANSITION, TRANSLATE, GALLERY</a>: tapping images adjacent to main image animates them in; tapping current image flips to display text; w/text displaying, tapping adjacent image animates both effects @ same time</li>
+</ol>
+
+<a name="storage"></a>
+<h2>5. Storage</h2>
+
+<ol type="1">
+<li><a target="test" href="storage.htm">LOCAL/SESSION STORAGE</a>:
+When opened for first time, form opens featuring
+login/password/credit-card fields. Fill them out. Each input's
+background will go pink if input is invalid. Login & password
+validate simply as "required" so any string will do. Credit card
+validates as 16-digit numeral. After filling out, press dismiss box.
+Then quit & reopen browser, go back to page, and press (i) info icon
+to get back into form. login/password should be same as initially
+entered (localStorage), but credit-card data s/b absent
+(sessionStorage).
+
+</li>
+</ol>
+
+</div>
+<!-- @@@examples -->
+ <div class="feedback t_button">
+ [+] Documentation Feedback</div>
+ </div>
+ </div>
+ </div>
+ <div class="ft">
+ <span></span>
+ </div>
+ </div>
+ <div class="footer">
+ <p>
+ <acronym title="Copyright">&copy;</acronym> 2008-2010 Nokia Corporation and/or its
+ subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation
+ in Finland and/or other countries worldwide.</p>
+ <p>
+ All other trademarks are property of their respective owners. <a title="Privacy Policy"
+ href="http://qt.nokia.com/about/privacy-policy">Privacy Policy</a></p>
+ <br />
+ <p>
+ Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.</p>
+ <p>
+ Alternatively, this document may be used under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU
+ Free Documentation License version 1.3</a>
+ as published by the Free Software Foundation.</p>
+ </div>
+ <div id="feedbackBox">
+ <div id="feedcloseX" class="feedclose t_button">X</div>
+ <form id="feedform" action="http://doc.qt.nokia.com/docFeedbck/feedback.php" method="get">
+ <p id="noteHead">Thank you for giving your feedback.</p> <p class="note">Make sure it is related to this specific page. For more general bugs and
+ requests, please use the <a href="http://bugreports.qt.nokia.com/secure/Dashboard.jspa">Qt Bug Tracker</a>.</p>
+ <p><textarea id="feedbox" name="feedText" rows="5" cols="40"></textarea></p>
+ <p><input id="feedsubmit" class="feedclose" type="submit" name="feedback" /></p>
+ </form>
+ </div>
+ <div id="blurpage">
+ </div>
+ <script src="scripts/functions.js" type="text/javascript"></script>
+ <!-- <script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-4457116-5']);
+ _gaq.push(['_trackPageview']);
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+ </script> -->
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/anim_accord.htm b/examples/webkit/webkit-guide/anim_accord.htm
new file mode 100644
index 0000000..9efd3b1
--- /dev/null
+++ b/examples/webkit/webkit-guide/anim_accord.htm
@@ -0,0 +1,122 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Nested Accordion</title>
+<link href='css/anim_accord.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section class="main">
+<article>
+
+<dl id="accordion" class="collapsed">
+
+<dt><a href="#">Event Info</a></dt>
+<dd>
+<ul>
+<li><a href="#">Travel</a></li>
+<li><a href="#">Area Info</a></li>
+<li><a href="#">Hospitality</a></li>
+<li><a href="#">Schedule of Events</a></li>
+<li><a href="#">Spectator Guide</a></li>
+<li><a href="#">Contact Us</a></li>
+</ul>
+</dd>
+<dt><a href="#">Team Info</a></dt>
+<dd>
+<ul>
+<li><a href="#">Team Captain</a></li>
+<li><a href="#">Team Members</a></li>
+<li><a href="#">Team Standings</a></li>
+</ul>
+</dd>
+<dt><a href="#">Course</a></dt>
+<dd>
+<ul>
+<li><a href="#">Overview</a></li>
+<li><a href="#">Tour</a></li>
+<li><a href="#">History</a></li>
+</ul>
+</dd>
+<dt><a href="#">History</a></dt>
+<dd>
+<ul>
+<li><a href="#">Past Results</a></li>
+<li><a href="#">U.S. Player Records</a></li>
+<li><a href="#">European Player Records</a></li>
+<li><a href="#">All-Time Records</a></li>
+<li><a href="#">The Trophy</a></li>
+</ul>
+</dd>
+<dt><a href="#">News</a></dt>
+<dd>
+<ul>
+<li><a href="#">News Stotries</a></li>
+<li><a href="#">Interviews</a></li>
+<li><a href="#">Photo Gallery</a></li>
+<li><a href="#">Videos</a></li>
+</ul>
+</dd>
+</dl>
+
+<h4>Nested Accordion</h4>
+
+<p>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
+gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
+ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
+mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
+sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
+urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
+felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
+turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
+venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
+at neque.
+</p>
+
+</article>
+</section>
+<script src="js/anim_accord.js"></script>
+
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/anim_demo-rotate.htm b/examples/webkit/webkit-guide/anim_demo-rotate.htm
new file mode 100644
index 0000000..299fd98
--- /dev/null
+++ b/examples/webkit/webkit-guide/anim_demo-rotate.htm
@@ -0,0 +1,63 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>transforms: rotate</title>
+
+<link href='css/anim_demo-rotate.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section class="rotate">
+Rotate: from 0 to 180&deg;, then to 360&deg;<br/>(Origin: center)
+</section>
+
+<section class="rotateOrigin">
+Rotate: from 0 to -180&deg;, then to -360&deg;<br/>(Origin: top left)
+</section>
+
+<section class="end">
+(The End)
+</section>
+
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/anim_demo-scale.htm b/examples/webkit/webkit-guide/anim_demo-scale.htm
new file mode 100644
index 0000000..e6f0f79
--- /dev/null
+++ b/examples/webkit/webkit-guide/anim_demo-scale.htm
@@ -0,0 +1,67 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>transforms: scale</title>
+
+<link href='css/anim_demo-scale.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section class="scale">
+Scale: from 0 to 0.5, to 1.5 and back.<br/>(Origin: bottom)
+</section>
+
+<section class="scaleX">
+ScaleX: from 0 to 0.5, to 1.5 and back.<br/>(Origin: left)
+</section>
+
+<section class="scaleY">
+ScaleY: from 0 to 0.5, to 1.5 and back.<br/>(Origin: center)
+</section>
+
+<section class="end">
+(The End)
+</section>
+
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/anim_demo-skew.htm b/examples/webkit/webkit-guide/anim_demo-skew.htm
new file mode 100644
index 0000000..c183f64
--- /dev/null
+++ b/examples/webkit/webkit-guide/anim_demo-skew.htm
@@ -0,0 +1,62 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>transforms: skew</title>
+<link href='css/anim_demo-skew.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section class="skew">
+Skew: from 30&deg; to -30&deg; and back.<br/>(Origin: bottom)
+</section>
+
+<section class="skewY">
+SkewY: from 30&deg; to -30&deg; and back.<br/>(Origin: left)
+</section>
+
+<section class="end">
+(The End)
+</section>
+
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/anim_gallery.htm b/examples/webkit/webkit-guide/anim_gallery.htm
new file mode 100644
index 0000000..3bb7e07
--- /dev/null
+++ b/examples/webkit/webkit-guide/anim_gallery.htm
@@ -0,0 +1,114 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Image Gallery</title>
+<link href='css/anim_gallery.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section class="gallery"><div>
+<img src="img/gal1.jpg"/>
+<div>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
+gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
+ac tellus. Donec a massa felis, a congue purus. Nullam et
+turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
+venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
+at neque.
+</div>
+</div><div>
+<img src="img/gal2.jpg"/>
+<div>
+Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis ante, id mollis risus lectus ornare nisl.
+Aenean elementum arcu sed nibh faucibus pellentesque.
+Aenean vestibulum egestas metus, eu sodales dolor venenatis quis.
+Vivamus ipsum felis, cursus sed venenatis nec, tempus ac tellus.
+Donec a massa felis, a congue purus. Nullam et turpis diam.
+Aenean augue orci, facilisis et convallis ut, egestas at neque.
+</div>
+</div><div>
+<img src="img/gal3.jpg"/>
+<div>
+Aliquam erat volutpat. Mauris tempor, urna at dignissim pellentesque, velit lacus dictum sem, non porttitor felis nulla nec risus.
+Donec a massa felis, a congue purus. Nullam et turpis diam.
+Donec feugiat gravida viverra.
+Vivamus ipsum felis, cursus sed venenatis nec, tempus ac tellus.
+Aenean augue orci, facilisis et convallis ut, egestas at neque.
+</div>
+</div><div>
+<img src="img/gal4.jpg"/>
+<div>
+Donec feugiat gravida viverra.
+Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis ante, id mollis risus lectus ornare nisl.
+Aliquam erat volutpat. Mauris tempor, urna at dignissim pellentesque, velit lacus dictum sem, non porttitor felis nulla nec risus.
+</div>
+</div><div>
+<img src="img/gal5.jpg"/>
+<div>
+Vivamus ipsum felis, cursus sed venenatis nec, tempus ac tellus.
+Aliquam erat volutpat. Mauris tempor, urna at dignissim pellentesque, velit lacus dictum sem, non porttitor felis nulla nec risus.
+Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis ante, id mollis risus lectus ornare nisl.
+</div>
+</div><div>
+<img src="img/gal6.jpg"/>
+<div>
+Donec feugiat gravida viverra.
+Aenean elementum arcu sed nibh faucibus pellentesque.
+Aenean augue orci, facilisis et convallis ut, egestas at neque.
+</div>
+</div><div>
+<img src="img/gal7.jpg"/>
+<div>
+Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis ante, id mollis risus lectus ornare nisl.
+Aliquam erat volutpat. Mauris tempor, urna at dignissim pellentesque, velit lacus dictum sem, non porttitor felis nulla nec risus.
+</div>
+</div><div>
+<img src="img/gal8.jpg"/>
+<div>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+Aliquam erat volutpat. Mauris tempor, urna at dignissim pellentesque, velit lacus dictum sem, non porttitor felis nulla nec risus.
+Aenean augue orci, facilisis et convallis ut, egestas at neque.
+</div>
+</div></section>
+<script src="js/anim_gallery.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/anim_panel.htm b/examples/webkit/webkit-guide/anim_panel.htm
new file mode 100644
index 0000000..07ecd62
--- /dev/null
+++ b/examples/webkit/webkit-guide/anim_panel.htm
@@ -0,0 +1,63 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Animated Slide-out Panel</title>
+<link href='css/anim_panel.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section onclick="javascript:void(0)">
+<nav id="panel" class="collapsed">
+<img class="button" src="img/ic_c_032.png" onclick="share()"/>
+<img class="option" src="img/ic_ni_032.png" onclick="debug('Ni')"/>
+<img class="option" src="img/ic_fe_032.png" onclick="debug('Fe')"/>
+<img class="option" src="img/ic_he_032.png" onclick="debug('He')"/>
+<img class="option" src="img/ic_o_032.png" onclick="debug('O')"/>
+<img class="option" src="img/ic_na_032.png" onclick="debug('Na')"/>
+<img class="option" src="img/ic_zn_032.png" onclick="debug('Zn')"/>
+<span class="force">&nbsp;</span>
+</nav>
+<div id="dbg">Press the icon, then choose an option if you wish.</div>
+</section>
+<script src="js/anim_panel.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/anim_pulse.htm b/examples/webkit/webkit-guide/anim_pulse.htm
new file mode 100644
index 0000000..97666c9
--- /dev/null
+++ b/examples/webkit/webkit-guide/anim_pulse.htm
@@ -0,0 +1,71 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Animated Pulse</title>
+<link href='css/anim_pulse.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section>
+<article>
+<nav>
+<a href="#a" id="a"></a>
+<a href="#b" id="b"></a>
+<a href="#c" id="c"></a>
+<a href="#d" id="d"></a>
+<a href="#e" id="e"></a>
+<a href="#f" id="f"></a>
+<span class="force">&nbsp;</span>
+</nav>
+<h3>Animated Pulse</h3>
+<p>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
+gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
+ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
+mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
+sed nibh faucibus pellentesque. Aliquam erat volutpat.
+</p>
+</article>
+</section>
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/anim_skew.htm b/examples/webkit/webkit-guide/anim_skew.htm
new file mode 100644
index 0000000..077fe17
--- /dev/null
+++ b/examples/webkit/webkit-guide/anim_skew.htm
@@ -0,0 +1,80 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Transitions with Skew Transforms</title>
+<link href="css/anim_skew.css" rel="stylesheet" type="text/css" />
+<style id="custom"></style>
+</head>
+<body>
+<section class="items">
+<div title="cat1">Item #1</div>
+<div title="cat2">Item #2</div>
+<div title="cat1">Item #3</div>
+<div title="cat3">Item #4</div>
+<div title="cat4">Item #5</div>
+<div title="cat1">Item #6</div>
+<div title="cat3">Item #7</div>
+<div title="cat2">Item #8</div>
+<div title="cat4">Item #9</div>
+<div title="cat1">Item #10</div>
+<div title="cat2">Item #11</div>
+<div title="cat3">Item #12</div>
+<div title="cat4">Item #13</div>
+<div title="cat1">Item #14</div>
+<div title="cat2">Item #15</div>
+</section>
+
+<nav>
+<div>&nbsp;</div>
+<div class="cat1">&nbsp;</div>
+<div class="cat2">&nbsp;</div>
+<div class="cat4">&nbsp;</div>
+<div class="cat3">&nbsp;</div>
+</nav>
+
+<script src="js/anim_skew.js"></script>
+<!--
+<script src="js/mobile.js"></script>
+-->
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/anim_slide1.htm b/examples/webkit/webkit-guide/anim_slide1.htm
new file mode 100644
index 0000000..866cecc
--- /dev/null
+++ b/examples/webkit/webkit-guide/anim_slide1.htm
@@ -0,0 +1,61 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Animated Drilldown Sliders</title>
+<link href="css/anim_slide.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<a id='out'></a>
+<div id='in' class='panel'>
+<h1>Level 1</h1>
+<ul>
+<li><a href='anim_slide2.htm#in'>Level 2, Option A</a></li>
+<li><a href='anim_slide2.htm#in'>Level 2, Option B</a></li>
+<li><a href='anim_slide2.htm#in'>Level 2, Option C</a></li>
+<li><a href='anim_slide2.htm#in'>Level 2, Option D</a></li>
+<li><a href='anim_slide2.htm#in'>Level 2, Option E</a></li>
+</ul>
+</div>
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/anim_slide2.htm b/examples/webkit/webkit-guide/anim_slide2.htm
new file mode 100644
index 0000000..474de36
--- /dev/null
+++ b/examples/webkit/webkit-guide/anim_slide2.htm
@@ -0,0 +1,62 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Animated Drilldown Sliders</title>
+<link href="css/anim_slide.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<a id='out'></a>
+<div id='in' class='panel'>
+<h1>Level 2</h1>
+<a class='go_out' href='anim_slide1.htm#out'></a>
+<ul>
+<li><a href='anim_slide3.htm#in'>Level 3, Option A</a></li>
+<li><a href='anim_slide3.htm#in'>Level 3, Option B</a></li>
+<li><a href='anim_slide3.htm#in'>Level 3, Option C</a></li>
+<li><a href='anim_slide3.htm#in'>Level 3, Option D</a></li>
+<li><a href='anim_slide3.htm#in'>Level 3, Option E</a></li>
+</ul>
+</div>
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/anim_slide3.htm b/examples/webkit/webkit-guide/anim_slide3.htm
new file mode 100644
index 0000000..0da926e
--- /dev/null
+++ b/examples/webkit/webkit-guide/anim_slide3.htm
@@ -0,0 +1,65 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Animated Drilldown Sliders</title>
+<link href="css/anim_slide.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<a id='out'></a>
+<div id='in' class='panel'>
+<h1>Level 3</h1>
+
+<a class='go_out' href='anim_slide2.htm#out'></a>
+
+<article>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
+gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
+ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
+mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
+sed nibh faucibus pellentesque.
+</article>
+
+</div>
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/anim_tabbedSkew.htm b/examples/webkit/webkit-guide/anim_tabbedSkew.htm
new file mode 100644
index 0000000..387e0a7
--- /dev/null
+++ b/examples/webkit/webkit-guide/anim_tabbedSkew.htm
@@ -0,0 +1,88 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Transformed Tabs</title>
+<link href='css/anim_tabbedSkew.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section>
+<nav>
+<a id="l1" href="#a1">&nbsp;</a>
+<a id="l2" href="#a2">&nbsp;</a>
+<a id="l3" href="#a3">&nbsp;</a>
+</nav>
+<article id="a1">
+<h3>Tab #1</h3>
+<div>&nbsp;</div>
+<p>Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis
+ante, id mollis risus lectus ornare nisl. Lorem ipsum dolor sit amet,
+consectetur adipiscing elit. Donec feugiat gravida viverra. Vivamus
+ipsum felis, cursus sed venenatis nec, tempus ac tellus. Aenean
+elementum arcu sed nibh faucibus pellentesque. </p>
+</article>
+<article id="a2">
+<h3>Tab #2</h3>
+<div>&nbsp;</div>
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
+gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
+ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
+mollis ante, id mollis risus lectus ornare nisl.
+
+</article>
+<article id="a3">
+<h3>Tab #3</h3>
+<div>&nbsp;</div>
+
+Donec feugiat gravida viverra. Vivamus ipsum felis, cursus sed
+venenatis nec, tempus ac tellus. Praesent luctus, risus eu vestibulum
+mollis, arcu mauris mollis ante, id mollis risus lectus ornare nisl.
+Nullam et turpis diam. Aenean vestibulum egestas metus, eu sodales
+dolor venenatis quis. Aenean augue orci, facilisis et convallis ut,
+egestas at neque.
+
+</article>
+</section>
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/css/anim_accord.css b/examples/webkit/webkit-guide/css/anim_accord.css
new file mode 100755
index 0000000..c9c013a
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/anim_accord.css
@@ -0,0 +1,246 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+body {
+ background : #aaaaaa;
+ font-family : sans-serif;
+ width : 100;
+}
+
+body > section {
+ border-radius : 1em;
+ background : #ffffff;
+ border-radius : 1em;
+ padding : 1em;
+ background : #ffffff;
+ min-height : 70%;
+}
+
+.hidden {
+ display : none;
+}
+
+.active {
+ color : blue;
+ cursor : pointer;
+ text-decoration : none;
+}
+
+.nav > a {
+ display : inline-block;
+ width : 48px;
+ height : 48px;
+}
+
+h1, h2, h3, h4 {
+ margin-top : 0.0em;
+ font-size : smaller;
+ padding-top : 1em;
+}
+
+body > section.main {
+ position : absolute;
+ left : 1em;
+ right : 1em;
+ top : 1em;
+ min-height : 50%;
+ border-radius : 0.5em;
+ background : #aaaaaa;
+ padding : 0;
+}
+
+section.main > article {
+ background : #ffffff;
+ padding : 1em;
+ margin-bottom : 10em;
+ border-radius : 0.5em;
+}
+
+#accordion,
+#accordion > dt,
+#accordion > dd,
+{
+ display : block;
+}
+
+#accordion > dt {
+ border-top : thin solid #777777;
+}
+
+#accordion > dd {
+ border-bottom : thin solid #777777;
+}
+
+#accordion > dd {
+ background-image : -webkit-gradient(linear,center top,center bottom,from(#aaaaaa),to(#ffffff));
+}
+
+#accordion.collapsed {
+ background-size : auto;
+ background-image : url(../img/icon_expand-nav.png);
+ background-repeat : no-repeat;
+ background-position : 0.25em 0.25em;
+}
+
+#accordion {
+ position : absolute;;
+ right : 2em;
+ top : 0em;
+ overflow : hidden;
+ background : #ffffff;
+ cursor : pointer;
+ z-index : 100;
+ font-weight : bold;
+}
+
+#accordion.expanded {
+ border : thin solid #206ead;
+ width : 80%;
+ height : 90%;
+ -webkit-transition:
+ width 0.5s ease-in-out 0.0s,
+ height 0.5s ease-in-out 0.5s
+ ;
+}
+
+#accordion.collapsed {
+ width : 15%;
+ height : 9%;
+ -webkit-transition:
+ height 0.5s ease-in-out 0.0s,
+ width 0.5s ease-in-out 0.5s
+ ;
+}
+
+#accordion.collapsed > dt,
+#accordion.collapsed > dd {
+ -webkit-transform : translate(100%);
+ -webkit-transition : -webkit-transform 0.5s ease-in-out 0.5s;
+}
+
+#accordion.expanded > dt,
+#accordion.expanded > dd {
+ -webkit-transform : translate(0%);
+ -webkit-transition : -webkit-transform 0.5s ease-in-out 0.0s;
+}
+
+#accordion > dt > a {
+ margin-left : 0.5em;
+}
+
+#accordion > dt ,
+#accordion > dd {
+ padding : 0.5em;
+}
+
+#accordion > dt ~ dd {
+ margin : 0;
+}
+
+#accordion > dd > ul,
+#accordion > dd > ul > li
+{
+ padding : 0;
+ margin : 0;
+}
+
+#accordion a,
+#accordion a:active,
+#accordion a:hover,
+#accordion a:visited
+{
+ text-decoration : none;
+ color : #000000;
+}
+
+#accordion > dt.expanded:before {
+ content : url(../img/icon_head-expanded_x13.png);
+}
+
+#accordion > dt.collapsed:before {
+ content : url(../img/icon_head-collapsed_x13.png);
+}
+
+#accordion > dt.expanded {
+ background-image : -webkit-gradient(linear, center top, center bottom, from(#aaaaaa), to(#ffffff));
+}
+
+#accordion > dt.collapsed {
+ background-image : -webkit-gradient(linear, center top, center bottom, from(#aaaaaa), to(#ffffff));
+}
+
+#accordion > dt + dd {
+ background : #ffffff;
+ display : block;
+}
+
+#accordion dd {
+ overflow : none;
+}
+
+#accordion > dt.collapsed + dd {
+ max-height : 0%;
+ opacity : 0;
+ -webkit-transform : scaleY(0);
+ -webkit-transition : all 0.5s ease-in-out;
+}
+
+#accordion > dt.expanded + dd {
+ max-height : 50%;
+ opacity : 1;
+ -webkit-transform : scaleY(1);
+ -webkit-transition : all 0.5s ease-in-out;
+}
+
+#accordion > dd {
+ margin : 0;
+ padding : 0;
+}
+
+#accordion > dd > ul > li {
+ padding-top : 0.25em;
+ padding-bottom : 0.5em;
+ padding-left : 1.0em;
+ padding-right : 1.0em;
+}
+
+#accordion> dt.collapsed:last-of-type {
+ border-bottom : thin solid #aaaaaa;
+}
+
diff --git a/examples/webkit/webkit-guide/css/anim_demo-rotate.css b/examples/webkit/webkit-guide/css/anim_demo-rotate.css
new file mode 100755
index 0000000..fa3bd0d
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/anim_demo-rotate.css
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+body {
+ background : #aaaaaa;
+ font-weight : bold;
+}
+
+section {
+ color : #ffffff;
+ background : #777777;
+ font-size : x-large;
+ -webkit-transform : translate(-150%) scale(1);
+ position : absolute;
+ text-align : center;
+ padding : 1em;
+ top : 3em;
+ left : 3em;
+ bottom : 3em;
+ right : 3em;
+}
+
+@-webkit-keyframes demoRotate {
+ 0% { -webkit-transform : translate(-150%); }
+ 10% { -webkit-transform : rotate(0deg) translate(0); }
+ 50% { -webkit-transform : rotate(180deg) translate(0); }
+ 90% { -webkit-transform : rotate(360deg) translate(0); }
+ 100% { -webkit-transform : translate(150%); }
+}
+
+@-webkit-keyframes demoRotateOrigin {
+ 0% { -webkit-transform : rotate(0deg) translate(-150%); }
+ 10% { -webkit-transform : rotate(0deg) translate(0); }
+ 50% { -webkit-transform : rotate(-180deg) translate(0); }
+ 90% { -webkit-transform : rotate(-360deg) translate(0); }
+ 100% { -webkit-transform : rotate(-360deg) translate(150%) }
+}
+
+@-webkit-keyframes end {
+ 0% { -webkit-transform : translate(150%); }
+ 30% { -webkit-transform : translate(0); }
+ 70% { -webkit-transform : translate(0); }
+ 100% { -webkit-transform : translate(150%); }
+}
+
+.rotate {
+ -webkit-animation : demoRotate 9s 2s;
+ -webkit-transform-origin : center;
+ -webkit-animation-timing-function : linear;
+}
+.rotateOrigin {
+ -webkit-animation : demoRotateOrigin 9s 12s;
+ -webkit-transform-origin : top left;
+ -webkit-animation-timing-function : linear;
+}
+.end {
+ -webkit-animation : end 3s 22s;
+}
+
diff --git a/examples/webkit/webkit-guide/css/anim_demo-scale.css b/examples/webkit/webkit-guide/css/anim_demo-scale.css
new file mode 100755
index 0000000..4af469a
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/anim_demo-scale.css
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ background : #aaaaaa;
+ font-weight : bold;
+}
+
+section {
+ color : #ffffff;
+ background : #777777;
+ font-size : x-large;
+ -webkit-transform : translate(-150%) scale(1);
+ position : absolute;
+ text-align : center;
+ padding : 1em;
+ top : 3em;
+ left : 3em;
+ bottom : 3em;
+ right : 3em;
+}
+
+@-webkit-keyframes demoScale {
+ 0% { -webkit-transform : translate(-150%) scale(1); }
+ 10% { -webkit-transform : scale(1.0) translate(0); }
+ 30% { -webkit-transform : scale(0.5) translate(0); }
+ 50% { -webkit-transform : scale(1.0) translate(0); }
+ 70% { -webkit-transform : scale(1.5) translate(0); }
+ 90% { -webkit-transform : scale(1.0) translate(0); }
+ 100% { -webkit-transform : translate(150%) scale(1); }
+}
+
+@-webkit-keyframes demoScaleX {
+ 0% { -webkit-transform : translate(-150%) scale(1); }
+ 10% { -webkit-transform : scaleX(1.0) translate(0); }
+ 30% { -webkit-transform : scaleX(0.5) translate(0); }
+ 50% { -webkit-transform : scaleX(1.0) translate(0); }
+ 70% { -webkit-transform : scaleX(1.5) translate(0); }
+ 90% { -webkit-transform : scaleX(1.0) translate(0); }
+ 100% { -webkit-transform : translate(150%) scale(1); }
+}
+
+@-webkit-keyframes demoScaleY {
+ 0% { -webkit-transform : translate(-150%) scale(1); }
+ 10% { -webkit-transform : scaleY(1.0) translate(0); }
+ 30% { -webkit-transform : scaleY(0.5) translate(0); }
+ 50% { -webkit-transform : scaleY(1.0) translate(0); }
+ 70% { -webkit-transform : scaleY(1.5) translate(0); }
+ 90% { -webkit-transform : scaleY(1.0) translate(0); }
+ 100% { -webkit-transform : translate(150%) scale(1); }
+}
+
+@-webkit-keyframes end {
+ 0% { -webkit-transform : translate(150%); }
+ 30% { -webkit-transform : translate(0); }
+ 70% { -webkit-transform : translate(0); }
+ 100% { -webkit-transform : translate(150%); }
+}
+
+.scale {
+ -webkit-animation : demoScale 9s 2s;
+ -webkit-transform-origin : bottom;
+}
+.scaleX {
+ -webkit-animation : demoScaleX 9s 12s;
+ -webkit-transform-origin : left;
+}
+.scaleY {
+ -webkit-animation : demoScaleY 9s 22s;
+ -webkit-transform-origin : center;
+}
+.end {
+ -webkit-animation : end 3s 32s;
+}
+
diff --git a/examples/webkit/webkit-guide/css/anim_demo-skew.css b/examples/webkit/webkit-guide/css/anim_demo-skew.css
new file mode 100755
index 0000000..2d90bf9
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/anim_demo-skew.css
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ background : #aaaaaa;
+ font-weight : bold;
+}
+
+section {
+ color : #ffffff;
+ background : #777777;
+ font-size : x-large;
+ -webkit-transform : translate(-150%) scale(1);
+ position : absolute;
+ text-align : center;
+ padding : 1em;
+ top : 3em;
+ left : 3em;
+ bottom : 3em;
+ right : 3em;
+}
+
+@-webkit-keyframes demoSkew {
+ 0% { -webkit-transform : translate(-150%); }
+ 10% { -webkit-transform : skew(0deg) translate(0); }
+ 30% { -webkit-transform : skew(30deg) translate(0); }
+ 50% { -webkit-transform : skew(0deg) translate(0); }
+ 70% { -webkit-transform : skew(-30deg) translate(0); }
+ 90% { -webkit-transform : skew(0deg) translate(0); }
+ 100% { -webkit-transform : translate(150%); }
+}
+
+@-webkit-keyframes demoSkewY {
+ 0% { -webkit-transform : translate(-150%); }
+ 10% { -webkit-transform : skewY(0deg) translate(0); }
+ 30% { -webkit-transform : skewY(30deg) translate(0); }
+ 50% { -webkit-transform : skewY(0deg) translate(0); }
+ 70% { -webkit-transform : skewY(-30deg) translate(0); }
+ 90% { -webkit-transform : skewY(0deg) translate(0); }
+ 100% { -webkit-transform : translate(150%); }
+}
+
+@-webkit-keyframes end {
+ 0% { -webkit-transform : translate(150%); }
+ 30% { -webkit-transform : translate(0); }
+ 70% { -webkit-transform : translate(0); }
+ 100% { -webkit-transform : translate(150%); }
+}
+
+.skew {
+ -webkit-animation : demoSkew 9s 2s;
+ -webkit-transform-origin : bottom;
+}
+.skewY {
+ -webkit-animation : demoSkewY 9s 12s;
+ -webkit-transform-origin : left;
+}
+.end {
+ -webkit-animation : end 3s 22s;
+}
+
diff --git a/examples/webkit/webkit-guide/css/anim_gallery.css b/examples/webkit/webkit-guide/css/anim_gallery.css
new file mode 100755
index 0000000..fe14aa2
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/anim_gallery.css
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ font-family : sans-serif;
+ background : #444444;
+}
+.gallery > div > div {
+ border-radius : 1.0em;
+ padding : 1em;
+ background : #dddddd;
+ min-height : 75%;
+}
+.gallery > div {
+ -webkit-transition : all 0.5s ease-in-out;
+ z-index : 0;
+ position : absolute;
+ top : 2.0em;
+ bottom : 2.0em;
+ left : 2.0em;
+ right : 2.0em;
+}
+.gallery > div.selected {
+ -webkit-transform : translate(0) scale(1);
+ opacity : 1.0;
+ z-index : 1;
+}
+.gallery > div.queueR {
+ -webkit-transform : translate(70%) scale(0.5);
+ opacity : 0.75;
+}
+.gallery > div.queueL {
+ -webkit-transform : translate(-70%) scale(0.5);
+ opacity : 0.75;
+}
+.gallery > div.hideR {
+ -webkit-transform : translate(200%) scale(0.5);
+ opacity : 0.0;
+}
+.gallery > div.hideL {
+ -webkit-transform : translate(-200%) scale(0.5);
+ opacity : 0.0;
+}
+.gallery img {
+ max-width : 100%;
+ max-height : 100%;
+ border-radius : 1.0em;
+}
+
+.gallery > #reveal > div, .gallery > div > img {
+ -webkit-transform : scaleX(1) scaleY(1);
+ -webkit-transition : -webkit-transform 0.25s ease-out 0.25s;
+}
+.gallery > div > div, .gallery > #reveal > img {
+ -webkit-transform : scaleX(0) scaleY(1);
+ -webkit-transition : -webkit-transform 0.25s ease-out;
+}
+
+section > div {
+ text-align : center;
+}
+
+section > div > img {
+ display : inline-block;
+}
+
+section > div > div {
+ position : absolute;
+ top : 0;
+ left : 1.5em;
+ right : 1.5em;
+}
+
diff --git a/examples/webkit/webkit-guide/css/anim_panel.css b/examples/webkit/webkit-guide/css/anim_panel.css
new file mode 100755
index 0000000..87037c9
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/anim_panel.css
@@ -0,0 +1,116 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ background : #aaaaaa;
+ font-family : sans-serif;
+}
+
+section {
+ background : #aaaaaa;
+ position : absolute;
+ left : 1em;
+ right : 1em;
+ top : 1em;
+ bottom : 1em;
+}
+
+.force {
+ padding-right : 5in;
+}
+
+#panel {
+ text-align : justify;
+ padding : 0.5em;
+ border-radius : 0.5em;
+ background : #ffffff;
+ max-height : 2.0em;
+ float : right;
+ overflow : hidden;
+}
+
+nav.expanded {
+ max-width : 95%;
+ -webkit-transition : max-width 0.5s ease-in-out;
+}
+
+nav.collapsed {
+ max-width : 12%;
+ -webkit-transition : max-width 0.5s ease-in-out;
+
+}
+
+nav.expanded > .button {
+ display : none;
+}
+
+nav.collapsed > .button {
+ display : inline-block;
+}
+
+nav.expanded > .option {
+ opacity : 1;
+ -webkit-transform : scale(1);
+ -webkit-transition : all 0.5s linear;
+}
+nav.collapsed > .option {
+ opacity : 0;
+ -webkit-transform : scale(0);
+ -webkit-transition : all 0.5s linear;
+}
+
+#dbg {
+ padding : 1em;
+ border-radius : 1em;
+ position : absolute;
+ top : 75%;
+ bottom : 1em;
+ left : 1em;
+ right : 1em;
+ background : #ffffff;
+}
+
+.measure {
+ position : absolute;
+ top : 0;
+ left : 0;
+ width : 320px;
+ background : green;
+}
diff --git a/examples/webkit/webkit-guide/css/anim_pulse.css b/examples/webkit/webkit-guide/css/anim_pulse.css
new file mode 100755
index 0000000..4b850b9
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/anim_pulse.css
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ background : #aaaaaa;
+ font-family : sans-serif;
+}
+
+h1,h2,h3,h4 {
+ text-align : center;
+}
+
+section {
+ position : absolute;
+ top : 0;
+ left : 0;
+ right : 0;
+ bottom : 0;
+}
+
+article {
+ background : #ffffff;
+ border-radius : 1.0em;
+ padding : 1.0em;
+ margin : 1em;
+ min-height : 50%;
+}
+
+.force {
+ padding-left : 100%
+}
+
+nav {
+ text-align : justify;
+}
+
+nav > a {
+ background-size : contain;
+ background-repeat : no-repeat;
+}
+
+nav > a {
+ display : inline-block;
+ width : 2em;
+ height : 2em;
+}
+
+nav > a:nth-of-type(1) { background-image : url(../img/ic_fe_032.png); }
+nav > a:nth-of-type(2) { background-image : url(../img/ic_ni_032.png); }
+nav > a:nth-of-type(3) { background-image : url(../img/ic_he_032.png); }
+nav > a:nth-of-type(4) { background-image : url(../img/ic_na_032.png); }
+nav > a:nth-of-type(5) { background-image : url(../img/ic_zn_032.png); }
+nav > a:nth-of-type(6) { background-image : url(../img/ic_o_032.png); }
+
+h1,h2,h3 { margin-top : 0; }
+
+nav > a:target { -webkit-animation : pulse 1s infinite; }
+
+@-webkit-keyframes pulse {
+ 0% { opacity : 1.0 }
+ 50% { opacity : 0.7 }
+}
+
diff --git a/examples/webkit/webkit-guide/css/anim_skew.css b/examples/webkit/webkit-guide/css/anim_skew.css
new file mode 100755
index 0000000..e44a633
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/anim_skew.css
@@ -0,0 +1,186 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ background : #aaaaaa;
+ padding : 1em;
+ font-family : "Helvetica";
+ font-weight : bold;
+}
+
+span {
+ background : #ffffff;
+ font-weight : bold;
+ cursor : pointer;
+}
+
+.items > div {
+ cursor : pointer;
+ background : #ffffff;
+ height : 2em;
+ padding : 0.5em 0.5em 0.0em 0.5em;
+ border-radius : 0.25em;
+ position : absolute;
+ left : 1em;
+ right : 1em;
+ -webkit-transition-property : -webkit-transform, top;
+ -webkit-transition-duration : 0.5s, 0.5s;
+ -webkit-transition-delay : 0s, 0.5s;
+ -webkit-transition-timing-function : ease-in-out;
+}
+
+.hide {
+ -webkit-transform-origin : bottom left;
+ -webkit-transform : skew(40deg) translate(140%,0em);
+}
+
+.items > div:after {
+ content : url(../img/icon_dismiss_x22.png);
+ float : right;
+}
+
+.row1 {
+ top : 3.5em;
+}
+.row2 {
+ top : 6.5em;
+}
+.row3 {
+ top : 9.5em;
+}
+.row4 {
+ top : 12.5em;
+}
+.row5 {
+ top : 15.5em;
+}
+.row6 {
+ top : 18.5em;
+}
+.row7 {
+ top : 21.5em;
+}
+.row8 {
+ top : 24.5em;
+}
+.row9 {
+ top : 27.5em;
+}
+.row10 {
+ top : 30.5em;
+}
+.row11 {
+ top : 33.5em;
+}
+.row12 {
+ top : 36.5em;
+}
+.row13 {
+ top : 39.5em;
+}
+.row14 {
+ top : 42.5em;
+}
+.row15 {
+ top : 45.5em;
+}
+
+.items > div {
+ padding-left : 3.0em;
+ color : #444444;
+ background-size : contain;
+ background-repeat : no-repeat;
+}
+
+.items > div[title='cat1'] {
+ background-image : url(../img/ic_fe_036.png);
+}
+
+.items > div[title='cat2'] {
+ background-image : url(../img/ic_na_036.png);
+}
+
+.items > div[title='cat3'] {
+ background-image : url(../img/ic_ni_036.png);
+}
+
+.items > div[title='cat4'] {
+ background-image : url(../img/ic_mg_036.png);
+}
+
+nav {
+ position : absolute;
+ background : #aaaaaa;
+ top : 0;
+ left : 0;
+ right : 0;
+ z-index : 10;
+ height : 2em;
+ text-align : center;
+ padding : 0.5em;
+}
+
+nav > div {
+ background-size : contain;
+ background-repeat : no-repeat;
+ display : inline-block;
+ width : 36px;
+ height : 36px;
+ margin-left : 0.25em;
+ margin-right : 0.25em;
+ background-image : -webkit-gradient(linear,center top,center bottom,from(#ffffff),to(#eeeeee));
+}
+
+nav > div {
+ background-image : url(../img/icon_list-all.png);
+}
+nav > .cat1 {
+ background-image : url(../img/ic_fe_036.png);
+}
+nav > .cat2 {
+ background-image : url(../img/ic_na_036.png);
+}
+nav > .cat3 {
+ background-image : url(../img/ic_ni_036.png);
+}
+nav > .cat4 {
+ background-image : url(../img/ic_mg_036.png);
+}
+
diff --git a/examples/webkit/webkit-guide/css/anim_slide.css b/examples/webkit/webkit-guide/css/anim_slide.css
new file mode 100755
index 0000000..7997cc2
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/anim_slide.css
@@ -0,0 +1,148 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/* main layout */
+body {
+ background : #aaaaaa;
+ font-family : sans-serif;
+ font-weight : bold;
+}
+
+h1 {
+ min-height : 1.5em;
+ background : #ffffff;
+ margin-left : 1em;
+ margin-right : 1em;
+ text-align : center;
+ font-size : 18px;
+ padding-top : 0.25em;
+ padding-bottom : 0.25em;
+ border-radius : 0.5em;
+}
+
+.panel {
+ position : absolute;
+ top : 0em;
+ bottom : 0em;
+ left : 0em;
+ right : 0em;
+}
+
+article {
+ background : #ffffff;
+ padding : 1em;
+ border-radius : 1em;
+ margin : 1em;
+}
+
+.panel > ul {
+ padding : 0em;
+ list-style-type : none;
+}
+.panel > ul > li {
+ background : #fff;
+ margin : 0.5em 1.0em 0.5em 1.0em;
+ padding : 0.5em;
+ display : block;
+ border-radius : 0.5em;
+}
+.panel > ul > li > a {
+ width : 100%;
+ display : block;
+ text-decoration : none;
+ text-align : justify;
+ color : #000000;
+}
+.panel > a {
+ background : #fff;
+ margin : 0 1.0em 1.0em 0em;
+ padding : 0.5em;
+}
+/* navigational hints */
+
+a.go_out {
+ background : transparent;
+ position : absolute;
+ top : 0.5em;
+ left : 1.2em;
+ content : url(../img/icon_drill-up_x32.png);
+ padding : 0.25em;
+ border-radius : 1em;
+ display : block;
+}
+
+.panel > ul > li > a:after {
+ text-align : right;
+ float : right;
+ font-size : 1em;
+ font-weight : bold;
+}
+.panel > ul > li > a:after {
+ -webkit-transform : translate(0, -0.5em);
+ content : url(../img/icon_drill-down_x32.png);
+}
+
+/* animations */
+#in:target {
+ -webkit-animation : slide_in 0.25s;
+}
+#out:target + .panel {
+ -webkit-animation : slide_out 0.25s;
+}
+@-webkit-keyframes slide_in {
+ from {
+ left : 80%;
+ right : -80%;
+ }
+ to {
+ left : 0em;
+ right : 0em;
+ }
+}
+@-webkit-keyframes slide_out {
+ from {
+ left : -80%;
+ right : 80%;
+ }
+ to {
+ left : 0em;
+ right : 0em;
+ }
+}
diff --git a/examples/webkit/webkit-guide/css/anim_tabbedSkew.css b/examples/webkit/webkit-guide/css/anim_tabbedSkew.css
new file mode 100755
index 0000000..1c03e48
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/anim_tabbedSkew.css
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ background : #aaaaaa;
+ font-family : sans-serif;
+}
+
+section {
+ background : #ffffff;
+ position : absolute;
+ left : 1em;
+ right : 1em;
+ top : 1em;
+ min-height : 60%;
+ padding : 1.0em;
+ border-radius : 0.5em;
+}
+
+nav {
+ text-align : right;
+ width : 3.5em;
+ height : 4em;
+ float : right;
+}
+
+nav > a {
+ border-radius : 0.25em;
+ width : 1em;
+ height : 1em;
+ text-align : center;
+ font-weight : bold;
+ font-size : 2em;
+ text-decoration : none;
+ color : black;
+ position : relative;
+ background-size : contain;
+ display : block;
+}
+
+nav > a:nth-of-type(1) {
+ margin-bottom : 0.1em;
+ background-image : url(../img/ic_he_032.png);
+ -webkit-transform : skew(-30deg);
+}
+
+nav > a:nth-of-type(2) {
+ background-image : url(../img/ic_o_032.png);
+ -webkit-transform : skew(30deg);
+}
+
+nav > a:nth-of-type(3) {
+ background-image : url(../img/ic_na_032.png);
+ -webkit-transform : rotate(-60deg) skew(-30deg) translate(1.7em, -1px);
+}
+
+article {
+ display : none;
+ margin-bottom : 4em;
+}
+
+article:target {
+ display : block;
+}
+
+h3 + div {
+ display : inline-block;
+ float : right;
+ width : 12px;
+ height : 3em;
+}
+
+h1,h2,h3,h4 {
+ margin-top : 0.5em;
+}
+
diff --git a/examples/webkit/webkit-guide/css/css3_backgrounds.css b/examples/webkit/webkit-guide/css/css3_backgrounds.css
new file mode 100755
index 0000000..c2a3a30
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/css3_backgrounds.css
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ font-family : sans-serif;
+ background : #aaaaaa;
+}
+
+h1,h2,h3,h4 {
+ background : #ffffff;
+ text-align : center;
+ margin : 0.5em;
+ padding : 0.5em;
+ border-radius : 0.5em;
+}
+
+.accordion {
+ margin : 0.5em 0.5em 6em 0.5em;
+ border-radius : 0.5em;
+ border : thin solid #aaa;
+ background : #ffffff;
+ overflow : hidden;
+ padding : 1.0em 0.5em 1.0em 0.5em;
+
+}
+
+.accordion > dt {
+ cursor : pointer;
+ border-top : thin solid #aaa;
+ border-radius : 0.5em;
+ padding : 0.5em 0.5em 0.5em 2.5em;
+ font-weight : bold;
+ background-size : auto;
+ background-image : url(../img/icon_head-collapsed_x13.png);
+ background-repeat : no-repeat;
+ background-position : 12px 12px;
+}
+
+.accordion > dt:first-of-type {
+ border-top : none;
+}
+
+.accordion > dt.selected {
+ background-image : url(../img/icon_head-expanded_x13.png) , url(../img/gradient.jpg);
+ background-repeat : no-repeat , repeat-x;
+ background-position : 12px 12px , 0 0;
+ margin-bottom : 0em;
+}
+
+dt + dd {
+ max-height : 0%;
+ margin : 0;
+ opacity : 0;
+ padding : 0.5em;
+ overflow-y : hidden;
+ max-height : 0;
+ -webkit-transform : scaleY(0);
+ -webkit-transition : all 0.5s linear;
+}
+
+dt.selected + dd {
+ -webkit-transform : scaleY(1);
+ -webkit-transform-origin : center;
+ max-height : 1000px;
+ -webkit-transition : all 0.5s linear;
+ opacity : 1;
+}
+
diff --git a/examples/webkit/webkit-guide/css/css3_border-img.css b/examples/webkit/webkit-guide/css/css3_border-img.css
new file mode 100755
index 0000000..1293e2e
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/css3_border-img.css
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ background : #aaaaaa;
+ font-family : sans-serif;
+}
+
+h1,h2,h3,h4 {
+ text-align : center;
+}
+
+section {
+ position : absolute;
+ top : 0;
+ left : 0;
+ right : 0;
+ bottom : 0;
+}
+
+article {
+ background : #ffffff;
+ border-radius : 1.0em;
+ padding : 1.0em;
+ margin : 1em;
+ min-height : 50%;
+}
+
+.fruit {
+ padding : 2.5em;
+ -webkit-border-image : url(../img/border-frame.png) 2 stretch stretch;
+}
+
diff --git a/examples/webkit/webkit-guide/css/css3_grad-radial.css b/examples/webkit/webkit-guide/css/css3_grad-radial.css
new file mode 100755
index 0000000..7799153
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/css3_grad-radial.css
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ background : #aaaaaa;
+ font-family : sans-serif;
+ font-weight : bold;
+}
+
+h1,h2,h3,h4 {
+ text-align : center;
+}
+
+section {
+ position : absolute;
+ top : 0;
+ left : 0;
+ right : 0;
+ bottom : 0;
+}
+
+article {
+ background : #ffffff;
+ border-radius : 1.0em;
+ padding : 1.0em;
+ margin : 1em;
+ min-height : 70%;
+}
+
diff --git a/examples/webkit/webkit-guide/css/css3_gradientBack.css b/examples/webkit/webkit-guide/css/css3_gradientBack.css
new file mode 100755
index 0000000..48f9d68
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/css3_gradientBack.css
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ font-family : sans-serif;
+}
+
+section {
+ position : absolute;
+ top : 0.0em;
+ left : 0.0em;
+ right : 0.0em;
+ background : #aaaaaa;
+ background : -webkit-gradient(linear, center top, center bottom, from(#dddddd), to(#777777) );
+ padding : 1em;
+}
+
+article {
+ background : #ffffff;
+ padding : 1em;
+ border-radius : 0.5em;
+ border : thin #aaaaaa solid;
+ margin-bottom : 12em;
+}
+
+h1, h2, h3, h4 {
+ text-align : center;
+ margin-top : 0.5em;
+}
+
+.hidden {
+ display : none;
+}
+
+.active {
+ color : blue;
+ cursor : pointer;
+ text-decoration : none;
+}
+
diff --git a/examples/webkit/webkit-guide/css/css3_gradientBackStop.css b/examples/webkit/webkit-guide/css/css3_gradientBackStop.css
new file mode 100755
index 0000000..0fbaf52
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/css3_gradientBackStop.css
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ font-family : sans-serif;
+}
+
+section {
+ position : absolute;
+ top : 0.0em;
+ left : 0.0em;
+ right : 0.0em;
+ background : #aaaaaa;
+ background : -webkit-gradient(linear, center top, center bottom, from(#777777), color-stop(50%,#dddddd), to(#777777) );
+ padding : 1em;
+}
+
+article {
+ background : #ffffff;
+ padding : 1em;
+ border-radius : 0.5em;
+ border : thin #aaaaaa solid;
+ margin-bottom : 12em;
+}
+
+h1, h2, h3, h4 {
+ text-align : center;
+ margin-top : 0.5em;
+}
+
+.hidden {
+ display : none;
+}
+
+.active {
+ color : blue;
+ cursor : pointer;
+ text-decoration : none;
+}
+
diff --git a/examples/webkit/webkit-guide/css/css3_gradientButton.css b/examples/webkit/webkit-guide/css/css3_gradientButton.css
new file mode 100755
index 0000000..6d0c9f7
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/css3_gradientButton.css
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ background : #ffffff;
+}
+
+article {
+ background : #ffffff;
+ position : absolute;
+ margin : 0;
+ left : 0;
+ right : 0;
+ top : 0;
+ bottom : 0;
+}
+
+ul {
+ font-weight : bold;
+ padding : 0;
+ list-style : none;
+ margin : 0.5em 0.5em 6em 0.5em;
+}
+
+ul > li {
+ margin-bottom : 0.5em;
+}
+
+ul > li > a {
+ padding : 0.5em;
+ display : block;
+ text-decoration : none;
+ color : #000000;
+ border : thin #aaaaaa solid;
+ border-radius : 0.5em;
+ background : #dddddd;
+ background : -webkit-gradient(linear, center top, center bottom,
+ from(#cccccc), to(#ffffff) );
+}
+
+ul > li > a:active {
+ color : #ffffff;
+ background : #ffffff;
+ background : -webkit-gradient(linear, center top, center bottom,
+ from(#dddddd), to(#444444) );
+}
+
+h1,h2,h3,h4 {
+ text-align : center;
+}
+
diff --git a/examples/webkit/webkit-guide/css/css3_mask-grad.css b/examples/webkit/webkit-guide/css/css3_mask-grad.css
new file mode 100755
index 0000000..24f0b22
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/css3_mask-grad.css
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ font-family : sans-serif;
+ background : #ffffff;
+}
+
+h1,h2,h3,h4 {
+ text-align : center;
+}
+
+img {
+ -webkit-mask-box-image : -webkit-gradient(linear, left top, left bottom, from(rgba(0,0,0,1)), to(rgba(0,0,0,0)));
+ border-radius : 0.25em;
+ margin : 0.1em;
+}
+
+img.select {
+ -webkit-mask-box-image : none;
+ -webkit-box-shadow : 0.2em 0.2em 0.4em #aaaaaa;
+}
+
diff --git a/examples/webkit/webkit-guide/css/css3_mask-img.css b/examples/webkit/webkit-guide/css/css3_mask-img.css
new file mode 100755
index 0000000..0203d81
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/css3_mask-img.css
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ font-family : sans-serif;
+ background : #333333;
+}
+
+h1,h2,h3,h4 {
+ text-align : center;
+}
+
+img {
+ position : absolute;
+ left : 5%;
+ top : 5%;
+ height : 90%;
+ width : 90%;
+ -webkit-mask-box-image : url(../img/mask.png) 5% stretch;
+}
+
diff --git a/examples/webkit/webkit-guide/css/css3_multicol.css b/examples/webkit/webkit-guide/css/css3_multicol.css
new file mode 100755
index 0000000..3c07f8b
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/css3_multicol.css
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ font-family : sans-serif;
+ background : #aaaaaa;
+}
+
+section {
+ bottom : 0;
+ left : 0;
+ top : 12%;
+ right : 0;
+ position : absolute;
+ padding-bottom : 6em;
+}
+
+article {
+ border-radius : 1em;
+ margin : 1em;
+ padding : 1em;
+ background : #ffffff;
+}
+
+h1,h2,h3,h4 {
+ text-align : center;
+ margin-top : 0.0em;
+}
+
+nav.ad {
+ width : 500%;
+ border : thin #aaaaaa solid;
+ background : #dddddd;
+ position : absolute;
+ top : 0%;
+ height : 10%;
+ column-count : 5;
+ column-width : 100%;
+ -webkit-animation : banner_scroll 30s infinite;
+}
+
+nav.ad > a {
+ width : 20%;
+ height : 100%;
+ display : inline-block;
+ text-align : center;
+ padding-top : 0.5em;
+ text-decoration : none;
+ font-weight : bold;
+ color : #000000;
+ font-size : larger;
+}
+
+nav.ad > a:nth-of-type(5n-0) { background : lightgreen; }
+nav.ad > a:nth-of-type(5n-1) { background : pink; }
+nav.ad > a:nth-of-type(5n-2) { background : plum; }
+nav.ad > a:nth-of-type(5n-3) { background : lightblue; }
+nav.ad > a:nth-of-type(5n-4) { background : lightcoral; }
+
+@-webkit-keyframes banner_scroll {
+ 0% { left : 0%; }
+ 18% { left : 0%; }
+ 20% { left : -100%; }
+ 38% { left : -100%; }
+ 40% { left : -200%; }
+ 58% { left : -200%; }
+ 60% { left : -300%; }
+ 78% { left : -300%; }
+ 80% { left : -400%; }
+ 95% { left : -400%; }
+ 100% { left : 0%; }
+}
+
diff --git a/examples/webkit/webkit-guide/css/css3_reflect.css b/examples/webkit/webkit-guide/css/css3_reflect.css
new file mode 100755
index 0000000..1f2e454
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/css3_reflect.css
@@ -0,0 +1,127 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ background : #aaaaaa;
+ font-family : sans-serif;
+}
+
+body > section {
+ border-radius : 1em;
+ padding : 1em;
+ background : #ffffff;
+ margin-bottom : 10em;
+ min-height : 70%;
+}
+
+.hidden {
+ display : none;
+}
+
+.active {
+ color : blue;
+ cursor : pointer;
+ text-decoration : none;
+}
+
+.nav > a {
+ display : inline-block;
+ width : 48px;
+ height : 48px;
+}
+
+body > section.main {
+ position : absolute;
+ left : 0em;
+ right : 0em;
+ top : 0em;
+ min-height : 50%;
+ border-radius : 0.5em;
+ background : #aaaaaa;
+ padding : 0;
+}
+
+section.main > article {
+ background : #ffffff;
+ padding : 1em;
+ margin : 1em 1em 10em 1em;
+ border-radius : 0.5em;
+}
+
+h1, h2, h3 {
+ color : #206ead;
+ margin-top : 0em;
+ text-align : center;
+ margin-bottom : 1em;
+ -webkit-box-reflect : below -0.25em -webkit-gradient(linear, center top, center bottom, from(transparent), color-stop(0.25, transparent), to(black));
+}
+
+.nav1 { background-image : url(../img/ic_he_032.png) }
+.nav2 { background-image : url(../img/ic_o_032.png) }
+.nav3 { background-image : url(../img/ic_ni_032.png) }
+.nav4 { background-image : url(../img/ic_fe_032.png) }
+.nav5 { background-image : url(../img/ic_na_032.png) }
+.nav6 { background-image : url(../img/ic_zn_032.png) }
+
+h1 { font-size : 1.5em; }
+h2 { font-size : 1.2em; }
+h3 { font-size : 1.0em; }
+
+figure {
+ display : block;
+ text-align : center;
+}
+
+figure > img {
+ width : 70%;
+ margin-bottom : 3em;
+ -webkit-box-reflect : below 0.25em -webkit-gradient(linear, center top, center bottom, from(transparent), color-stop(0.50, transparent), to(black));
+}
+
+p:first-line {
+ font-weight : bold;
+}
+
+p:first-letter {
+ font-size : 200%;
+ float : left;
+ padding-right : 0.1em;
+}
+
diff --git a/examples/webkit/webkit-guide/css/css3_scroll.css b/examples/webkit/webkit-guide/css/css3_scroll.css
new file mode 100755
index 0000000..ae37c34
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/css3_scroll.css
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ background-color : #aaaaaa;
+ font-family : sans-serif;
+}
+
+h1,h2,h3,h4 {
+ margin-top : 0.5em;
+ font-size : 18px;
+ text-align : center;
+}
+
+article {
+ background : #ffffff;
+ border-radius : 1.0em;
+ padding : 1.0em;
+ margin : 1.0em 0.5em 6.0em 0.5em;
+ min-height : 50%;
+}
+
+pre {
+ font-weight : bold;
+ font-family : monospace;
+ padding : 1.0em 3em 1.0em 1.0em;
+ border : thin solid #aaaaaa;
+ border-radius : 1.5em;
+ overflow-x : auto;
+ background-image : -webkit-gradient(linear,left center,right center,from(#ffffff),to(#777777));
+}
+
+pre::-webkit-scrollbar {
+ height : 3em;
+}
+
+pre::-webkit-scrollbar-button:increment {
+ background-image : url(../img/icon_scroll-right.png);
+x background-size : contain;
+ background-repeat : no-repeat;
+ width : 3em;
+ height : 3em;
+}
+
+pre::-webkit-scrollbar-button:decrement {
+ background-image : url(../img/icon_scroll-left.png);
+ background-size : contain;
+ background-repeat : no-repeat;
+ width : 3em;
+ height : 3em;
+}
+
+pre::-webkit-scrollbar-track {
+ display : none;
+}
+
diff --git a/examples/webkit/webkit-guide/css/css3_sel-nth.css b/examples/webkit/webkit-guide/css/css3_sel-nth.css
new file mode 100755
index 0000000..aa1e04b
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/css3_sel-nth.css
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+img {
+ position : absolute;
+ width : 48px;
+ height : 48px;
+ padding : 0.25em;
+ border : #ffffff medium solid;
+ border-radius : 0.5em;
+}
+
+/* columns */
+img:nth-of-type(4n-3) { left : 2% }
+img:nth-of-type(4n-2) { left : 27% }
+img:nth-of-type(4n-1) { left : 52% }
+img:nth-of-type(4n-0) { left : 77% }
+
+/* rows */
+img:nth-of-type(n) { top : 5% }
+img:nth-of-type(n+5) { top : 20% }
+img:nth-of-type(n+9) { top : 35% }
+img:nth-of-type(n+13) { top : 50% }
+img:nth-of-type(n+17) { top : 65% }
+img:nth-of-type(n+21) { top : 80% }
+
diff --git a/examples/webkit/webkit-guide/css/css3_shadow.css b/examples/webkit/webkit-guide/css/css3_shadow.css
new file mode 100755
index 0000000..d2f3040
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/css3_shadow.css
@@ -0,0 +1,145 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ background : #aaaaaa;
+ font-family : sans-serif;
+}
+
+body > section {
+ border-radius : 1em;
+ padding : 1em;
+ background : #ffffff;
+ margin-bottom : 10em;
+ min-height : 70%;
+}
+
+.hidden {
+ display : none;
+}
+
+.active {
+ color : blue;
+ cursor : pointer;
+ text-decoration : none;
+}
+
+.nav > a {
+ display : inline-block;
+ width : 48px;
+ height : 48px;
+}
+
+nav > a:active {
+ -webkit-transform : scale(0.8);
+}
+
+h1, h2 {
+ margin-top : 0em;
+ font-size : 18px;
+ text-align : center;
+}
+
+h2 {
+ border-top : solid thin #aaaaaa;
+}
+
+body > section.main {
+ position : absolute;
+ left : 0em;
+ right : 0em;
+ top : 5em;
+ min-height : 50%;
+ border-radius : 0.5em;
+ background : #aaaaaa;
+ padding : 0;
+}
+
+section.main > article {
+ background : #ffffff;
+ padding : 1em;
+ margin : 1em 1em 10em 1em;
+ border-radius : 0.5em;
+}
+
+section.nav {
+ z-index : 10;
+ border-radius : 0;
+ background : #aaaaaa;
+ background : transparent;
+ position : absolute;;
+ padding : 1em;
+ top : 0;
+ right : 0.0em;
+ left : 0.0em;
+}
+
+nav {
+ padding : 0.5em;
+ border-radius : 0.5em;
+ background : #ffffff;
+ top : 10px;
+ text-align : justify;
+ height : 36px;
+ overflow : hidden;
+}
+
+nav > a {
+ display : inline-block;
+ background-repeat : no-repeat;
+ height : 36px;
+ width : 36px;
+}
+
+#force_justify {
+ padding-left : 100%;
+}
+
+.nav1 { background-image : url(../img/ic_he_032.png) }
+.nav2 { background-image : url(../img/ic_o_032.png) }
+.nav3 { background-image : url(../img/ic_ni_032.png) }
+.nav4 { background-image : url(../img/ic_fe_032.png) }
+.nav5 { background-image : url(../img/ic_na_032.png) }
+.nav6 { background-image : url(../img/ic_zn_032.png) }
+
+nav {
+ -webkit-box-shadow : 0.5em 0.5em #777777;
+}
+
diff --git a/examples/webkit/webkit-guide/css/css3_shadowBlur.css b/examples/webkit/webkit-guide/css/css3_shadowBlur.css
new file mode 100755
index 0000000..f448927
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/css3_shadowBlur.css
@@ -0,0 +1,145 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ background : #aaaaaa;
+ font-family : sans-serif;
+}
+
+body > section {
+ border-radius : 1em;
+ padding : 1em;
+ background : #ffffff;
+ margin-bottom : 10em;
+ min-height : 70%;
+}
+
+.hidden {
+ display : none;
+}
+
+.active {
+ color : blue;
+ cursor : pointer;
+ text-decoration : none;
+}
+
+.nav > a {
+ display : inline-block;
+ width : 48px;
+ height : 48px;
+}
+
+h1, h2 {
+ margin-top : 0em;
+ font-size : 18px;
+ text-align : center;
+}
+
+h2 {
+ border-top : solid thin #aaaaaa;
+}
+
+body > section.main {
+ position : absolute;
+ left : 0em;
+ right : 0em;
+ top : 5em;
+ min-height : 50%;
+ border-radius : 0.5em;
+ background : #aaaaaa;
+ padding : 0;
+}
+
+section.main > article {
+ background : #ffffff;
+ padding : 1em;
+ margin : 1em 1em 10em 1em;
+ border-radius : 0.5em;
+}
+
+section.nav {
+ z-index : 10;
+ border-radius : 0;
+ background : #aaaaaa;
+ background : transparent;
+ position : absolute;;
+ padding : 1em;
+ top : 0;
+ right : 0.0em;
+ left : 0.0em;
+}
+
+nav {
+ padding : 0.5em;
+ border-radius : 0.5em;
+ background : #ffffff;
+ top : 10px;
+ text-align : justify;
+ height : 36px;
+ overflow : hidden;
+}
+
+nav > a {
+ display : inline-block;
+ background-repeat : no-repeat;
+ height : 36px;
+ width : 36px;
+}
+
+nav > a:active {
+ -webkit-transform : scale(0.8);
+}
+
+#force_justify {
+ padding-left : 100%;
+}
+
+.nav1 { background-image : url(../img/ic_he_032.png) }
+.nav2 { background-image : url(../img/ic_o_032.png) }
+.nav3 { background-image : url(../img/ic_ni_032.png) }
+.nav4 { background-image : url(../img/ic_fe_032.png) }
+.nav5 { background-image : url(../img/ic_na_032.png) }
+.nav6 { background-image : url(../img/ic_zn_032.png) }
+
+nav {
+ -webkit-box-shadow : 0.5em 0.5em 0.5em #444444;
+}
+
diff --git a/examples/webkit/webkit-guide/css/css3_text-overflow.css b/examples/webkit/webkit-guide/css/css3_text-overflow.css
new file mode 100755
index 0000000..ba491c4
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/css3_text-overflow.css
@@ -0,0 +1,119 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ background : #aaaaaa;
+ font-family : sans-serif;
+ font-weight : bold;
+}
+
+h1,h2,h3,h4 {
+ text-align : center;
+}
+
+section {
+ position : absolute;
+ top : 0;
+ left : 0;
+ right : 0;
+ bottom : 0;
+}
+
+article {
+ background : #ffffff;
+ border-radius : 1.0em;
+ padding : 1.0em;
+ margin : 1em;
+ min-height : 50%;
+}
+
+.accordion {
+ border : #777777 solid thin;
+ padding : 0.0em;
+ border-radius : 0.5em;
+ list-style : none;
+}
+
+.accordion > li {
+ padding : 0.5em;
+ border-bottom : #777777 solid thin;
+ white-space : nowrap;
+ max-height : 1.5em;
+ overflow : hidden;
+ text-overflow : clip;
+ text-overflow : ellipsis;
+ text-overflow : ellipsis-word;
+ -webkit-transition : max-height 1s ease-in-out;
+}
+
+.accordion > li:last-of-type {
+ border-bottom : none;
+}
+
+.accordion > li.selected {
+ -webkit-transition : max-height 1s ease-in-out;
+ max-height : 100em;
+ white-space : normal;
+ font-weight : normal;
+}
+
+.accordion > li.selected:first-line {
+ font-weight : bold;
+}
+
+.accordion > li.selected:first-letter {
+ font-size : 200%;
+ float : left;
+ padding-right : 0.1em;
+}
+
+.dismiss {
+ content : url(../img/icon_dismiss.png);
+}
+
+.accordion > li > .dismiss {
+ display : none;
+}
+
+.accordion > li.selected > .dismiss {
+ display : block;
+ float : right;
+}
+
diff --git a/examples/webkit/webkit-guide/css/css3_text-shadow.css b/examples/webkit/webkit-guide/css/css3_text-shadow.css
new file mode 100755
index 0000000..9f06662
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/css3_text-shadow.css
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ background : #aaaaaa;
+ font-family : sans-serif;
+}
+
+h1,h2,h3,h4 {
+ text-align : center;
+ text-shadow : 0.20em 0.20em 0.20em #999;
+ color : #206ead;
+}
+
+section {
+ position : absolute;
+ top : 0;
+ left : 0;
+ right : 0;
+ bottom : 0;
+}
+
+article {
+ background : #ffffff;
+ border-radius : 1.0em;
+ padding : 1.0em;
+ margin : 1em;
+ min-height : 50%;
+}
+
diff --git a/examples/webkit/webkit-guide/css/css3_text-stroke.css b/examples/webkit/webkit-guide/css/css3_text-stroke.css
new file mode 100755
index 0000000..4116de8
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/css3_text-stroke.css
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ background : #aaaaaa;
+ font-family : sans-serif;
+}
+
+h1,h2,h3,h4 {
+ margin-top : 0.5em;
+ text-align : center;
+}
+
+h1 {
+ -webkit-text-stroke : 2px #000000;
+ font-size : 40px;
+}
+
+h1, h2, h3 {
+ color : #206ead;
+}
+
+section {
+ position : absolute;
+ top : 0;
+ left : 0;
+ right : 0;
+ bottom : 0;
+}
+
+article {
+ background : #ffffff;
+ border-radius : 1.0em;
+ padding : 1.0em;
+ margin : 1em;
+ min-height : 50%;
+}
+
diff --git a/examples/webkit/webkit-guide/css/form_tapper.css b/examples/webkit/webkit-guide/css/form_tapper.css
new file mode 100755
index 0000000..75142b5
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/form_tapper.css
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/* MOBILE UI */
+
+body {
+ background : #aaaaaa;
+ font-family : sans-serif;
+}
+
+body > section {
+ border-radius : 1em;
+ padding : 1em;
+ background : #ffffff;
+ margin : 1em 1em 10em 1em;
+ min-height : 70%
+}
+
+h1, h2 {
+ margin-top : 1em;
+ font-size : smaller;
+ text-align : center;
+ padding-top : 1em;
+}
+
+h2 {
+ border-top : solid thin #dddddd;
+}
+
+/* FORM */
+
+form {
+ font-weight : bold;
+ font-size : small;
+}
+
+input[type=radio],
+input[type=checkbox] {
+ -webkit-appearance : button;
+ float : right;
+ margin-bottom : -2em;
+ opacity : 0;
+}
+
+label,
+input[type=radio],
+input[type=checkbox] {
+ width : 90%;
+ display : block;
+ padding : 0.5em;
+ height : 2em;
+}
+
+label {
+ padding-top : 0.5em;
+ border : medium solid #aaaaaa;
+ border-radius : 1.0em;
+}
+
+input[type=radio]:checked + label,
+input[type=checkbox]:checked + label {
+ border : medium solid green;
+}
+
+input[type=radio]:checked + label:after,
+input[type=checkbox]:checked + label:after {
+ float : right;
+ padding-right : 0.5em;
+ content : url(../img/icon_check_x24green.png);
+}
+
diff --git a/examples/webkit/webkit-guide/css/form_toggler.css b/examples/webkit/webkit-guide/css/form_toggler.css
new file mode 100755
index 0000000..224053f
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/form_toggler.css
@@ -0,0 +1,200 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/* MOBILE UI */
+
+body {
+ background : #aaaaaa;
+ font-family : sans-serif;
+}
+
+body > section {
+ border-radius : 1em;
+ padding : 1em;
+ background : #ffffff;
+ margin : 1em 1em 10em 1em;
+ min-height : 70%
+}
+
+h1, h2 {
+ margin-top : 1em;
+ font-size : smaller;
+ text-align : center;
+ padding-top : 1em;
+}
+
+h2 {
+ border-top : solid thin #dddddd;
+}
+
+ /* FORM */
+
+form
+{
+ line-height : 250%;
+ font-weight : bold;
+ font-size : small;
+}
+
+ /* DEFAULT INPUT */
+
+input[type=radio],
+input[type=checkbox]
+{
+ text-align : right;
+ padding-top : 0.1em;
+ text-transform : uppercase;
+ float : right;
+ -webkit-appearance : button;
+ border : 0.25em #aaaaaa solid;
+ background : #aaaaaa;
+ background : -webkit-gradient(linear,center top,center bottom,from(#999999),to(#ffffff));
+ border-radius : 0.5em;
+ min-width : 6em;
+ height : 2em;
+ display : inline-block;
+}
+
+ /* CHECKED INPUT */
+
+input[type=radio]:checked,
+input[type=checkbox]:checked
+{
+ text-align : left;
+}
+
+ /* FLIPPED INPUT */
+
+input.invert
+{
+ text-align : left;
+}
+
+input.invert:checked
+{
+ text-align : right;
+}
+
+ /* DEFAULT TEXT */
+
+input[type=radio]:before,
+input[type=checkbox]:before
+{
+ color : #888888;
+ height : 1.4em;
+ display : inline-block;
+ background : pink;
+ background : -webkit-gradient(linear,center top,center bottom,from(pink),to(#ffffff));
+ min-width : 50%;
+ content : "off";
+ text-align : center;
+ font-weight : bold;
+ padding-left : 0.5em;
+ padding-right : 0.5em;
+ border-radius : 0.25em;
+}
+
+ /* CHECKED TEXT */
+
+input[type=radio]:checked:before,
+input[type=checkbox]:checked:before
+{
+ color : #ffffff;
+ content : "on";
+ background : #00aa00;
+ background : -webkit-gradient(linear,center top,center bottom,from(green),to(cyan));
+}
+
+ /* ALTERNATE DISPLAY */
+
+input.yn:before
+{
+ content : "no";
+}
+
+input.yn:checked:before
+{
+ content : "yes";
+}
+
+input.tf:before
+{
+ content : "false";
+}
+
+input.tf:checked:before
+{
+ content : "true";
+}
+
+ /* BINARY */
+
+input.binary {
+ display : inline-block;
+}
+
+input.binary:checked {
+ display : none;
+}
+
+input.binary:before {
+ background : #00aa00;
+ background : -webkit-gradient(linear,center top,center bottom,from(green),to(cyan));
+ color : #ffffff;
+}
+
+input.binary:nth-of-type(odd) {
+ text-align : left;
+}
+
+input.binary:nth-of-type(even) {
+ text-align : right;
+}
+
+ /* CUSTOM */
+
+input.ampm:nth-of-type(odd):before { content : "am"; }
+input.ampm:nth-of-type(even):before { content : "pm"; }
+
+input.sex:nth-of-type(odd):before { content : "male"; }
+input.sex:nth-of-type(even):before { content : "female"; }
+
+input.sex { width : 8em }
+
diff --git a/examples/webkit/webkit-guide/css/layout_link-fmt.css b/examples/webkit/webkit-guide/css/layout_link-fmt.css
new file mode 100755
index 0000000..5a31aa0
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/layout_link-fmt.css
@@ -0,0 +1,137 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ background : #aaaaaa;
+ font-family : sans-serif;
+ font-weight : bold;
+}
+
+p {
+ font-weight : normal;
+}
+
+a {
+ text-wrap : suppress;
+ -webkit-text-wrap : suppress;
+}
+
+article {
+ background : #ffffff;
+ position : absolute;
+ top : 1em;
+ left : 1em;
+ right : 1em;
+ padding : 1em;
+ border-radius : 1em;
+ margin-bottom : 2em;
+}
+
+ol {
+ padding-left : 1em;
+}
+
+ol.links {
+ margin-bottom : 1em;
+ border : #aaaaaa thin solid;
+ list-style : none;
+ padding-top : 0.5em;
+ padding-bottom : 0.5em;
+ padding-left : 0em;
+ border-radius : 1.0em;
+}
+
+ol.links > li {
+ min-height : 2em;
+ border-bottom : #aaaaaa thin solid;
+ padding-left : 0.5em;
+ padding-right : 0.5em;
+ padding-top : 0.5em;
+}
+
+ol.links > li:last-of-type {
+ border : none;
+}
+
+p a[href]:after {
+ -webkit-transform : scale(0.6);
+ -webkit-transform-origin : bottom;
+ padding-left : 0.25em;
+ padding-right : 0.0em;
+ display : inline-block;
+}
+
+a[href] {
+ text-decoration : none;
+}
+
+ol.links > li > a {
+ display : block;
+}
+
+ol.links a:after {
+ -webkit-transform : scale(0.8);
+ -webkit-transform-origin : top;
+}
+
+a[href^="http://"]:after, a[href^="https://"]:after {
+ content : url(../img/icon_link-external.png);
+}
+
+a[href^="mailto:"]:after { content : url(../img/icon_link-email.png); }
+
+a[href^="sms:"]:after { content : url(../img/icon_link-sms.png); }
+
+a[href^="tel:"]:after { content : url(../img/icon_link-tel.png); }
+
+a[href$=".doc"]:after { content : url(../img/icon_link-doc.png); }
+
+a[href$=".ppt"]:after { content : url(../img/icon_link-ppt.png); }
+
+a[href$=".rss"]:after,
+a[href$=".xml"]:after { content : url(../img/icon_link-rss.png); }
+
+a[href$=".pdf"]:after { content : url(../img/icon_link-pdf.png); }
+
+a[href$=".xls"]:after { content : url(../img/icon_link-xls.png); }
+
+ol.links a:after {
+ float : right;
+}
diff --git a/examples/webkit/webkit-guide/css/layout_tbl-keyhole.css b/examples/webkit/webkit-guide/css/layout_tbl-keyhole.css
new file mode 100755
index 0000000..1205822
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/layout_tbl-keyhole.css
@@ -0,0 +1,147 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ background : #aaaaaa;
+ font-family : sans-serif;
+}
+
+.mobile {
+ display : block;
+}
+
+.mobile > thead > th,
+.mobile > thead > tr {
+ display : none;
+}
+
+.mobile > tbody > tr {
+ display : none;
+ background : #ffffff;
+ padding : 0.5em;
+ padding-top : 0.5em;
+ border-radius : 0.25em;
+}
+
+.mobile > tbody > tr:target {
+ display : block;
+ border : medium solid #aaaaaa;
+}
+
+.mobile > tbody > tr:nth-of-type(1) {
+ padding-top : 0.5em;
+}
+
+.mobile td {
+ display : block;
+}
+
+.mobile td:before {
+ font-style : italic;
+ font-weight : bold;
+}
+
+.mobile td:nth-of-type(5n+1) {
+ font-weight : bold;
+ color : #206ead;
+}
+
+.mobile td:nth-of-type(5n+2):before {
+ content : 'Price: ';
+}
+.mobile td:nth-of-type(5n+3):before {
+ content : 'Location: ';
+}
+.mobile td:nth-of-type(5n+4):before {
+ content : 'Posted: ';
+}
+
+table th.nav {
+ display : none;
+}
+
+.mobile tbody th.nav {
+ display : block;
+ width : 36px;
+ float : right;
+}
+
+th.nav a {
+ display : inline-block;
+ width : 36px;
+ height : 36px;
+ background : #ffffff;
+ content : url(../img/icon_nav-up.png);
+ margin-bottom : 0.5em;
+}
+
+th.nav a:nth-of-type(even) {
+ -webkit-transform : rotate(180deg);
+}
+
+tr:first-of-type th.nav a:nth-of-type(odd),
+tr:last-of-type th.nav a:nth-of-type(even)
+{
+ content : url(../img/icon_dismiss.png);
+}
+
+tr th.nav a {
+ display : none;
+}
+
+tr:first-of-type th.nav a,
+tr:last-of-type th.nav a,
+tr:target th.nav a {
+ display : block;
+}
+
+article {
+ background : #ffffff;
+ border-radius : 0.5em;
+ margin : 0.5em;
+ padding : 0.5em;
+}
+
+h1 {
+ margin-top : 0.5em;
+ text-align : center;
+ font-size : 18px;
+}
+
diff --git a/examples/webkit/webkit-guide/css/mob_condjs.css b/examples/webkit/webkit-guide/css/mob_condjs.css
new file mode 100755
index 0000000..6e31292
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/mob_condjs.css
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#js {
+ background : pink;
+ padding : 0.5em;
+ border-radius : 0.5em;
+}
+#js, #design {
+ padding : 0.5em;
+ border-radius : 0.5em;
+}
+#js {
+ background : pink;
+}
+#design {
+ background : lightgreen;
+}
diff --git a/examples/webkit/webkit-guide/css/mob_mediaquery.css b/examples/webkit/webkit-guide/css/mob_mediaquery.css
new file mode 100755
index 0000000..bbd0fbc
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/mob_mediaquery.css
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#design {
+ padding : 0.5em;
+ border-radius : 0.5em;
+ background : lightgreen;
+}
+
+#design {
+ background : lightgreen;
+}
diff --git a/examples/webkit/webkit-guide/css/mobile.css b/examples/webkit/webkit-guide/css/mobile.css
new file mode 100755
index 0000000..5b9332c
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/mobile.css
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ background : #aaaaaa;
+ font-family : sans-serif;
+ width : 100;
+}
+
+body > section {
+ border-radius : 1em;
+ background : #ffffff;
+ border-radius : 1em;
+ padding : 1em;
+ background : #ffffff;
+ min-height : 70%
+}
+
+.hidden {
+ display : none;
+}
+
+.active {
+ color : blue;
+ cursor : pointer;
+ text-decoration : none;
+}
+
+.nav > a {
+ display : inline-block;
+ width : 48px;
+ height : 48px;
+}
+
+h1, h2 {
+ margin-top : 1em;
+ font-size : smaller;
+ text-align : center;
+ padding-top : 1em;
+}
+
+h2 {
+ border-top : solid thin #dddddd;
+}
+
diff --git a/examples/webkit/webkit-guide/css/mq_desktop.css b/examples/webkit/webkit-guide/css/mq_desktop.css
new file mode 100755
index 0000000..32d49bf
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/mq_desktop.css
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ background : #aaaaaa;
+ font-family : sans-serif;
+ font-weight : bold;
+}
+
+h1,h2,h3,h4 {
+ text-align : center;
+}
+
+section {
+ position : absolute;
+ top : 0;
+ left : 0;
+ right : 0;
+ bottom : 0;
+}
+
+article {
+ background : #ffffff;
+ border-radius : 1.0em;
+ padding : 1.0em;
+ margin : 1em;
+ min-height : 50%;
+}
+
+#design:before {
+ content : "CSS thinks you are viewing this page with a full desktop browser."
+}
+
diff --git a/examples/webkit/webkit-guide/css/mq_mobile.css b/examples/webkit/webkit-guide/css/mq_mobile.css
new file mode 100755
index 0000000..f1e87f6
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/mq_mobile.css
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ background : #aaaaaa;
+ font-family : sans-serif;
+ font-weight : bold;
+}
+
+h1,h2,h3,h4 {
+ text-align : center;
+}
+
+section {
+ position : absolute;
+ top : 0;
+ left : 0;
+ right : 0;
+ bottom : 0;
+}
+
+article {
+ background : #ffffff;
+ border-radius : 1.0em;
+ padding : 1.0em;
+ margin : 1em;
+ min-height : 50%;
+}
+
+#design:before {
+ content : "CSS thinks you are viewing this page with a non-touch mobile browser."
+}
diff --git a/examples/webkit/webkit-guide/css/mq_touch.css b/examples/webkit/webkit-guide/css/mq_touch.css
new file mode 100755
index 0000000..3d2a5b6
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/mq_touch.css
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ background : #aaaaaa;
+ font-family : sans-serif;
+ font-weight : bold;
+}
+
+h1,h2,h3,h4 {
+ text-align : center;
+}
+
+section {
+ position : absolute;
+ top : 0;
+ left : 0;
+ right : 0;
+ bottom : 0;
+}
+
+article {
+ background : #ffffff;
+ border-radius : 1.0em;
+ padding : 1.0em;
+ margin : 1em;
+ min-height : 50%;
+}
+
+#design:before {
+ content : "CSS thinks you are viewing this page with a touch-based mobile browser."
+}
diff --git a/examples/webkit/webkit-guide/css/mqlayout_desktop.css b/examples/webkit/webkit-guide/css/mqlayout_desktop.css
new file mode 100755
index 0000000..0875732
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/mqlayout_desktop.css
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/* Desktop UI */
+
+body {
+ font-family : sans-serif;
+ font-weight : bold;
+ min-width : 60em;
+}
+
+nav, body > section, header, footer {
+ border-radius : 0.5em;
+ padding : 0.5em;
+}
+
+nav, section {
+ min-height : 30em;
+}
+
+header {
+ background-color : pink;
+ height : 3em;
+ margin-bottom : 1em;
+}
+
+section#main {
+ background-color : lightgreen;
+ float : left;
+ margin-bottom : 1em;
+ margin-left : 2%;
+ min-width : 60%;
+}
+
+nav {
+ background-color : lightblue;
+ float : left;
+ margin-bottom : 1em;
+ width : 15%;
+}
+
+section#sidebar {
+ background-color : plum;
+ float : left;
+ margin-bottom : 1em;
+ margin-left : 2%;
+ width : 15%;
+}
+
+footer {
+ background-color : gold;
+ clear : both;
+ height : 3em;
+}
+
diff --git a/examples/webkit/webkit-guide/css/mqlayout_mobile.css b/examples/webkit/webkit-guide/css/mqlayout_mobile.css
new file mode 100755
index 0000000..dcd4943
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/mqlayout_mobile.css
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/* Mobile UI */
+
+body {
+ font-family : sans-serif;
+ font-weight : bold;
+}
+
+nav, body > section, header, footer {
+ padding : 0.5em;
+}
+
+header {
+ display : none;
+}
+
+section#main {
+ background-color : lightgreen;
+ margin-bottom : 1em;
+}
+
+nav:after {
+ float : right;
+ content : '[ICON]';
+}
+
+nav:before {
+ content : 'SIMPLE ';
+}
+
+nav {
+ background-color : lightblue;
+ margin-bottom : 1em;
+}
+
+section#sidebar {
+ display : none;
+}
+
+footer {
+ background-color : gold;
+}
+
diff --git a/examples/webkit/webkit-guide/css/mqlayout_touch.css b/examples/webkit/webkit-guide/css/mqlayout_touch.css
new file mode 100755
index 0000000..78ed174
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/mqlayout_touch.css
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/* Touch UI */
+
+body {
+ font-family : sans-serif;
+ font-weight : bold;
+}
+
+nav, body > section, header, footer {
+ border-radius : 0.5em;
+ padding : 0.5em;
+}
+
+header {
+ background-color : pink;
+ margin-bottom : 1em;
+ float : left;
+ width : 30%;
+ height : 3em;
+}
+
+section#main {
+ background-color : lightgreen;
+ margin-bottom : 1em;
+ min-height : 20em;
+}
+
+nav:before {
+ content : 'TOUCH ';
+}
+
+nav {
+ background-color : lightblue;
+ margin-bottom : 1em;
+ margin-left : 40%;
+ max-width : 60%;
+ height : 3em;
+}
+
+section#sidebar {
+ display : none;
+}
+
+footer {
+ background-color : gold;
+}
+
diff --git a/examples/webkit/webkit-guide/css/storage.css b/examples/webkit/webkit-guide/css/storage.css
new file mode 100755
index 0000000..a1f1a13
--- /dev/null
+++ b/examples/webkit/webkit-guide/css/storage.css
@@ -0,0 +1,156 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+body {
+ background-color : #aaaaaa;
+ font-family : sans-serif;
+ padding: 1em;
+}
+
+body.off > h1 {
+ background-color : pink;
+ background-image : url(../img/offline.png), -webkit-gradient(linear,center top,center bottom,from(#ffffff),to(#ffffff))
+;
+}
+
+body.on > h1 {
+ background-color : lightgreen;
+ background-image : url(../img/online.png), -webkit-gradient(linear,center top,center bottom,from(#ffffff),to(#ffffff))
+;
+}
+
+body.unknown > h1 {
+ background-image : url(../img/offline_idle.png), -webkit-gradient(linear,center top,center bottom,from(#ffffff),to(#ffffff));
+}
+
+
+h1 {
+ background-color : #ffffff;
+ background-repeat : no-repeat;
+ background-position : 0.5em center, 0 0;
+ height : 1.25em;
+ border-radius : 0.5em;
+ margin : 0.0em;
+ padding : 0.5em;
+ text-align : center;
+ font-size : 18px;
+}
+
+form.show {
+ display : block;
+ z-index : 99;
+}
+
+form.hide {
+ display : none;
+}
+
+#cred {
+ background : #ffffff;
+ padding : 1em;
+ border-radius : 1.0em;
+ position : absolute;
+ left : 1.0em;;
+ right : 1.0em;;
+ top : 1.0em;;
+ bottom : 1.0em;;
+}
+
+#cred > input, #email > input {
+ height : 2.0em;
+ width : 95%;
+ border-radius : 0.5em;
+ padding-left : 0.5em;
+}
+
+#cred > img {
+ float : right;
+}
+
+#cred > div:first-of-type {
+ margin-top : 2em;
+}
+
+#cred > div, #email > div {
+ font-weight : bold;
+ margin : 0.5em;
+}
+
+#cred > input[type='submit'] {
+ background : lightgreen;
+ font-weight : bold;
+}
+
+#cred > input[type='submit']:active {
+ background : #777777;
+ color : #ffffff;
+}
+
+#cred > input.validate:invalid {
+ background : pink;
+}
+
+#cred > input.validate:invalid:after {
+ content : "need!";
+}
+
+#cred > input {
+ background : #ffffff;
+ -webkit-transition : all 1s linear;
+}
+
+#openform {
+ float : right;
+}
+
+#email {
+ background : #ffffff;
+ min-height : 6em;
+ margin-top : 1em;
+ border-radius : 0.5em;
+ padding : 0.5em;
+}
+
+textarea {
+ min-height : 10em;
+ width : 95%;
+ border-radius : 0.5em;
+}
+
diff --git a/examples/webkit/webkit-guide/css3_backgrounds.htm b/examples/webkit/webkit-guide/css3_backgrounds.htm
new file mode 100644
index 0000000..0739830
--- /dev/null
+++ b/examples/webkit/webkit-guide/css3_backgrounds.htm
@@ -0,0 +1,87 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Accordion Tabs</title>
+<link href='css/css3_backgrounds.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<h3>Accordion Tabs</h3>
+<dl class="accordion">
+<dt>Option 1</dt>
+<dd>
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
+eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
+minim veniam, quis nostrud exercitation ullamco laboris nisi ut
+aliquip ex ea commodo consequat.
+</dd>
+<dt>Option 2</dt>
+<dd>
+Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
+nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet,
+consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
+labore et dolore magna aliqua.
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
+eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
+minim veniam, quis nostrud exercitation ullamco laboris nisi ut
+aliquip ex ea commodo consequat.
+</dd>
+<dt>Option 3</dt>
+<dd>
+Lorem ipsum dolor sit amet, quis nostrud exercitation ullamco laboris
+nisi ut aliquip ex ea commodo consequat.
+</dd>
+<dt>Option 4</dt>
+<dd>
+Lorem ipsum dolor sit amet, sed do eiusmod tempor incididunt ut labore
+et dolore magna aliqua. Ut enim ad minim veniam, consectetur
+adipisicing elit, quis nostrud exercitation ullamco laboris nisi ut
+aliquip ex ea commodo consequat. Consectetur adipisicing elit, ut
+enim ad minim veniam, sed do eiusmod tempor incididunt ut labore et
+dolore magna aliqua.
+</dd>
+</dl>
+<script src="js/css3_backgrounds.js"></script>
+<script src="js/mobile.js"></script>
+</body>
+</html>
+
diff --git a/examples/webkit/webkit-guide/css3_border-img.htm b/examples/webkit/webkit-guide/css3_border-img.htm
new file mode 100644
index 0000000..b991104
--- /dev/null
+++ b/examples/webkit/webkit-guide/css3_border-img.htm
@@ -0,0 +1,78 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>border-image</title>
+<link href='css/css3_border-img.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section>
+<article>
+<h3>border-image</h3>
+
+<p>
+Praesent luctus, risus eu vestibulum mollis, arcu mauris
+mollis ante.
+</p>
+
+<div class="fruit">
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
+gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
+ac tellus.
+
+</div>
+
+<p>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
+gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
+ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
+mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
+sed nibh faucibus pellentesque.
+</p>
+
+</article>
+</section>
+<script src="js/css3_border-img.js"></script>
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/css3_grad-radial.htm b/examples/webkit/webkit-guide/css3_grad-radial.htm
new file mode 100644
index 0000000..3bbb7f0
--- /dev/null
+++ b/examples/webkit/webkit-guide/css3_grad-radial.htm
@@ -0,0 +1,61 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Radial Gradient</title>
+<link href='css/css3_grad-radial.css' type='text/css' rel='stylesheet'/>
+<style id="localStyles"></style>
+</head>
+<body>
+<section>
+<article id="main">
+<h3>Radial Gradient</h3>
+
+Touch within the main content area.
+
+</article>
+</section>
+<script src="js/css3_grad-radial.js">
+</script>
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/css3_gradientBack.htm b/examples/webkit/webkit-guide/css3_gradientBack.htm
new file mode 100644
index 0000000..1d025cf
--- /dev/null
+++ b/examples/webkit/webkit-guide/css3_gradientBack.htm
@@ -0,0 +1,79 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Background Gradient</title>
+<link href='css/css3_gradientBack.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section>
+<article>
+<h4>Background Gradient</h4>
+<p>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
+gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
+ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
+mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
+sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
+urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
+felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
+turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
+venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
+at neque.
+</p>
+<p>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
+gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
+ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
+mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
+sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
+urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
+felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
+turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
+venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
+at neque.
+</p>
+</article>
+</section>
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/css3_gradientBackStop.htm b/examples/webkit/webkit-guide/css3_gradientBackStop.htm
new file mode 100644
index 0000000..4558fe3
--- /dev/null
+++ b/examples/webkit/webkit-guide/css3_gradientBackStop.htm
@@ -0,0 +1,92 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Background Gradient + stop-color</title>
+<link href='css/css3_gradientBackStop.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section>
+<article>
+<h4>Background Gradient<br/>with stop-color</h4>
+
+<p>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
+gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
+ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
+mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
+sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
+urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
+felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
+turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
+venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
+at neque.
+</p>
+<p>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
+gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
+ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
+mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
+sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
+urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
+felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
+turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
+venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
+at neque.
+</p><p>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
+gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
+ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
+mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
+sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
+urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
+felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
+turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
+venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
+at neque.
+</p>
+
+</article>
+</section>
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/css3_gradientButton.htm b/examples/webkit/webkit-guide/css3_gradientButton.htm
new file mode 100644
index 0000000..c765e45
--- /dev/null
+++ b/examples/webkit/webkit-guide/css3_gradientButton.htm
@@ -0,0 +1,66 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Beveled Buttons</title>
+<link href='css/css3_gradientButton.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<article>
+<h3>Beveled Buttons</h3>
+<ul>
+<li><a href="#">Option 1</a></li>
+<li><a href="#">Option 2</a></li>
+<li><a href="#">Option 3</a></li>
+<li><a href="#">Option 4</a></li>
+<li><a href="#">Option 5</a></li>
+<li><a href="#">Option 6</a></li>
+<li><a href="#">Option 7</a></li>
+<li><a href="#">Option 8</a></li>
+<li><a href="#">Option 9</a></li>
+</ul>
+<p>&nbsp;</p>
+
+</article>
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/css3_mask-grad.htm b/examples/webkit/webkit-guide/css3_mask-grad.htm
new file mode 100644
index 0000000..9014e5d
--- /dev/null
+++ b/examples/webkit/webkit-guide/css3_mask-grad.htm
@@ -0,0 +1,66 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Webkit Masks</title>
+<link href='css/css3_mask-grad.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section>
+<article>
+<h3>Webkit Masks</h3>
+
+<img src="img/tnail_gal1.png"/>
+<img src="img/tnail_gal2.png"/>
+<img src="img/tnail_gal3.png"/>
+<img src="img/tnail_gal4.png"/>
+<img src="img/tnail_gal5.png"/>
+<img src="img/tnail_gal6.png"/>
+<img src="img/tnail_gal7.png"/>
+<img src="img/tnail_gal8.png"/>
+
+</article>
+</section>
+<script src="js/css3_mask-grad.js"></script>
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/css3_mask-img.htm b/examples/webkit/webkit-guide/css3_mask-img.htm
new file mode 100644
index 0000000..c102e96
--- /dev/null
+++ b/examples/webkit/webkit-guide/css3_mask-img.htm
@@ -0,0 +1,56 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Webkit Masks</title>
+<link href='css/css3_mask-img.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section>
+<article>
+<img src="img/gal3.jpg" width="240" height="360"/>
+</article>
+</section>
+<script src="js/css3_mask-img.js"></script>
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/css3_multicol.htm b/examples/webkit/webkit-guide/css3_multicol.htm
new file mode 100644
index 0000000..4b3fb6a
--- /dev/null
+++ b/examples/webkit/webkit-guide/css3_multicol.htm
@@ -0,0 +1,91 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Animated Banners</title>
+<link href='css/css3_multicol.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section>
+<article>
+<h3>Animated Banners</h3>
+<p>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
+gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
+ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
+mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
+sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
+urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
+felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
+turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
+venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
+at neque.
+<p>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
+gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
+ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
+mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
+sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
+urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
+felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
+turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
+venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
+at neque.
+
+</article>
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
+<br/>
+</section>
+
+<nav class="ad">
+<a href="#">Item #1</a><a href="#">Item #2</a><a href="#">Item #3</a><a href="#">Item #4</a><a href="#">Item #5</a>
+</nav>
+
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/css3_reflect.htm b/examples/webkit/webkit-guide/css3_reflect.htm
new file mode 100644
index 0000000..97e6ee2
--- /dev/null
+++ b/examples/webkit/webkit-guide/css3_reflect.htm
@@ -0,0 +1,100 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Webkit Reflections</title>
+<link href='css/css3_reflect.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section class="main">
+<article>
+<h1>Webkit Reflections</h1>
+<p>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
+gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
+ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
+mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
+sed nibh faucibus pellentesque.
+</p>
+
+<figure>
+<img src="img/land5.jpg">
+</figure>
+
+<p>Aliquam erat volutpat. Mauris tempor, urna at dignissim
+pellentesque, velit lacus dictum sem, non porttitor felis nulla nec
+risus. Donec a massa felis, a congue purus. Nullam et turpis
+diam. Aenean vestibulum egestas metus, eu sodales dolor venenatis
+quis. Aenean augue orci, facilisis et convallis ut, egestas at neque.
+</p>
+
+<h2>Webkit Reflections</h2>
+<p>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
+gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
+ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
+mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
+sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
+urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
+felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
+turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
+venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
+at neque.
+</p>
+<h3>Webkit Reflections</h3>
+<p>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
+gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
+ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
+mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
+sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
+urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
+felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
+turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
+venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
+at neque.
+</p>
+</article>
+</section>
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/css3_scroll.htm b/examples/webkit/webkit-guide/css3_scroll.htm
new file mode 100644
index 0000000..c2d3ea7
--- /dev/null
+++ b/examples/webkit/webkit-guide/css3_scroll.htm
@@ -0,0 +1,94 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Custom Scrollbars</title>
+<link href='css/css3_scroll.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section>
+<article>
+<h3>Custom Scrollbars</h3>
+
+<p>
+Unlike standard text, linebreaks cannot appear arbitrarily within
+blocks of code. Wide lines may be difficult to read within a
+narrow-screen mobile interface:
+</p>
+
+<pre>
+window.onload = function() {
+ var aside = document.querySelector('#related');
+ document.querySelector('#main').addEventListener('mouseup', function(event){
+ var thresholdDec = 0.5;
+ var totalHeight = event.currentTarget.scrollHeight;
+ var tapHeight = event.layerY;
+ var tapHeightDec = tapHeight / totalHeight;
+ var minHeight = 360;
+ if ( tapHeight < minHeight ) aside.className = '';
+ if (tapHeightDec > thresholdDec ) {
+ aside.className = 'visible';
+ }
+ else {
+ aside.className = '';
+ }
+ });
+};
+</pre>
+
+<p>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
+gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
+ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
+mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
+sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
+urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
+felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
+turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
+venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
+at neque.
+</p>
+
+</article>
+</section>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/css3_sel-nth.htm b/examples/webkit/webkit-guide/css3_sel-nth.htm
new file mode 100644
index 0000000..29f0605
--- /dev/null
+++ b/examples/webkit/webkit-guide/css3_sel-nth.htm
@@ -0,0 +1,80 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>CSS-only Grid Layout</title>
+<link href='css/css3_sel-nth.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section>
+<article>
+
+<img src="img/ic_ag_048.png"/>
+<img src="img/ic_al_048.png"/>
+<img src="img/ic_ar_048.png"/>
+<img src="img/ic_be_048.png"/>
+<img src="img/ic_b_048.png"/>
+<img src="img/ic_ca_048.png"/>
+<img src="img/ic_cl_048.png"/>
+<img src="img/ic_cu_048.png"/>
+<img src="img/ic_c_048.png"/>
+<img src="img/ic_fe_048.png"/>
+<img src="img/ic_f_048.png"/>
+<img src="img/ic_he_048.png"/>
+<img src="img/ic_h_048.png"/>
+<img src="img/ic_k_048.png"/>
+<img src="img/ic_li_048.png"/>
+<img src="img/ic_mg_048.png"/>
+<img src="img/ic_na_048.png"/>
+<img src="img/ic_ne_048.png"/>
+<img src="img/ic_ni_048.png"/>
+<img src="img/ic_n_048.png"/>
+<img src="img/ic_o_048.png"/>
+<img src="img/ic_pt_048.png"/>
+<img src="img/ic_si_048.png"/>
+<img src="img/ic_zn_048.png"/>
+
+</article>
+</section>
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/css3_shadow.htm b/examples/webkit/webkit-guide/css3_shadow.htm
new file mode 100644
index 0000000..7028047
--- /dev/null
+++ b/examples/webkit/webkit-guide/css3_shadow.htm
@@ -0,0 +1,78 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Navigation Icon Feedback</title>
+<link href='css/css3_shadow.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section class="nav">
+<nav>
+<a class="nav1" href="#"></a>
+<a class="nav2" href="#"></a>
+<a class="nav3" href="#"></a>
+<a class="nav4" href="#"></a>
+<a class="nav5" href="#"></a>
+<a class="nav6" href="#"></a>
+<span id="force_justify">&nbsp;</span>
+</nav>
+</section>
+<section class="main">
+<article>
+<h1>Navigation Icon Feedback</h1>
+<p>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
+gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
+ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
+mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
+sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
+urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
+felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
+turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
+venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
+at neque.
+</p>
+</article>
+</section>
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/css3_text-overflow.htm b/examples/webkit/webkit-guide/css3_text-overflow.htm
new file mode 100644
index 0000000..d56ac77
--- /dev/null
+++ b/examples/webkit/webkit-guide/css3_text-overflow.htm
@@ -0,0 +1,117 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>text-overflow</title>
+<link href='css/css3_text-overflow.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section>
+<article>
+<h3>text-overflow</h3>
+
+<ul class="accordion">
+<li id="l1">
+<div class="dismiss"></div>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
+gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
+ac tellus. Mauris tempor, urna at dignissim pellentesque, velit lacus
+dictum sem, non porttitor felis nulla nec risus.
+</li>
+<li id="l2">
+<div class="dismiss"></div>
+Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis ante,
+id mollis risus lectus ornare nisl. Aenean elementum arcu sed nibh
+faucibus pellentesque. Aliquam erat volutpat. Donec a massa felis, a
+congue purus. Nullam et turpis diam. Aenean vestibulum egestas metus,
+eu sodales dolor venenatis quis. Aenean augue orci, facilisis et
+convallis ut, egestas at neque.
+</li>
+<li id="l3">
+<div class="dismiss"></div>
+Donec a massa felis, a congue purus. Nullam et turpis diam. Aenean
+vestibulum egestas metus, eu sodales dolor venenatis quis. Aenean
+augue orci, facilisis et convallis ut, egestas at neque. Lorem ipsum
+dolor sit amet, consectetur adipiscing elit. Donec feugiat gravida
+viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus ac
+tellus.
+</li>
+<li id="l4">
+<div class="dismiss"></div>
+Aenean vestibulum egestas metus, eu sodales dolor venenatis quis.
+Aenean augue orci, facilisis et convallis ut, egestas at neque.
+Vivamus ipsum felis, cursus sed venenatis nec, tempus ac tellus.
+Donec a massa felis, a congue purus.
+</li>
+<li id="l5">
+<div class="dismiss"></div>
+Nullam et turpis diam. Vivamus ipsum felis, cursus sed venenatis nec,
+tempus ac tellus. Lorem ipsum dolor sit amet, consectetur adipiscing
+elit. Donec a massa felis, a congue purus. Aenean vestibulum egestas
+metus, eu sodales dolor venenatis quis. Donec feugiat gravida
+viverra. Praesent luctus, risus eu vestibulum mollis, arcu mauris
+mollis ante, id mollis risus lectus ornare nisl.
+</li>
+<li id="l6">
+<div class="dismiss"></div>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+Vivamus ipsum felis, cursus sed venenatis nec, tempus ac tellus.
+Aenean elementum arcu sed nibh faucibus pellentesque. Aliquam erat
+volutpat.
+Donec a massa felis, a congue purus.
+Aenean vestibulum egestas metus, eu sodales dolor venenatis quis.
+</li>
+<li id="l7">
+<div class="dismiss"></div>
+Donec feugiat gravida viverra. Praesent luctus, risus eu vestibulum
+mollis, arcu mauris mollis ante, id mollis risus lectus ornare nisl.
+Aliquam erat volutpat. Nullam et turpis diam. Aenean augue orci,
+facilisis et convallis ut, egestas at neque.
+</li>
+</ul>
+
+</article>
+</section>
+<script src="js/css3_text-overflow.js"></script>
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/css3_text-shadow.htm b/examples/webkit/webkit-guide/css3_text-shadow.htm
new file mode 100644
index 0000000..60e2d22
--- /dev/null
+++ b/examples/webkit/webkit-guide/css3_text-shadow.htm
@@ -0,0 +1,74 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Text Shadow</title>
+<link href='css/css3_text-shadow.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section>
+<article>
+<h1>Text Shadow</h1>
+<p>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
+gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
+ac tellus.
+</p>
+<h2>Subhead</h2>
+<p>
+Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis ante,
+id mollis risus lectus ornare nisl. Aenean elementum arcu sed nibh
+faucibus pellentesque. Aliquam erat volutpat. Mauris tempor, urna at
+dignissim pellentesque, velit lacus dictum sem, non porttitor felis
+nulla nec risus. Donec a massa felis, a congue purus. Nullam et turpis
+diam.
+</p>
+<h3>Subhead</h3>
+<p>
+Aenean vestibulum egestas metus, eu sodales dolor venenatis
+quis. Aenean augue orci, facilisis et convallis ut, egestas at neque.
+</p>
+</article>
+</section>
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/css3_text-stroke.htm b/examples/webkit/webkit-guide/css3_text-stroke.htm
new file mode 100644
index 0000000..25dfb1c
--- /dev/null
+++ b/examples/webkit/webkit-guide/css3_text-stroke.htm
@@ -0,0 +1,74 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Text Stroke</title>
+<link href='css/css3_text-stroke.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section>
+<article>
+<h1>Text Stroke</h1>
+<p>
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
+gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
+ac tellus.
+</p>
+<h2>Subhead</h2>
+<p>
+Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis ante,
+id mollis risus lectus ornare nisl. Aenean elementum arcu sed nibh
+faucibus pellentesque. Aliquam erat volutpat. Mauris tempor, urna at
+dignissim pellentesque, velit lacus dictum sem, non porttitor felis
+nulla nec risus. Donec a massa felis, a congue purus. Nullam et turpis
+diam.
+</p>
+<h3>Subhead</h3>
+<p>
+Aenean vestibulum egestas metus, eu sodales dolor venenatis
+quis. Aenean augue orci, facilisis et convallis ut, egestas at neque.
+</p>
+</article>
+</section>
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/form_tapper.htm b/examples/webkit/webkit-guide/form_tapper.htm
new file mode 100644
index 0000000..94751dc
--- /dev/null
+++ b/examples/webkit/webkit-guide/form_tapper.htm
@@ -0,0 +1,74 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>CSS-only Tap Button Inputs</title>
+<link href='css/form_tapper.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section>
+<h1>CSS-only Tap Button Inputs</h1>
+<form>
+<h2>radio</h2>
+<input type="radio" name="radio_basic" value="one"/>
+<label>Option One</label>
+<br/>
+<input type="radio" name="radio_basic" value="two"/>
+<label>Option Two</label>
+<br/>
+<input type="radio" name="radio_basic" value="three"/>
+<label>Option Three</label>
+<h2>checkbox</h2>
+<input type="checkbox" name="checkbox_basic" value="one"/>
+<label>Option One</label>
+<br/>
+<input type="checkbox" name="checkbox_basic" value="two"/>
+<label>Option Two</label>
+<br/>
+<input type="checkbox" name="checkbox_basic" value="three"/>
+<label>Option Three</label>
+</form>
+</section>
+<script src="js/form_tapper.js"></script>
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/form_toggler.htm b/examples/webkit/webkit-guide/form_toggler.htm
new file mode 100644
index 0000000..f4b1702
--- /dev/null
+++ b/examples/webkit/webkit-guide/form_toggler.htm
@@ -0,0 +1,140 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>CSS-only Toggle Button Inputs</title>
+<link href='css/form_toggler.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section>
+<h1>CSS-only Toggle Button Inputs</h1>
+<form>
+<h2>radio (default)</h2>
+<label>Option One</label>
+<input type="radio" name="radio_basic" value="one"/>
+<br/>
+<label>Option Two</label>
+<input type="radio" name="radio_basic" value="two"/>
+<br/>
+<label>Option Three</label>
+<input type="radio" name="radio_basic" value="three"/>
+<h2>checkbox (default)</h2>
+<input type="checkbox" name="checkbox_basic" value="one"/>
+<label>Option One</label>
+<br/>
+<input type="checkbox" name="checkbox_basic" value="two"/>
+<label>Option Two</label>
+<br/>
+<input type="checkbox" name="checkbox_basic" value="three"/>
+<label>Option Three</label>
+<h2>radio class="invert"</h2>
+<label>Option One</label>
+<input class="invert" type="radio" name="radio_invert" value="one"/>
+<br/>
+<label>Option Two</label>
+<input class="invert" type="radio" name="radio_invert" value="two"/>
+<br/>
+<label>Option Three</label>
+<input class="invert" type="radio" name="radio_invert" value="three"/>
+<h2>checkbox class="invert"</h2>
+<input class="invert" type="checkbox" name="checkbox_invert" value="one"/>
+<label>Option One</label>
+<br/>
+<input class="invert" type="checkbox" name="checkbox_invert" value="two"/>
+<label>Option Two</label>
+<br/>
+<input class="invert" type="checkbox" name="checkbox_invert" value="three"/>
+<label>Option Three</label>
+<h2>radio class="yn"</h2>
+<label>Option One</label>
+<input class="yn" type="radio" name="radio_yn" value="one"/>
+<br/>
+<label>Option Two</label>
+<input class="yn" type="radio" name="radio_yn" value="two"/>
+<br/>
+<label>Option Three</label>
+<input class="yn" type="radio" name="radio_yn" value="three"/>
+<h2>checkbox class="yn"</h2>
+<input class="yn" type="checkbox" name="checkbox_yn" value="one"/>
+<label>Option One</label>
+<br/>
+<input class="yn" type="checkbox" name="checkbox_yn" value="two"/>
+<label>Option Two</label>
+<br/>
+<input class="yn" type="checkbox" name="checkbox_yn" value="three"/>
+<label>Option Three</label>
+<h2>radio class="tf"</h2>
+<label>Option One</label>
+<input class="tf" type="radio" name="radio_tf" value="one"/>
+<br/>
+<label>Option Two</label>
+<input class="tf" type="radio" name="radio_tf" value="two"/>
+<br/>
+<label>Option Three</label>
+<input class="tf" type="radio" name="radio_tf" value="three"/>
+<h2>checkbox class="tf"</h2>
+<input class="tf" type="checkbox" name="checkbox_tf" value="one"/>
+<label>Option One</label>
+<br/>
+<input class="tf" type="checkbox" name="checkbox_tf" value="two"/>
+<label>Option Two</label>
+<br/>
+<input class="tf" type="checkbox" name="checkbox_tf" value="three"/>
+<label>Option Three</label>
+<h2>radio class="binary"</h2>
+<label>Time of Day</label>
+<input class="binary ampm" type="radio" name="radio_binary" value="am"/>
+<input class="binary ampm" type="radio" name="radio_binary" value="pm" checked/>
+<br/>
+<label>Sex</label>
+<input class="binary sex" type="radio" name="radio_sex" value="male" checked/>
+<input class="binary sex" type="radio" name="radio_sex" value="female"/>
+<br/>
+<br/>
+<p>(These use custom button values)</p>
+<br/>
+<br/>
+</form>
+</section>
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/img/border-frame.png b/examples/webkit/webkit-guide/img/border-frame.png
new file mode 100755
index 0000000..7a0894c
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/border-frame.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal1.jpg b/examples/webkit/webkit-guide/img/gal1.jpg
new file mode 100644
index 0000000..8f9edcb
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/gal1.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal2.jpg b/examples/webkit/webkit-guide/img/gal2.jpg
new file mode 100644
index 0000000..a2301ef
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/gal2.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal3.jpg b/examples/webkit/webkit-guide/img/gal3.jpg
new file mode 100644
index 0000000..a768530
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/gal3.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal4.jpg b/examples/webkit/webkit-guide/img/gal4.jpg
new file mode 100644
index 0000000..96c0001
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/gal4.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal5.jpg b/examples/webkit/webkit-guide/img/gal5.jpg
new file mode 100644
index 0000000..6ec78fc
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/gal5.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal6.jpg b/examples/webkit/webkit-guide/img/gal6.jpg
new file mode 100644
index 0000000..25eb95c
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/gal6.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal7.jpg b/examples/webkit/webkit-guide/img/gal7.jpg
new file mode 100644
index 0000000..b9fda2f
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/gal7.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal8.jpg b/examples/webkit/webkit-guide/img/gal8.jpg
new file mode 100644
index 0000000..c23e226
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/gal8.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gradient.jpg b/examples/webkit/webkit-guide/img/gradient.jpg
new file mode 100755
index 0000000..014386e
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/gradient.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gray_icon_close.png b/examples/webkit/webkit-guide/img/gray_icon_close.png
new file mode 100755
index 0000000..8e74501
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/gray_icon_close.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ag_016.png b/examples/webkit/webkit-guide/img/ic_ag_016.png
new file mode 100755
index 0000000..bb961cb
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_ag_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ag_032.png b/examples/webkit/webkit-guide/img/ic_ag_032.png
new file mode 100755
index 0000000..edb051f
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_ag_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ag_036.png b/examples/webkit/webkit-guide/img/ic_ag_036.png
new file mode 100755
index 0000000..e555e92
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_ag_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ag_048.png b/examples/webkit/webkit-guide/img/ic_ag_048.png
new file mode 100755
index 0000000..d2d417d
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_ag_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_al_016.png b/examples/webkit/webkit-guide/img/ic_al_016.png
new file mode 100755
index 0000000..0f1c024
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_al_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_al_032.png b/examples/webkit/webkit-guide/img/ic_al_032.png
new file mode 100755
index 0000000..5727a51
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_al_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_al_036.png b/examples/webkit/webkit-guide/img/ic_al_036.png
new file mode 100755
index 0000000..7638277
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_al_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_al_048.png b/examples/webkit/webkit-guide/img/ic_al_048.png
new file mode 100755
index 0000000..9671d86
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_al_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ar_016.png b/examples/webkit/webkit-guide/img/ic_ar_016.png
new file mode 100755
index 0000000..fa91e96
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_ar_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ar_032.png b/examples/webkit/webkit-guide/img/ic_ar_032.png
new file mode 100755
index 0000000..d899c41
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_ar_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ar_036.png b/examples/webkit/webkit-guide/img/ic_ar_036.png
new file mode 100755
index 0000000..836593f
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_ar_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ar_048.png b/examples/webkit/webkit-guide/img/ic_ar_048.png
new file mode 100755
index 0000000..e1c77ac
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_ar_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_b_016.png b/examples/webkit/webkit-guide/img/ic_b_016.png
new file mode 100755
index 0000000..a0ebdf7
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_b_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_b_032.png b/examples/webkit/webkit-guide/img/ic_b_032.png
new file mode 100755
index 0000000..f5571f2
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_b_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_b_036.png b/examples/webkit/webkit-guide/img/ic_b_036.png
new file mode 100755
index 0000000..4aff7eb
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_b_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_b_048.png b/examples/webkit/webkit-guide/img/ic_b_048.png
new file mode 100755
index 0000000..b84434c
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_b_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_be_016.png b/examples/webkit/webkit-guide/img/ic_be_016.png
new file mode 100755
index 0000000..0297cd8
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_be_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_be_032.png b/examples/webkit/webkit-guide/img/ic_be_032.png
new file mode 100755
index 0000000..5c5b9cd
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_be_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_be_036.png b/examples/webkit/webkit-guide/img/ic_be_036.png
new file mode 100755
index 0000000..96ec4bb
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_be_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_be_048.png b/examples/webkit/webkit-guide/img/ic_be_048.png
new file mode 100755
index 0000000..afcdf18
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_be_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_c_016.png b/examples/webkit/webkit-guide/img/ic_c_016.png
new file mode 100755
index 0000000..a3cc4cf
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_c_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_c_032.png b/examples/webkit/webkit-guide/img/ic_c_032.png
new file mode 100755
index 0000000..404babe
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_c_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_c_036.png b/examples/webkit/webkit-guide/img/ic_c_036.png
new file mode 100755
index 0000000..78d7150
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_c_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_c_048.png b/examples/webkit/webkit-guide/img/ic_c_048.png
new file mode 100755
index 0000000..73462ad
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_c_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ca_016.png b/examples/webkit/webkit-guide/img/ic_ca_016.png
new file mode 100755
index 0000000..af4c37b
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_ca_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ca_032.png b/examples/webkit/webkit-guide/img/ic_ca_032.png
new file mode 100755
index 0000000..6ac8db4
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_ca_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ca_036.png b/examples/webkit/webkit-guide/img/ic_ca_036.png
new file mode 100755
index 0000000..19988c1
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_ca_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ca_048.png b/examples/webkit/webkit-guide/img/ic_ca_048.png
new file mode 100755
index 0000000..0349061
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_ca_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cl_016.png b/examples/webkit/webkit-guide/img/ic_cl_016.png
new file mode 100755
index 0000000..e9b421e
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_cl_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cl_032.png b/examples/webkit/webkit-guide/img/ic_cl_032.png
new file mode 100755
index 0000000..f5968d5
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_cl_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cl_036.png b/examples/webkit/webkit-guide/img/ic_cl_036.png
new file mode 100755
index 0000000..2a6721d
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_cl_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cl_048.png b/examples/webkit/webkit-guide/img/ic_cl_048.png
new file mode 100755
index 0000000..f32981f
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_cl_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cu_016.png b/examples/webkit/webkit-guide/img/ic_cu_016.png
new file mode 100755
index 0000000..129f99f
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_cu_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cu_032.png b/examples/webkit/webkit-guide/img/ic_cu_032.png
new file mode 100755
index 0000000..a07933e
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_cu_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cu_036.png b/examples/webkit/webkit-guide/img/ic_cu_036.png
new file mode 100755
index 0000000..5eb6ed6
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_cu_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cu_048.png b/examples/webkit/webkit-guide/img/ic_cu_048.png
new file mode 100755
index 0000000..f21593c
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_cu_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_f_016.png b/examples/webkit/webkit-guide/img/ic_f_016.png
new file mode 100755
index 0000000..ff2e3fb
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_f_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_f_032.png b/examples/webkit/webkit-guide/img/ic_f_032.png
new file mode 100755
index 0000000..3424799
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_f_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_f_036.png b/examples/webkit/webkit-guide/img/ic_f_036.png
new file mode 100755
index 0000000..019b703
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_f_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_f_048.png b/examples/webkit/webkit-guide/img/ic_f_048.png
new file mode 100755
index 0000000..567d303
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_f_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_fe_016.png b/examples/webkit/webkit-guide/img/ic_fe_016.png
new file mode 100755
index 0000000..e6d9b82
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_fe_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_fe_032.png b/examples/webkit/webkit-guide/img/ic_fe_032.png
new file mode 100755
index 0000000..f2b4e4b
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_fe_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_fe_036.png b/examples/webkit/webkit-guide/img/ic_fe_036.png
new file mode 100755
index 0000000..2aa81b5
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_fe_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_fe_048.png b/examples/webkit/webkit-guide/img/ic_fe_048.png
new file mode 100755
index 0000000..b691473
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_fe_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_h_016.png b/examples/webkit/webkit-guide/img/ic_h_016.png
new file mode 100755
index 0000000..957a1ff
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_h_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_h_032.png b/examples/webkit/webkit-guide/img/ic_h_032.png
new file mode 100755
index 0000000..824620d
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_h_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_h_036.png b/examples/webkit/webkit-guide/img/ic_h_036.png
new file mode 100755
index 0000000..fba59a5
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_h_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_h_048.png b/examples/webkit/webkit-guide/img/ic_h_048.png
new file mode 100755
index 0000000..f75822c
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_h_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_he_016.png b/examples/webkit/webkit-guide/img/ic_he_016.png
new file mode 100755
index 0000000..33fe836
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_he_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_he_032.png b/examples/webkit/webkit-guide/img/ic_he_032.png
new file mode 100755
index 0000000..425c525
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_he_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_he_036.png b/examples/webkit/webkit-guide/img/ic_he_036.png
new file mode 100755
index 0000000..a976aec
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_he_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_he_048.png b/examples/webkit/webkit-guide/img/ic_he_048.png
new file mode 100755
index 0000000..f8f9d4d
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_he_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_k_016.png b/examples/webkit/webkit-guide/img/ic_k_016.png
new file mode 100755
index 0000000..860bd62
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_k_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_k_032.png b/examples/webkit/webkit-guide/img/ic_k_032.png
new file mode 100755
index 0000000..a14f2c6
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_k_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_k_036.png b/examples/webkit/webkit-guide/img/ic_k_036.png
new file mode 100755
index 0000000..49f19e6
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_k_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_k_048.png b/examples/webkit/webkit-guide/img/ic_k_048.png
new file mode 100755
index 0000000..a7515cd
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_k_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_li_016.png b/examples/webkit/webkit-guide/img/ic_li_016.png
new file mode 100755
index 0000000..c16d81a
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_li_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_li_032.png b/examples/webkit/webkit-guide/img/ic_li_032.png
new file mode 100755
index 0000000..3a34f37
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_li_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_li_036.png b/examples/webkit/webkit-guide/img/ic_li_036.png
new file mode 100755
index 0000000..e5b97a7
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_li_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_li_048.png b/examples/webkit/webkit-guide/img/ic_li_048.png
new file mode 100755
index 0000000..7b030e4
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_li_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_mg_016.png b/examples/webkit/webkit-guide/img/ic_mg_016.png
new file mode 100755
index 0000000..2606336
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_mg_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_mg_032.png b/examples/webkit/webkit-guide/img/ic_mg_032.png
new file mode 100755
index 0000000..2f9d03e
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_mg_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_mg_036.png b/examples/webkit/webkit-guide/img/ic_mg_036.png
new file mode 100755
index 0000000..584078d
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_mg_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_mg_048.png b/examples/webkit/webkit-guide/img/ic_mg_048.png
new file mode 100755
index 0000000..8cd2f3a
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_mg_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_n_016.png b/examples/webkit/webkit-guide/img/ic_n_016.png
new file mode 100755
index 0000000..90e8f9f
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_n_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_n_032.png b/examples/webkit/webkit-guide/img/ic_n_032.png
new file mode 100755
index 0000000..afeb47a
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_n_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_n_036.png b/examples/webkit/webkit-guide/img/ic_n_036.png
new file mode 100755
index 0000000..0b7a11d
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_n_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_n_048.png b/examples/webkit/webkit-guide/img/ic_n_048.png
new file mode 100755
index 0000000..c0d7c06
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_n_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_na_016.png b/examples/webkit/webkit-guide/img/ic_na_016.png
new file mode 100755
index 0000000..7888d0f
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_na_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_na_032.png b/examples/webkit/webkit-guide/img/ic_na_032.png
new file mode 100755
index 0000000..801ddca
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_na_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_na_036.png b/examples/webkit/webkit-guide/img/ic_na_036.png
new file mode 100755
index 0000000..a6878d4
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_na_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_na_048.png b/examples/webkit/webkit-guide/img/ic_na_048.png
new file mode 100755
index 0000000..76adaf4
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_na_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ne_016.png b/examples/webkit/webkit-guide/img/ic_ne_016.png
new file mode 100755
index 0000000..64562fc
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_ne_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ne_032.png b/examples/webkit/webkit-guide/img/ic_ne_032.png
new file mode 100755
index 0000000..fab5cd8
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_ne_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ne_036.png b/examples/webkit/webkit-guide/img/ic_ne_036.png
new file mode 100755
index 0000000..41092bf
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_ne_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ne_048.png b/examples/webkit/webkit-guide/img/ic_ne_048.png
new file mode 100755
index 0000000..4ec0db0
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_ne_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ni_016.png b/examples/webkit/webkit-guide/img/ic_ni_016.png
new file mode 100755
index 0000000..9b88e36
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_ni_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ni_032.png b/examples/webkit/webkit-guide/img/ic_ni_032.png
new file mode 100755
index 0000000..fc4fcf3
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_ni_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ni_036.png b/examples/webkit/webkit-guide/img/ic_ni_036.png
new file mode 100755
index 0000000..9d52747
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_ni_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ni_048.png b/examples/webkit/webkit-guide/img/ic_ni_048.png
new file mode 100755
index 0000000..b563c50
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_ni_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_o_016.png b/examples/webkit/webkit-guide/img/ic_o_016.png
new file mode 100755
index 0000000..a95460d
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_o_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_o_032.png b/examples/webkit/webkit-guide/img/ic_o_032.png
new file mode 100755
index 0000000..1d4864d
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_o_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_o_036.png b/examples/webkit/webkit-guide/img/ic_o_036.png
new file mode 100755
index 0000000..7f5dd02
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_o_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_o_048.png b/examples/webkit/webkit-guide/img/ic_o_048.png
new file mode 100755
index 0000000..7461a8e
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_o_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_pt_016.png b/examples/webkit/webkit-guide/img/ic_pt_016.png
new file mode 100755
index 0000000..513eb97
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_pt_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_pt_032.png b/examples/webkit/webkit-guide/img/ic_pt_032.png
new file mode 100755
index 0000000..1550c39
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_pt_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_pt_036.png b/examples/webkit/webkit-guide/img/ic_pt_036.png
new file mode 100755
index 0000000..7eec4d0
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_pt_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_pt_048.png b/examples/webkit/webkit-guide/img/ic_pt_048.png
new file mode 100755
index 0000000..50dece6
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_pt_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_si_016.png b/examples/webkit/webkit-guide/img/ic_si_016.png
new file mode 100755
index 0000000..e639b68
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_si_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_si_032.png b/examples/webkit/webkit-guide/img/ic_si_032.png
new file mode 100755
index 0000000..8657e62
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_si_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_si_036.png b/examples/webkit/webkit-guide/img/ic_si_036.png
new file mode 100755
index 0000000..ffe0ee2
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_si_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_si_048.png b/examples/webkit/webkit-guide/img/ic_si_048.png
new file mode 100755
index 0000000..5b9400d
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_si_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_zn_016.png b/examples/webkit/webkit-guide/img/ic_zn_016.png
new file mode 100755
index 0000000..11e5705
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_zn_016.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_zn_032.png b/examples/webkit/webkit-guide/img/ic_zn_032.png
new file mode 100755
index 0000000..cb78a5c
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_zn_032.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_zn_036.png b/examples/webkit/webkit-guide/img/ic_zn_036.png
new file mode 100755
index 0000000..66abffd
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_zn_036.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_zn_048.png b/examples/webkit/webkit-guide/img/ic_zn_048.png
new file mode 100755
index 0000000..d8361ad
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/ic_zn_048.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_check.png b/examples/webkit/webkit-guide/img/icon_check.png
new file mode 100755
index 0000000..294b62d
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_check.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_check_x24green.png b/examples/webkit/webkit-guide/img/icon_check_x24green.png
new file mode 100755
index 0000000..803928c
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_check_x24green.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_dismiss.png b/examples/webkit/webkit-guide/img/icon_dismiss.png
new file mode 100755
index 0000000..e7a8426
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_dismiss.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_dismiss_x22.png b/examples/webkit/webkit-guide/img/icon_dismiss_x22.png
new file mode 100755
index 0000000..e52a62a
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_dismiss_x22.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_drill-down.png b/examples/webkit/webkit-guide/img/icon_drill-down.png
new file mode 100755
index 0000000..7928c6e
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_drill-down.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_drill-down_x32.png b/examples/webkit/webkit-guide/img/icon_drill-down_x32.png
new file mode 100755
index 0000000..477d7cd
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_drill-down_x32.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_drill-up.png b/examples/webkit/webkit-guide/img/icon_drill-up.png
new file mode 100755
index 0000000..ff75940
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_drill-up.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_drill-up_x32.png b/examples/webkit/webkit-guide/img/icon_drill-up_x32.png
new file mode 100755
index 0000000..d63fe08
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_drill-up_x32.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_expand-nav.png b/examples/webkit/webkit-guide/img/icon_expand-nav.png
new file mode 100755
index 0000000..7ec5aa6
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_expand-nav.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_head-collapsed.png b/examples/webkit/webkit-guide/img/icon_head-collapsed.png
new file mode 100755
index 0000000..ed47838
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_head-collapsed.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_head-collapsed_x13.png b/examples/webkit/webkit-guide/img/icon_head-collapsed_x13.png
new file mode 100755
index 0000000..6892dc0
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_head-collapsed_x13.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_head-expanded.png b/examples/webkit/webkit-guide/img/icon_head-expanded.png
new file mode 100755
index 0000000..ee7e0a7
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_head-expanded.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_head-expanded_x13.png b/examples/webkit/webkit-guide/img/icon_head-expanded_x13.png
new file mode 100755
index 0000000..40e8eeb
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_head-expanded_x13.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_info.png b/examples/webkit/webkit-guide/img/icon_info.png
new file mode 100755
index 0000000..b70c760
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_info.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_info_x24.png b/examples/webkit/webkit-guide/img/icon_info_x24.png
new file mode 100755
index 0000000..9f4f352
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_info_x24.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-doc.png b/examples/webkit/webkit-guide/img/icon_link-doc.png
new file mode 100755
index 0000000..fc9bd54
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_link-doc.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-email.png b/examples/webkit/webkit-guide/img/icon_link-email.png
new file mode 100755
index 0000000..ef5f95d
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_link-email.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-external.png b/examples/webkit/webkit-guide/img/icon_link-external.png
new file mode 100755
index 0000000..47ddd80
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_link-external.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-pdf.png b/examples/webkit/webkit-guide/img/icon_link-pdf.png
new file mode 100755
index 0000000..fb90a6a
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_link-pdf.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-ppt.png b/examples/webkit/webkit-guide/img/icon_link-ppt.png
new file mode 100755
index 0000000..c6a5328
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_link-ppt.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-rss.png b/examples/webkit/webkit-guide/img/icon_link-rss.png
new file mode 100755
index 0000000..d3cf2c4
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_link-rss.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-sms.png b/examples/webkit/webkit-guide/img/icon_link-sms.png
new file mode 100755
index 0000000..f36de10
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_link-sms.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-tel.png b/examples/webkit/webkit-guide/img/icon_link-tel.png
new file mode 100755
index 0000000..7b665ee
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_link-tel.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-xls.png b/examples/webkit/webkit-guide/img/icon_link-xls.png
new file mode 100755
index 0000000..977c868
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_link-xls.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_list-all.png b/examples/webkit/webkit-guide/img/icon_list-all.png
new file mode 100755
index 0000000..97ce879
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_list-all.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_list-all_circ.png b/examples/webkit/webkit-guide/img/icon_list-all_circ.png
new file mode 100755
index 0000000..6c5828e
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_list-all_circ.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_nav-start.png b/examples/webkit/webkit-guide/img/icon_nav-start.png
new file mode 100755
index 0000000..cbe127f
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_nav-start.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_nav-top.png b/examples/webkit/webkit-guide/img/icon_nav-top.png
new file mode 100755
index 0000000..d57d3ef
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_nav-top.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_nav-up.png b/examples/webkit/webkit-guide/img/icon_nav-up.png
new file mode 100755
index 0000000..bab3259
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_nav-up.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_nav_end.png b/examples/webkit/webkit-guide/img/icon_nav_end.png
new file mode 100755
index 0000000..6d7dd31
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_nav_end.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_question.png b/examples/webkit/webkit-guide/img/icon_question.png
new file mode 100755
index 0000000..28c2ae1
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_question.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_scroll-left.png b/examples/webkit/webkit-guide/img/icon_scroll-left.png
new file mode 100755
index 0000000..38b3c3f
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_scroll-left.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_scroll-right.png b/examples/webkit/webkit-guide/img/icon_scroll-right.png
new file mode 100755
index 0000000..4d61919
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_scroll-right.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_trash.png b/examples/webkit/webkit-guide/img/icon_trash.png
new file mode 100755
index 0000000..b5f6eaa
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/icon_trash.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land1.jpg b/examples/webkit/webkit-guide/img/land1.jpg
new file mode 100644
index 0000000..05b11d5
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/land1.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land2.jpg b/examples/webkit/webkit-guide/img/land2.jpg
new file mode 100644
index 0000000..0f504b4
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/land2.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land3.jpg b/examples/webkit/webkit-guide/img/land3.jpg
new file mode 100644
index 0000000..fd86c95
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/land3.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land4.jpg b/examples/webkit/webkit-guide/img/land4.jpg
new file mode 100644
index 0000000..bcf33da
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/land4.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land5.jpg b/examples/webkit/webkit-guide/img/land5.jpg
new file mode 100644
index 0000000..c8d5509
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/land5.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land6.jpg b/examples/webkit/webkit-guide/img/land6.jpg
new file mode 100644
index 0000000..2762864
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/land6.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land7.jpg b/examples/webkit/webkit-guide/img/land7.jpg
new file mode 100644
index 0000000..6ac6d88
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/land7.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land8.jpg b/examples/webkit/webkit-guide/img/land8.jpg
new file mode 100644
index 0000000..37c51df
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/land8.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/mask.png b/examples/webkit/webkit-guide/img/mask.png
new file mode 100755
index 0000000..f9764b5
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/mask.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal1.jpg b/examples/webkit/webkit-guide/img/tmp/gal1.jpg
new file mode 100644
index 0000000..8f9edcb
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tmp/gal1.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal2.jpg b/examples/webkit/webkit-guide/img/tmp/gal2.jpg
new file mode 100644
index 0000000..a2301ef
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tmp/gal2.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal3.jpg b/examples/webkit/webkit-guide/img/tmp/gal3.jpg
new file mode 100644
index 0000000..a768530
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tmp/gal3.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal4.jpg b/examples/webkit/webkit-guide/img/tmp/gal4.jpg
new file mode 100644
index 0000000..96c0001
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tmp/gal4.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal5.jpg b/examples/webkit/webkit-guide/img/tmp/gal5.jpg
new file mode 100644
index 0000000..6ec78fc
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tmp/gal5.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal6.jpg b/examples/webkit/webkit-guide/img/tmp/gal6.jpg
new file mode 100644
index 0000000..25eb95c
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tmp/gal6.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal7.jpg b/examples/webkit/webkit-guide/img/tmp/gal7.jpg
new file mode 100644
index 0000000..b9fda2f
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tmp/gal7.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal8.jpg b/examples/webkit/webkit-guide/img/tmp/gal8.jpg
new file mode 100644
index 0000000..c23e226
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tmp/gal8.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land1.jpg b/examples/webkit/webkit-guide/img/tmp/land1.jpg
new file mode 100644
index 0000000..05b11d5
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tmp/land1.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land2.jpg b/examples/webkit/webkit-guide/img/tmp/land2.jpg
new file mode 100644
index 0000000..0f504b4
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tmp/land2.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land3.jpg b/examples/webkit/webkit-guide/img/tmp/land3.jpg
new file mode 100644
index 0000000..fd86c95
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tmp/land3.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land4.jpg b/examples/webkit/webkit-guide/img/tmp/land4.jpg
new file mode 100644
index 0000000..bcf33da
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tmp/land4.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land5.jpg b/examples/webkit/webkit-guide/img/tmp/land5.jpg
new file mode 100644
index 0000000..c8d5509
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tmp/land5.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land6.jpg b/examples/webkit/webkit-guide/img/tmp/land6.jpg
new file mode 100644
index 0000000..2762864
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tmp/land6.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land7.jpg b/examples/webkit/webkit-guide/img/tmp/land7.jpg
new file mode 100644
index 0000000..6ac6d88
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tmp/land7.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land8.jpg b/examples/webkit/webkit-guide/img/tmp/land8.jpg
new file mode 100644
index 0000000..37c51df
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tmp/land8.jpg
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal1.png b/examples/webkit/webkit-guide/img/tnail_gal1.png
new file mode 100644
index 0000000..6c83482
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tnail_gal1.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal2.png b/examples/webkit/webkit-guide/img/tnail_gal2.png
new file mode 100644
index 0000000..f090b68
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tnail_gal2.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal3.png b/examples/webkit/webkit-guide/img/tnail_gal3.png
new file mode 100644
index 0000000..6cc257b
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tnail_gal3.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal4.png b/examples/webkit/webkit-guide/img/tnail_gal4.png
new file mode 100644
index 0000000..ae9983c
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tnail_gal4.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal5.png b/examples/webkit/webkit-guide/img/tnail_gal5.png
new file mode 100644
index 0000000..58d764c
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tnail_gal5.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal6.png b/examples/webkit/webkit-guide/img/tnail_gal6.png
new file mode 100644
index 0000000..f5d0b8b
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tnail_gal6.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal7.png b/examples/webkit/webkit-guide/img/tnail_gal7.png
new file mode 100644
index 0000000..8d33ea6
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tnail_gal7.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal8.png b/examples/webkit/webkit-guide/img/tnail_gal8.png
new file mode 100644
index 0000000..61e1431
--- /dev/null
+++ b/examples/webkit/webkit-guide/img/tnail_gal8.png
Binary files differ
diff --git a/examples/webkit/webkit-guide/js/anim_accord.js b/examples/webkit/webkit-guide/js/anim_accord.js
new file mode 100755
index 0000000..8d58a18
--- /dev/null
+++ b/examples/webkit/webkit-guide/js/anim_accord.js
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+window.onload = function() {
+
+ initDT();
+ document.querySelector('body').addEventListener('click', function(event){
+ var dl = document.querySelector('#accordion');
+ var ct = event.currentTarget;
+ var t = event.target;
+ var dt;
+ if (t.id == 'accordion' && t.className == 'collapsed') {
+ dl.className = 'expanded';
+ }
+ else if (t.tagName == 'DT' && t.parentNode.id == 'accordion') {
+ if ( t.className == 'collapsed' ) {
+ t.className = 'expanded';
+ }
+ else {
+ t.className = 'collapsed';
+ }
+ }
+ else {
+ dl.className = 'collapsed';
+ initDT();
+ }
+ });
+};
+
+function initDT() {
+ var el = nlToAr(document.querySelectorAll('#accordion > dt'));
+ el.forEach( function(l){ l.className = 'collapsed'; });
+}
+
+function nlToAr(nl) {
+ var a = new Array();
+ var l = nl.length;
+ var i = l - 1;
+ a[i] = true;
+ for ( i = 0; i < l ; i++ ) { a[i] = nl[i]; }
+ return(a);
+}
diff --git a/examples/webkit/webkit-guide/js/anim_gallery.js b/examples/webkit/webkit-guide/js/anim_gallery.js
new file mode 100755
index 0000000..3e00bc6
--- /dev/null
+++ b/examples/webkit/webkit-guide/js/anim_gallery.js
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+var app = new Function();
+
+app.init = function() {
+ var divs = document.querySelectorAll('section > div');
+ if ( divs.length < 2 ) return false;
+ for (var i = 0, l = divs.length ; i < l ; i++ ) {
+ if (i > 1) divs[i].className = 'hideR';
+ divs[i].addEventListener('click', app.navigate );
+ }
+ divs[0].className = 'selected';
+ divs[1].className = 'queueR';
+};
+
+app.navigate = function(event) {
+ var el, n1, n2, p1, p2;
+ el = event.currentTarget;
+ n1 = el.nextSibling;
+ if (n1) n2 = el.nextSibling.nextSibling;
+ p1 = el.previousSibling;
+ if (p1) p2 = el.previousSibling.previousSibling;
+ if ( el.className == 'selected' ) {
+ if ( el.id == 'reveal') {
+ el.id = '';
+ }
+ else {
+ el.id = 'reveal';
+ }
+ return false;
+ }
+ if (n1) { n1.className = 'queueR'; n1.id = ''}
+ if (n2) { n2.className = 'hideR'; n2.id = '' }
+ if (p1) { p1.className = 'queueL'; p1.id = '' }
+ if (p2) { p2.className = 'hideL'; p2.id = '' }
+ el.className = 'selected';
+};
+
+window.onload = function() {
+ // alert(app.init);
+ app.init();
+};
diff --git a/examples/webkit/webkit-guide/js/anim_panel.js b/examples/webkit/webkit-guide/js/anim_panel.js
new file mode 100755
index 0000000..365210d
--- /dev/null
+++ b/examples/webkit/webkit-guide/js/anim_panel.js
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+window.onload = function() {
+ document.querySelector('body').addEventListener('click', function(event){
+ document.querySelector('#panel').className = 'collapsed';
+ });
+}
+
+function share() {
+ document.querySelector('#panel').className = 'expanded';
+ event.stopPropagation();
+}
+
+function debug(str) {
+ document.querySelector('#dbg').innerHTML = 'You chose the <b>' + str.toUpperCase() + '</b> option.';
+}
diff --git a/examples/webkit/webkit-guide/js/anim_skew.js b/examples/webkit/webkit-guide/js/anim_skew.js
new file mode 100755
index 0000000..1a80a6d
--- /dev/null
+++ b/examples/webkit/webkit-guide/js/anim_skew.js
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+var app = new Function();
+
+app.init = function() {
+ app.elements = document.querySelectorAll('.items > div');
+ app.navs = document.querySelectorAll('nav > div');
+
+ // elements
+ for ( var i = 0, ln = app.elements.length ; i < ln ; i++ ) {
+ app.elements[i].className = 'row' + (i + 1);
+ app.elements[i].addEventListener('click', app.remove);
+ }
+
+ // navigation
+ for ( var i = 0, ln = app.navs.length ; i < ln ; i++ ) {
+ app.navs[i].addEventListener('click', app.filter );
+ }
+};
+
+app.filter = function(event) {
+ var type = event.target.className;
+
+ var hiddenCount = 0;
+
+ if (! type ) {
+ app.init();
+ return false;
+ }
+
+ for ( var i = 0, ln = app.elements.length ; i < ln ; i++ ) {
+ if ( app.elements[i].title == type ) {
+ app.elements[i].className = 'row' + ((i + 1) - hiddenCount);
+ }
+ else {
+ app.elements[i].className = 'hide';
+ hiddenCount++;
+ }
+ }
+};
+
+app.remove = function() {
+ event.currentTarget.className = 'hide';
+ app.rearrange();
+};
+
+app.rearrange = function() {
+ var hiddenCount = 0;
+ for ( var i = 0, ln = app.elements.length ; i < ln ; i++ ) {
+ if ( app.elements[i].className.match(/hide/) ) {
+ hiddenCount++;
+ }
+ else {
+ app.elements[i].className = 'row' + ((i + 1) - hiddenCount);
+ }
+ }
+};
+
+window.onload = function() { app.init() };
+
diff --git a/examples/webkit/webkit-guide/js/css3_backgrounds.js b/examples/webkit/webkit-guide/js/css3_backgrounds.js
new file mode 100755
index 0000000..0c834d1
--- /dev/null
+++ b/examples/webkit/webkit-guide/js/css3_backgrounds.js
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+document.querySelector('body').addEventListener('click', function(event) {
+ var l = event.target;
+ if (l.tagName != 'DT') return false ;
+ if ( l.className ) {
+ l.className = '';
+ }
+ else {
+ l.className = 'selected';
+ }
+});
diff --git a/examples/webkit/webkit-guide/js/css3_border-img.js b/examples/webkit/webkit-guide/js/css3_border-img.js
new file mode 100755
index 0000000..b440afb
--- /dev/null
+++ b/examples/webkit/webkit-guide/js/css3_border-img.js
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+window.onload = function() {
+ var el = document.querySelectorAll('input');
+ for (var i = 0, l = el.length ; i < l ; i++ ) {
+ }
+}
diff --git a/examples/webkit/webkit-guide/js/css3_grad-radial.js b/examples/webkit/webkit-guide/js/css3_grad-radial.js
new file mode 100755
index 0000000..46601e4
--- /dev/null
+++ b/examples/webkit/webkit-guide/js/css3_grad-radial.js
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+window.onload = function() {
+ var el = document.querySelector('#main');
+ el.addEventListener('mousedown', function(event){
+
+ var colors = [ 'beige', 'crimson', 'darkcyan', 'turquoise',
+ 'darkgoldenrod', 'darkorange', 'fuchsia',
+ 'greenyellow', 'lightblue', 'lightcoral',
+ 'lightgreen', 'mediumorchid', 'pink', 'plum',
+ 'skyblue', 'springgreen', 'tan', 'tomato',
+ 'violet', 'yellow', 'teal'];
+
+ var x = event.offsetX;
+ var y = event.offsetY;
+
+ var loc = document.querySelector('#localStyles');
+ var style = '#main:active {' + 'background: -webkit-gradient(radial, ';
+ style += (x + ' ');
+ style += (y + ' ');
+ style += ',5,';
+ style += ((x + 10) + ' ');
+ style += ((y + 10) + ' ');
+ style += ', 48, ';
+ style += 'from(' + colors[r(5)] + '),';
+ style += 'color-stop(20%, ' + colors[r(5)] + '),';
+ style += 'color-stop(40%, ' + colors[r(5)] + '),';
+ style += 'color-stop(60%, ' + colors[r(5)] + '),';
+ style += 'color-stop(80%, ' + colors[r(5)] + '),';
+ style += 'to(#ffffff) );'
+ style += '}'
+ loc.innerHTML = style;
+ });
+}
+
+function r(i) {
+ return Math.floor( (Math.random() * i ) );
+}
diff --git a/examples/webkit/webkit-guide/js/css3_mask-grad.js b/examples/webkit/webkit-guide/js/css3_mask-grad.js
new file mode 100755
index 0000000..5d516aa
--- /dev/null
+++ b/examples/webkit/webkit-guide/js/css3_mask-grad.js
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+document.querySelector('body').addEventListener('click', function(event) {
+ var l = event.target;
+ if (l.tagName != 'IMG') return false ;
+ event.target.className = 'select';
+});
diff --git a/examples/webkit/webkit-guide/js/css3_mask-img.js b/examples/webkit/webkit-guide/js/css3_mask-img.js
new file mode 100755
index 0000000..b440afb
--- /dev/null
+++ b/examples/webkit/webkit-guide/js/css3_mask-img.js
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+window.onload = function() {
+ var el = document.querySelectorAll('input');
+ for (var i = 0, l = el.length ; i < l ; i++ ) {
+ }
+}
diff --git a/examples/webkit/webkit-guide/js/css3_text-overflow.js b/examples/webkit/webkit-guide/js/css3_text-overflow.js
new file mode 100755
index 0000000..1a87cb3
--- /dev/null
+++ b/examples/webkit/webkit-guide/js/css3_text-overflow.js
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+window.onload = function() {
+ var el = document.querySelectorAll('.accordion > li');
+ for (var i = 0, l = el.length ; i < l ; i++ ) {
+ el[i].addEventListener('click', function(event){
+ var tgt = event.target;
+ if ( tgt.tagName == 'LI' && ( ! tgt.className ) ) {
+ tgt.className = 'selected';
+ }
+ if ( tgt.tagName == 'DIV' && ( tgt.className == 'dismiss') ) {
+ tgt.parentNode.className = '';
+ }
+
+ });
+ }
+}
diff --git a/examples/webkit/webkit-guide/js/form_tapper.js b/examples/webkit/webkit-guide/js/form_tapper.js
new file mode 100755
index 0000000..bb0c9dc
--- /dev/null
+++ b/examples/webkit/webkit-guide/js/form_tapper.js
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+window.onload = function() {
+ return false;
+ var el = document.querySelectorAll('input[type=radio]');
+ for ( var i = 0, l = el.length ; i < l ; i++ ) {
+ el[i].addEventListener('click', resetRadio);
+ }
+}
+
+function resetRadio(event) {
+ if (event.target._checked == true) {
+ event.target._checked = false;
+ event.target.checked = false;
+ event.target.indeterminate = true;
+ }
+ else {
+ event.target._checked = true;
+ }
+}
diff --git a/examples/webkit/webkit-guide/js/mob_condjs.js b/examples/webkit/webkit-guide/js/mob_condjs.js
new file mode 100755
index 0000000..1ba445e
--- /dev/null
+++ b/examples/webkit/webkit-guide/js/mob_condjs.js
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+window.onload = function() {
+ var msg = 'JavaScript thinks you are viewing this page with a ';
+ if ( isDesign('desktop') ) {
+ msg += 'full desktop browser';
+ }
+ else if ( isDesign('touch') ) {
+ msg += 'touch-based mobile browser';
+ }
+ else if ( isDesign('mobile') ) {
+ msg += 'non-touch mobile browser';
+ }
+ else {
+ msg = window.styleMedia.matchMedium;
+ }
+ document.getElementById('js').innerHTML = msg;
+};
+
+function isDesign(str) {
+ var design;
+ if (matchesMedia('only screen and (min-device-width: 481px)')) {
+ design = 'desktop';
+ }
+ else if (matchesMedia('only screen and (max-device-width: 480px)')) {
+ design = 'touch';
+ }
+ else if (matchesMedia('handheld')) {
+ design = 'mobile';
+ }
+ return str == design;
+}
+
+function matchesMedia(query) {
+ if (!!window.matchMedia)
+ return window.matchMedia(query).matches;
+ if (!!window.styleMedia && !!window.styleMedia.matchMedium)
+ return window.styleMedia.matchMedium(query);
+ if (!!window.media && window.media.matchMedium)
+ return window.media.matchMedium(query);
+ return false;
+}
diff --git a/examples/webkit/webkit-guide/js/mobile.js b/examples/webkit/webkit-guide/js/mobile.js
new file mode 100755
index 0000000..880d6e4
--- /dev/null
+++ b/examples/webkit/webkit-guide/js/mobile.js
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+var app = new Function();
+
+app.toggleDisplay = function(id) {
+ var el = document.getElementById(id);
+ if (el.className.match(/hidden/)) {
+ el.className = '';
+ }
+ else {
+ el.className = 'hidden';
+ }
+}
diff --git a/examples/webkit/webkit-guide/js/storage.js b/examples/webkit/webkit-guide/js/storage.js
new file mode 100755
index 0000000..62dca84
--- /dev/null
+++ b/examples/webkit/webkit-guide/js/storage.js
@@ -0,0 +1,94 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt WebKit module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+var app = new Function();
+
+app.dbg = false;
+
+window.onload = function() {
+
+ app.cred = document.querySelector('#cred');
+
+ // open form:
+ document.querySelector('#openform').addEventListener('mousedown', app.getInfo);
+ // dismiss form:
+ document.querySelector('#dismiss').addEventListener('mousedown', app.dismiss);
+
+ // form validation:
+ app.inputs = document.querySelectorAll('input:not([type="submit"])');
+ for (var i = 0, l = app.inputs.length ; i < l ; i++ ) {
+ app.inputs[i].addEventListener('blur', app.checkEdit);
+ }
+
+ // storage
+ app.db_loc = window.localStorage;
+ app.db_ses = window.sessionStorage;
+
+ if (!!app.db_loc) {
+ // no login info yet...
+ if ( !app.db_loc.getItem('login') || !app.db_loc.getItem('password') ) app.getInfo();
+ }
+ else {
+ alert("This application needs to run on a recent WebKit-based browser.");
+ }
+
+};
+
+app.hint = function(str) {
+ document.querySelector('body').className = str;
+};
+
+app.checkEdit = function(ev) {
+ ev.currentTarget.className = 'validate';
+}
+
+app.getInfo = function(ev) {
+ app.cred.className = 'show';
+ app.inputs[0].value = app.db_loc.getItem('login');
+ app.inputs[1].value = app.db_loc.getItem('password');
+ app.inputs[2].value = app.db_ses.getItem('credit');
+}
+
+app.dismiss = function(ev) {
+ app.db_loc.setItem('login', app.inputs[0].value);
+ app.db_loc.setItem('password', app.inputs[1].value);
+ app.db_ses.setItem('credit', app.inputs[2].value);
+ ev.currentTarget.parentNode.className = 'hide';
+}
+
diff --git a/examples/webkit/webkit-guide/layout_link-fmt.htm b/examples/webkit/webkit-guide/layout_link-fmt.htm
new file mode 100644
index 0000000..436d97c
--- /dev/null
+++ b/examples/webkit/webkit-guide/layout_link-fmt.htm
@@ -0,0 +1,81 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Link Context Hints</title>
+<link href='css/layout_link-fmt.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<article>
+<h3>Link Context Hints</h3>
+<ol class="links">
+<li> <a href="#">Link to internal page</a></li>
+<li> <a href="http://www.google.com" target="new">Link to external page</a></li>
+<li> <a href="mailto:who@where.com">Email Link</a></li>
+<li> <a href="tel:+2125551212">Phone: 212.555.1212</a></li>
+<li> <a href="sms:+2125551212%3Fbody=hello world">SMS Link</a></li>
+<li> <a href="http://whmp.com/pages/podcast/122411.rss">Link to RSS feed</a></li>
+<li> <a href="http://www.ous.edu/about/polipro/files/Budget%20Outline.doc">Link to Word file</a></li>
+<li> <a href="http://www.greenfield-nh.gov/Public_Documents/GreenfieldNH_Admin/BudgetReport2006.pdf">List to PDF file</a></li>
+<li> <a href="http://www.agmconnect.org/cpf/CPF_Budget_Template.xls">Link to Excel file</a></li>
+<li> <a href="http://www.unh.edu/hr/banner/position-budget-training.ppt">Link to Powerpoint file</a></li>
+</ol>
+<h3>Inline Links</h3>
+<p>
+Links to an
+<a href="item2.htm">internal page</a>, an
+<a href="http://example.com/item1.htm" target="new">external page</a>,
+<a href="mailto:who@where.com">email link</a>,
+phone link
+<a href="tel:+2125551212">212.555.1212</a>,
+<a href="sms:+2125551212%3Fbody=hello world">SMS Link</a>,
+<a href="http://whmp.com/pages/podcast/122411.rss">RSS feed</a>,
+<a href="http://www.ous.edu/about/polipro/files/Budget%20Outline.doc">Word file</a>,
+<a href="http://www.greenfield-nh.gov/Public_Documents/GreenfieldNH_Admin/BudgetReport2006.pdf">PDF</a>,
+<a href="http://www.agmconnect.org/cpf/CPF_Budget_Template.xls">Excel</a>,
+<a href="http://www.unh.edu/hr/banner/position-budget-training.ppt">Powerpoint</a>.
+</p>
+</article>
+<p>&nbsp</p>
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/layout_tbl-keyhole.htm b/examples/webkit/webkit-guide/layout_tbl-keyhole.htm
new file mode 100644
index 0000000..73d332d
--- /dev/null
+++ b/examples/webkit/webkit-guide/layout_tbl-keyhole.htm
@@ -0,0 +1,141 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Mobilized Tables</title>
+<link href='css/layout_tbl-keyhole.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section>
+
+<article id="r0">
+
+<h1>Mobilized Tables</h1>
+
+<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec
+feugiat gravida viverra. Vivamus ipsum felis, cursus sed venenatis
+nec, tempus ac tellus.</p>
+
+<p><a href="#r1">View Listings</a></p>
+
+<table class="mobile">
+
+<thead>
+<tr>
+<th class="nav"></th>
+<th>Item</th>
+<th>Price</th>
+<th>Location</th>
+<th>Posted</th>
+<th>Description</th>
+</tr>
+</thead>
+
+<tbody>
+
+<tr id="r1">
+<th class="nav"><a href="#"></a><a href="#r2"></a></th>
+<td>Keiser Indoor Cycling Bike / Platform</td>
+<td>$250</td>
+<td>Santa Monica, CA</td>
+<td>4 days ago</td>
+<td>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui
+officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit
+amet, consectetur adipiscing elit. Donec feugiat gravida viverra.
+Vivamus ipsum felis, cursus sed venenatis nec, tempus ac tellus.</td>
+</tr>
+
+<tr id="r2">
+<th class="nav"><a href="#r1"></a><a href="#r3"></a></th>
+<td>Ladies Diamondback Mountain Bike</td>
+<td>$300</td>
+<td>North Hollywood, CA</td>
+<td>3 hours ago</td>
+<td>Duis aute irure dolor in reprehenderit in voluptate velit esse
+cillum dolore eu fugiat nulla pariatur. Lorem ipsum dolor sit amet,
+consectetur adipiscing elit. Donec feugiat gravida viverra. Vivamus
+ipsum felis, cursus sed venenatis nec, tempus ac tellus.</td>
+</tr>
+
+<tr id="r3">
+<th class="nav"><a href="#r2"></a><a href="#r4"></a></th>
+<td>AA Cycle 10 Speed Road Bike</td>
+<td>$150</td>
+<td>Burbank, CA</td>
+<td>2 days ago</td>
+<td>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
+nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet,
+consectetur adipiscing elit. Donec feugiat gravida viverra. Vivamus
+ipsum felis, cursus sed venenatis nec, tempus ac tellus.</td>
+</tr>
+
+<tr id="r4">
+<th class="nav"><a href="#r3"></a><a href="#"></a></th>
+<td>Magna Dual Suspection Mountain Bike 24</td>
+<td>$60</td>
+<td>El Segundo, CA</td>
+<td>2 weeks ago</td>
+<td>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
+eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem
+ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
+gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
+ac tellus.</td>
+</tr>
+
+</tbody>
+
+</table>
+
+<p>
+Text continues here. Donec a massa felis, a congue purus. Nullam et
+turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
+venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
+at neque.
+</p>
+</article>
+
+<script src="js/mobile.js"></script>
+
+</section>
+
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/mob_condjs.htm b/examples/webkit/webkit-guide/mob_condjs.htm
new file mode 100644
index 0000000..710a371
--- /dev/null
+++ b/examples/webkit/webkit-guide/mob_condjs.htm
@@ -0,0 +1,65 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Media Queries + JavaScript</title>
+<link media='only screen and (min-device-width: 481px)' href='css/mq_desktop.css' type='text/css' rel='stylesheet'/>
+<link media='only screen and (max-device-width: 480px)' href='css/mq_touch.css' type='text/css' rel='stylesheet'/>
+<link media='handheld' href='css/mqmobile.css' type='text/css' rel='stylesheet'/>
+<link href='css/mob_condjs.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section>
+<article>
+<h3>Media Queries + JavaScript</h3>
+<p id="design">...</p>
+
+<p id="js">...</p>
+
+</article>
+</section>
+
+<script src="js/mob_condjs.js"></script>
+
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/mob_layout.htm b/examples/webkit/webkit-guide/mob_layout.htm
new file mode 100644
index 0000000..cad6f6c
--- /dev/null
+++ b/examples/webkit/webkit-guide/mob_layout.htm
@@ -0,0 +1,59 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). All
+rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<title>Media Query-Driven Layout</title>
+<meta name='viewport' content='width=device-width' />
+<title>media-driven layout</title>
+<link media='only screen and (min-device-width: 480px)' href='css/mqlayout_desktop.css' type='text/css' rel='stylesheet'/>
+<link media='only screen and (max-device-width: 480px)' href='css/mqlayout_touch.css' type='text/css' rel='stylesheet'/>
+<link media='handheld' href='css/mqlayout_mobile.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<header>HEADER</header>
+<nav>NAVIGATION</nav>
+<section id="main">MAIN CONTENT</section>
+<section id="sidebar">SIDEBAR</section>
+<footer>FOOTER</footer>
+
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/mob_mediaquery.htm b/examples/webkit/webkit-guide/mob_mediaquery.htm
new file mode 100644
index 0000000..3b0e3b4
--- /dev/null
+++ b/examples/webkit/webkit-guide/mob_mediaquery.htm
@@ -0,0 +1,59 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Media Queries</title>
+<link media='only screen and (min-device-width: 481px)' href='css/mq_desktop.css' type='text/css' rel='stylesheet'/>
+<link media='only screen and (max-device-width: 480px)' href='css/mq_touch.css' type='text/css' rel='stylesheet'/>
+<link media='handheld' href='css/mq_mobile.css' type='text/css' rel='stylesheet'/>
+<link href='css/mob_mediaquery.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<section>
+<article>
+<h3>Media Queries</h3>
+<p id="design">...</p>
+</article>
+</section>
+<script src="js/mobile.js"></script>
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/storage.htm b/examples/webkit/webkit-guide/storage.htm
new file mode 100644
index 0000000..d154c81
--- /dev/null
+++ b/examples/webkit/webkit-guide/storage.htm
@@ -0,0 +1,71 @@
+<!--
+
+This file is part of QtWebKit
+
+Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+You may use this file under the terms of the BSD license as follows:
+
+"Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta name='viewport' content='width=device-width' />
+<title>Local/Session Storage</title>
+<link href='css/storage.css' type='text/css' rel='stylesheet'/>
+</head>
+<body>
+<h1>
+<img id="openform" src="img/icon_info_x24.png"/>
+Local/Session Storage</h1>
+
+<form id="cred" class="hide">
+
+<img id="dismiss" src="img/icon_dismiss.png"/>
+
+<div>login</div>
+<input id="login" required type="text"/>
+<br/>
+
+<div>password</div>
+<input id="password" required type="password"/>
+
+<div>credit card</div>
+<input id="credit" required type="number" min="999999999999999" max="9999999999999999"/>
+
+</form>
+
+<script src="js/storage.js"></script>
+
+</body>
+</html>
diff --git a/examples/webkit/webkit-guide/webkit-guide.pro b/examples/webkit/webkit-guide/webkit-guide.pro
new file mode 100644
index 0000000..b4291a5
--- /dev/null
+++ b/examples/webkit/webkit-guide/webkit-guide.pro
@@ -0,0 +1,257 @@
+#A simple .pro file to make Qt aware of the webkit-guide files.
+#For documentation generation
+#TEMPLATE += subdirs
+
+SOURCES = anim_accord.htm \
+anim_demo-rotate.htm \
+anim_demo-scale.htm \
+anim_demo-skew.htm \
+anim_gallery.htm \
+anim_panel.htm \
+anim_pulse.htm \
+anim_skew.htm \
+anim_slide1.htm \
+anim_slide2.htm \
+anim_slide3.htm \
+anim_tabbedSkew.htm \
+_copyright.txt \
+css3_backgrounds.htm \
+css3_border-img.htm \
+css3_gradientBack.htm \
+css3_gradientBackStop.htm \
+css3_gradientButton.htm \
+css3_grad-radial.htm \
+css3_mask-grad.htm \
+css3_mask-img.htm \
+css3_multicol.htm \
+css3_reflect.htm \
+css3_scroll.htm \
+css3_sel-nth.htm \
+css3_shadow.htm \
+css3_text-overflow.htm \
+css3_text-shadow.htm \
+css3_text-stroke.htm \
+form_tapper.htm \
+form_toggler.htm \
+_image_assets.htm \
+_index.html \
+layout_link-fmt.htm \
+layout_tbl-keyhole.htm \
+mob_condjs.htm \
+mob_layout.htm \
+mob_mediaquery.htm \
+storage.htm \
+css/anim_accord.css \
+css/anim_demo-rotate.css \
+css/anim_demo-scale.css \
+css/anim_demo-skew.css \
+css/anim_gallery.css \
+css/anim_panel.css \
+css/anim_pulse.css \
+css/anim_skew.css \
+css/anim_slide.css \
+css/anim_tabbedSkew.css \
+css/css3_backgrounds.css \
+css/css3_border-img.css \
+css/css3_gradientBack.css \
+css/css3_gradientBackStop.css \
+css/css3_gradientButton.css \
+css/css3_grad-radial.css \
+css/css3_mask-grad.css \
+css/css3_mask-img.css \
+css/css3_multicol.css \
+css/css3_reflect.css \
+css/css3_scroll.css \
+css/css3_sel-nth.css \
+css/css3_shadowBlur.css \
+css/css3_shadow.css \
+css/css3_text-overflow.css \
+css/css3_text-shadow.css \
+css/css3_text-stroke.css \
+css/form_tapper.css \
+css/form_toggler.css \
+css/layout_link-fmt.css \
+css/layout_tbl-keyhole.css \
+css/mob_condjs.css \
+css/mobile.css \
+css/mob_mediaquery.css \
+css/mq_desktop.css \
+css/mqlayout_desktop.css \
+css/mqlayout_mobile.css \
+css/mqlayout_touch.css \
+css/mq_mobile.css \
+css/mq_touch.css \
+css/storage.css \
+img/border-frame.png \
+img/gal1.jpg \
+img/gal2.jpg \
+img/gal3.jpg \
+img/gal4.jpg \
+img/gal5.jpg \
+img/gal6.jpg \
+img/gal7.jpg \
+img/gal8.jpg \
+img/gradient.jpg \
+img/gray_icon_close.png \
+img/ic_ag_016.png \
+img/ic_ag_032.png \
+img/ic_ag_036.png \
+img/ic_ag_048.png \
+img/ic_al_016.png \
+img/ic_al_032.png \
+img/ic_al_036.png \
+img/ic_al_048.png \
+img/ic_ar_016.png \
+img/ic_ar_032.png \
+img/ic_ar_036.png \
+img/ic_ar_048.png \
+img/ic_b_016.png \
+img/ic_b_032.png \
+img/ic_b_036.png \
+img/ic_b_048.png \
+img/ic_be_016.png \
+img/ic_be_032.png \
+img/ic_be_036.png \
+img/ic_be_048.png \
+img/ic_c_016.png \
+img/ic_c_032.png \
+img/ic_c_036.png \
+img/ic_c_048.png \
+img/ic_ca_016.png \
+img/ic_ca_032.png \
+img/ic_ca_036.png \
+img/ic_ca_048.png \
+img/ic_cl_016.png \
+img/ic_cl_032.png \
+img/ic_cl_036.png \
+img/ic_cl_048.png \
+img/ic_cu_016.png \
+img/ic_cu_032.png \
+img/ic_cu_036.png \
+img/ic_cu_048.png \
+img/ic_f_016.png \
+img/ic_f_032.png \
+img/ic_f_036.png \
+img/ic_f_048.png \
+img/ic_fe_016.png \
+img/ic_fe_032.png \
+img/ic_fe_036.png \
+img/ic_fe_048.png \
+img/ic_h_016.png \
+img/ic_h_032.png \
+img/ic_h_036.png \
+img/ic_h_048.png \
+img/ic_he_016.png \
+img/ic_he_032.png \
+img/ic_he_036.png \
+img/ic_he_048.png \
+img/ic_k_016.png \
+img/ic_k_032.png \
+img/ic_k_036.png \
+img/ic_k_048.png \
+img/ic_li_016.png \
+img/ic_li_032.png \
+img/ic_li_036.png \
+img/ic_li_048.png \
+img/ic_mg_016.png \
+img/ic_mg_032.png \
+img/ic_mg_036.png \
+img/ic_mg_048.png \
+img/ic_n_016.png \
+img/ic_n_032.png \
+img/ic_n_036.png \
+img/ic_n_048.png \
+img/ic_na_016.png \
+img/ic_na_032.png \
+img/ic_na_036.png \
+img/ic_na_048.png \
+img/ic_ne_016.png \
+img/ic_ne_032.png \
+img/ic_ne_036.png \
+img/ic_ne_048.png \
+img/ic_ni_016.png \
+img/ic_ni_032.png \
+img/ic_ni_036.png \
+img/ic_ni_048.png \
+img/ic_o_016.png \
+img/ic_o_032.png \
+img/ic_o_036.png \
+img/ic_o_048.png \
+img/icon_check.png \
+img/icon_check_x24green.png \
+img/icon_dismiss.png \
+img/icon_dismiss_x22.png \
+img/icon_drill-down.png \
+img/icon_drill-down_x32.png \
+img/icon_drill-up.png \
+img/icon_drill-up_x32.png \
+img/icon_expand-nav.png \
+img/icon_head-collapsed.png \
+img/icon_head-collapsed_x13.png \
+img/icon_head-expanded.png \
+img/icon_head-expanded_x13.png \
+img/icon_info.png \
+img/icon_info_x24.png \
+img/icon_link-doc.png \
+img/icon_link-email.png \
+img/icon_link-external.png \
+img/icon_link-pdf.png \
+img/icon_link-ppt.png \
+img/icon_link-rss.png \
+img/icon_link-sms.png \
+img/icon_link-tel.png \
+img/icon_link-xls.png \
+img/icon_list-all_circ.png \
+img/icon_list-all.png \
+img/icon_nav_end.png \
+img/icon_nav-start.png \
+img/icon_nav-top.png \
+img/icon_nav-up.png \
+img/icon_question.png \
+img/icon_scroll-left.png \
+img/icon_scroll-right.png \
+img/icon_trash.png \
+img/ic_pt_016.png \
+img/ic_pt_032.png \
+img/ic_pt_036.png \
+img/ic_pt_048.png \
+img/ic_si_016.png \
+img/ic_si_032.png \
+img/ic_si_036.png \
+img/ic_si_048.png \
+img/ic_zn_016.png \
+img/ic_zn_032.png \
+img/ic_zn_036.png \
+img/ic_zn_048.png \
+img/land1.jpg \
+img/land2.jpg \
+img/land3.jpg \
+img/land4.jpg \
+img/land5.jpg \
+img/land6.jpg \
+img/land7.jpg \
+img/land8.jpg \
+img/mask.png \
+img/tnail_gal1.png \
+img/tnail_gal2.png \
+img/tnail_gal3.png \
+img/tnail_gal4.png \
+img/tnail_gal5.png \
+img/tnail_gal6.png \
+img/tnail_gal7.png \
+img/tnail_gal8.png \
+js/anim_accord.js \
+js/anim_gallery.js \
+js/anim_panel.js \
+js/anim_skew.js \
+js/css3_backgrounds.js \
+js/css3_border-img.js \
+js/css3_grad-radial.js \
+js/css3_mask-grad.js \
+js/css3_mask-img.js \
+js/css3_text-overflow.js \
+js/form_tapper.js \
+js/mob_condjs.js \
+js/mobile.js \
+js/storage.js \
+
diff --git a/examples/webkit/webkit.pro b/examples/webkit/webkit.pro
index 6a1d8f8..62d3762 100644
--- a/examples/webkit/webkit.pro
+++ b/examples/webkit/webkit.pro
@@ -5,7 +5,7 @@ SUBDIRS += domtraversal \
fancybrowser \
simpleselector \
imageanalyzer \
- framecapture
+ framecapture \
contains(QT_CONFIG, openssl):SUBDIRS += googlechat
diff --git a/mkspecs/common/armcc.conf b/mkspecs/common/armcc.conf
index 2c765bc..4f178d7 100644
--- a/mkspecs/common/armcc.conf
+++ b/mkspecs/common/armcc.conf
@@ -37,5 +37,6 @@ QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB
QMAKE_LFLAGS_THREAD +=
QMAKE_AR = armar --create
+QMAKE_LIB = armar --create
QMAKE_RANLIB =
diff --git a/mkspecs/common/symbian/symbian-makefile.conf b/mkspecs/common/symbian/symbian-makefile.conf
index e51de1d..b248117 100644
--- a/mkspecs/common/symbian/symbian-makefile.conf
+++ b/mkspecs/common/symbian/symbian-makefile.conf
@@ -2,7 +2,11 @@
# qmake configuration for makefile based symbian
#
-MAKEFILE_GENERATOR = SYMBIAN_UNIX
+contains(QMAKE_HOST.os,Windows) {
+ MAKEFILE_GENERATOR = SYMBIAN_MINGW
+} else {
+ MAKEFILE_GENERATOR = SYMBIAN_UNIX
+}
include(symbian.conf)
@@ -24,10 +28,18 @@ CONFIG *= no_plugin_name_prefix
QMAKE_PREFIX_STATICLIB =
QMAKE_SYMBIAN_SHLIB = 1
+QMAKE_LINK_OBJECT_SCRIPT = objects
+
is_using_gnupoc {
- DEFINES *= __PRODUCT_INCLUDE__=\\<$${EPOCROOT}epoc32/include/variant/symbian_os.hrh\\>
-} else {
- DEFINES *= __PRODUCT_INCLUDE__=\\<$${EPOCROOT}epoc32/include/variant/Symbian_OS.hrh\\>
+ DEFINES *= __QT_PRODUCT_INCLUDE_IS_LOWERCASE__
+}
+QMAKE_SYMBIAN_INCLUDES = $$IN_PWD/symbianincludes.h
+symbian-armcc {
+ QMAKE_CFLAGS += --preinclude $$QMAKE_SYMBIAN_INCLUDES
+ QMAKE_CXXFLAGS += --preinclude $$QMAKE_SYMBIAN_INCLUDES
+} else:symbian-gcce {
+ QMAKE_CFLAGS += -include $$QMAKE_SYMBIAN_INCLUDES
+ QMAKE_CXXFLAGS += -include $$QMAKE_SYMBIAN_INCLUDES
}
DEFINES *= \
__SYMBIAN32__ \
diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf
index 65e6aa0e8..eab9644 100644
--- a/mkspecs/common/symbian/symbian.conf
+++ b/mkspecs/common/symbian/symbian.conf
@@ -3,7 +3,7 @@
#
TEMPLATE = app
-CONFIG += qt warn_on release incremental link_prl sis_targets run_on_phone
+CONFIG += prepend_includepath qt warn_on release incremental link_prl sis_targets run_on_phone
QT += core gui
QMAKE_INCREMENTAL_STYLE = sublib
@@ -93,7 +93,7 @@ contains(QMAKE_HOST.os,Windows) {
QMAKE_COPY = copy /y
QMAKE_COPY_DIR = xcopy /s /q /y /i
QMAKE_MOVE = move
- QMAKE_DEL_FILE = del 2> NUL
+ QMAKE_DEL_FILE = del /q 2> NUL
QMAKE_MKDIR = mkdir
QMAKE_DEL_DIR = rmdir
QMAKE_DEL_TREE = rmdir /s /q
@@ -118,11 +118,11 @@ contains(QMAKE_HOST.os,Windows) {
}
QMAKE_IDL = midl
-QMAKE_LIB = ar -ru
-QMAKE_RC = windres
QMAKE_ZIP = zip -r -9
QMAKE_UNZIP = unzip -o
+QMAKE_WRITE_DEFAULT_RC = 1
+
QMAKE_TAR = tar -cf
QMAKE_GZIP = gzip -9f
@@ -230,16 +230,41 @@ defineReplace(symbianRemoveSpecialCharacters) {
# Determines translations that are Symbian supported
defineTest(matchSymbianLanguages) {
+ # Qt language codes for which we need to parse .ts file
SYMBIAN_MATCHED_LANGUAGES =
+ # List of translation files for matched languages
SYMBIAN_MATCHED_TRANSLATIONS =
+ # List of Qt language codes for which we have no mapped Symbian code but we have a fallback code
+ # and therefore need to generate a mapping for in localize_deployment.prf.
+ # The fallback code means plain language code for languages that have both language and country codes.
+ # E.g. the fallback code for language "zh_CN" would be "zh".
+ SYMBIAN_UNMAPPED_LANGUAGES =
+ # List of handled Qt language codes to avoid duplicate Symbian language codes in case both
+ # unmapped language+country combination and its fallback code, or multiple unmapped language+country
+ # combinations that have same fallback code are included.
+ HANDLED_LANGUAGES =
# Cannot parse .ts file for language here, so detect it from filename.
# Allow two and three character language and country codes.
for(translation, TRANSLATIONS) {
language = $$replace(translation, "^(.*/)?[^/]+_(([^_]{2,3}_)?[^_]{2,3})\\.ts$", \\2)
- contains(SYMBIAN_SUPPORTED_LANGUAGES, $$language) {
- SYMBIAN_MATCHED_LANGUAGES += $$language
- SYMBIAN_MATCHED_TRANSLATIONS += $$translation
+ !contains(HANDLED_LANGUAGES, $$language) {
+ HANDLED_LANGUAGES += $$language
+ contains(SYMBIAN_SUPPORTED_LANGUAGES, $$language) {
+ SYMBIAN_MATCHED_LANGUAGES += $$language
+ SYMBIAN_MATCHED_TRANSLATIONS += $$_PRO_FILE_PWD_/$$translation
+ } else {
+ # No direct mapping for specified language found. Check if a fallback language code can be used.
+ strippedLanguage = $$replace(language, "_.*$",)
+ contains(SYMBIAN_SUPPORTED_LANGUAGES, $$strippedLanguage):!contains(HANDLED_LANGUAGES, $$strippedLanguage) {
+ HANDLED_LANGUAGES += $$strippedLanguage
+ SYMBIAN_UNMAPPED_LANGUAGES += $$language
+ SYMBIAN_MATCHED_LANGUAGES += $$language
+ SYMBIAN_MATCHED_TRANSLATIONS += $$_PRO_FILE_PWD_/$$translation
+ SYMBIAN_LANGUAGE_FALLBACK.$$language = $$strippedLanguage
+ export(SYMBIAN_LANGUAGE_FALLBACK.$$language)
+ }
+ }
}
}
@@ -247,6 +272,7 @@ defineTest(matchSymbianLanguages) {
export(SYMBIAN_MATCHED_LANGUAGES)
export(SYMBIAN_MATCHED_TRANSLATIONS)
+ export(SYMBIAN_UNMAPPED_LANGUAGES)
}
# Symbian pkg files that define multiple languages require a language specific string to be
diff --git a/mkspecs/common/symbian/symbianincludes.h b/mkspecs/common/symbian/symbianincludes.h
new file mode 100644
index 0000000..5d7f488
--- /dev/null
+++ b/mkspecs/common/symbian/symbianincludes.h
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the mkspecs 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 __PRODUCT_INCLUDE__
+# ifdef __QT_PRODUCT_INCLUDE_IS_LOWERCASE__
+# define __PRODUCT_INCLUDE__ <variant/symbian_os.hrh>
+# else
+# define __PRODUCT_INCLUDE__ <variant/Symbian_OS.hrh>
+# endif
+#endif
+
+#ifndef __QT_SYMBIAN_RESOURCE__
+# if defined(__ARMCC__) || defined(__CC_ARM)
+# ifdef __QT_RVCT_HEADER_IS_2_2__
+# include <rvct2_2.h>
+# else
+# include <rvct.h>
+# endif
+# endif
+#endif
diff --git a/mkspecs/features/symbian/def_files.prf b/mkspecs/features/symbian/def_files.prf
index 4a59116..746de6a 100644
--- a/mkspecs/features/symbian/def_files.prf
+++ b/mkspecs/features/symbian/def_files.prf
@@ -7,6 +7,18 @@ CONFIG -= def_files_disabled
equals(QMAKE_TARGET_PRODUCT, Qt4)|equals(QMAKE_TARGET_PRODUCT, QTestLib):clean_TARGET = $$replace(TARGET, "$${QT_LIBINFIX}$", "")
else:clean_TARGET = $$TARGET
+defineTest(qtTestIfDirExists) {
+ contains(QMAKE_HOST.os,Windows) {
+ dirToTest = $$1
+ $$dirToTest ~= s,/,\\,
+ # Windows trick. Test for existence of nul, which every directory has.
+ retValue = $$system("if exist $$dirToTest\\nul echo true")
+ contains(retValue, true):return(true)|return(false)
+ } else {
+ system("test -d $$1"):return(true)|return(false)
+ }
+}
+
symbian-abld|symbian-sbsv2 {
# Firstly, if the MMP_RULES already contain a defBlock variable, don't generate another one
# (this bit is slightly magic, because it depends upon everyone creating their DEFFILE statements
@@ -52,9 +64,11 @@ symbian-abld|symbian-sbsv2 {
} else {
defFile = .
}
- system("$$QMAKE_CHK_DIR_EXISTS $$_PRO_FILE_PWD_/$$defFile") {
+ qtTestIfDirExists($$_PRO_FILE_PWD_/$$defFile) {
!exists("$$_PRO_FILE_PWD_/$$defFile/eabi") {
- system("$$QMAKE_MKDIR $$_PRO_FILE_PWD_/$$defFile/eabi")
+ dirToCreate = $$_PRO_FILE_PWD_/$$defFile/eabi
+ contains(QMAKE_HOST.os,Windows):dirToCreate ~= s,/,\\,
+ system("$$QMAKE_MKDIR $$dirToCreate")
}
elf2e32FileToAdd = $$_PRO_FILE_PWD_/$$defFile/eabi/$$basename(clean_TARGET)u.def
} else {
diff --git a/mkspecs/features/symbian/default_post.prf b/mkspecs/features/symbian/default_post.prf
index 126981e..a05ff25 100644
--- a/mkspecs/features/symbian/default_post.prf
+++ b/mkspecs/features/symbian/default_post.prf
@@ -53,6 +53,38 @@ isEmpty(TARGET.UID2) {
}
}
+# Add dependency to Qt package to all other projects besides Qt libs.
+# Note: Qt libs package with full capabilities has UID3 of 0x2001E61C,
+# while self-signed version typically has temporary UID3 of 0xE001E61C.
+contains(CONFIG, qt):!contains(TARGET.UID3, 0x2001E61C):!contains(TARGET.UID3, 0xE001E61C):isEmpty(QT_LIBINFIX) {
+ qt_pkg_name = Qt
+ pkg_depends_qt += \
+ "; Default dependency to Qt libraries" \
+ "(0x2001E61C), $${QT_MAJOR_VERSION}, $${QT_MINOR_VERSION}, $${QT_PATCH_VERSION}, {$$addLanguageDependentPkgItem(qt_pkg_name)}"
+
+ # Projects linking to webkit need dependency to webkit
+ contains(QT, webkit): {
+ # these can be overridden by mkspecs/modules/qt_webkit.pri
+ isEmpty(QT_WEBKIT_MAJOR_VERSION) {
+ QT_WEBKIT_MAJOR_VERSION = $${QT_MAJOR_VERSION}
+ QT_WEBKIT_MINOR_VERSION = $${QT_MINOR_VERSION}
+ QT_WEBKIT_PATCH_VERSION = $${QT_PATCH_VERSION}
+ }
+
+ webkit_pkg_name = QtWebKit
+ pkg_depends_webkit += \
+ "; Dependency to Qt Webkit" \
+ "(0x200267C2), $${QT_WEBKIT_MAJOR_VERSION}, $${QT_WEBKIT_MINOR_VERSION}, $${QT_WEBKIT_PATCH_VERSION}, {$$addLanguageDependentPkgItem(webkit_pkg_name)}"
+ } else {
+ default_deployment.pkg_prerules -= pkg_depends_webkit
+ }
+} else {
+ default_deployment.pkg_prerules -= pkg_depends_webkit pkg_depends_qt
+}
+
+isEmpty(TARGET.EPOCSTACKSIZE):TARGET.EPOCSTACKSIZE = 0x14000
+isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x020000 0x800000
+
# Supports Symbian^3 and Symbian^4 by default and also S60 3.1, 3.2, and 5.0 if built against any of those.
platform_product_id = S60ProductID
platform_product_id = $$addLanguageDependentPkgItem(platform_product_id)
diff --git a/mkspecs/features/symbian/do_not_build_as_thumb.prf b/mkspecs/features/symbian/do_not_build_as_thumb.prf
index 60d9382..0f1fd9f 100644
--- a/mkspecs/features/symbian/do_not_build_as_thumb.prf
+++ b/mkspecs/features/symbian/do_not_build_as_thumb.prf
@@ -1,6 +1,6 @@
symbian-abld|symbian-sbsv2 {
MMP_RULES += ALWAYS_BUILD_AS_ARM
-} else:linux-armcc {
+} else:symbian-armcc {
QMAKE_CFLAGS -= --thumb
QMAKE_CFLAGS += --arm
QMAKE_CXXFLAGS -= --thumb
diff --git a/mkspecs/features/symbian/localize_deployment.prf b/mkspecs/features/symbian/localize_deployment.prf
index 26a254b..185c713 100644
--- a/mkspecs/features/symbian/localize_deployment.prf
+++ b/mkspecs/features/symbian/localize_deployment.prf
@@ -101,6 +101,15 @@ isEmpty(SYMBIAN_MATCHED_LANGUAGES) {
matchSymbianLanguages()
}
+# If there are translations that do not have Symbian language code defined for that exact
+# language + country combination, but have Symbian language code defined for just the language,
+# map the language + country combination to the same value as the plain language.
+for(language, SYMBIAN_UNMAPPED_LANGUAGES) {
+ languageVar = SYMBIAN_LANG.$${language}
+ fallbackLanguageVar = SYMBIAN_LANG.$$eval(SYMBIAN_LANGUAGE_FALLBACK.$$language)
+ $$languageVar = $$eval($$fallbackLanguageVar)
+}
+
!isEmpty(SYMBIAN_MATCHED_TRANSLATIONS) {
# Generate dependencies to .ts files for pkg files
template_pkg_target.depends += $$SYMBIAN_MATCHED_TRANSLATIONS
diff --git a/mkspecs/features/symbian/prepend_includepath.prf b/mkspecs/features/symbian/prepend_includepath.prf
new file mode 100644
index 0000000..d9fd4fe
--- /dev/null
+++ b/mkspecs/features/symbian/prepend_includepath.prf
@@ -0,0 +1,14 @@
+# Allow .pro files to specify include path(s) to be prepended to the list.
+#
+# This allows the project to override the default ordering, whereby paths
+# relative to $$QMAKE_INCDIR_QT always come first. This ordering can cause
+# problems when both the epoc32/include tree and a Qt include directory
+# contain a header of the same name - in this case, the Qt header is always
+# included by virtue of its path appearing first in the SYSTEMINCLUDE
+# directives in the generated MMP file.
+#
+# To work around this situation, the following line can be added to the .pro
+# file:
+# PREPEND_INCLUDEPATH = /epoc32/include
+#
+INCLUDEPATH = $$PREPEND_INCLUDEPATH $$INCLUDEPATH
diff --git a/mkspecs/features/symbian/qt.prf b/mkspecs/features/symbian/qt.prf
index c8f97aa..c376b64 100644
--- a/mkspecs/features/symbian/qt.prf
+++ b/mkspecs/features/symbian/qt.prf
@@ -6,53 +6,6 @@ CONFIG += qtmain
load(qt)
-# Allow .pro files to specify include path(s) to be prepended to the list.
-#
-# This allows the project to override the default ordering, whereby paths
-# relative to $$QMAKE_INCDIR_QT always come first. This ordering can cause
-# problems when both the epoc32/include tree and a Qt include directory
-# contain a header of the same name - in this case, the Qt header is always
-# included by virtue of its path appearing first in the SYSTEMINCLUDE
-# directives in the generated MMP file.
-#
-# To work around this situation, the following line can be added to the .pro
-# file:
-# PREPEND_INCLUDEPATH = /epoc32/include
-#
-INCLUDEPATH = $$PREPEND_INCLUDEPATH $$INCLUDEPATH
-
-# Add dependency to Qt package to all other projects besides Qt libs.
-# Note: Qt libs package with full capabilities has UID3 of 0x2001E61C,
-# while self-signed version typically has temporary UID3 of 0xE001E61C.
-contains(CONFIG, qt):!contains(TARGET.UID3, 0x2001E61C):!contains(TARGET.UID3, 0xE001E61C):isEmpty(QT_LIBINFIX) {
- qt_pkg_name = Qt
- pkg_depends_qt += \
- "; Default dependency to Qt libraries" \
- "(0x2001E61C), $${QT_MAJOR_VERSION}, $${QT_MINOR_VERSION}, $${QT_PATCH_VERSION}, {$$addLanguageDependentPkgItem(qt_pkg_name)}"
-
- # Projects linking to webkit need dependency to webkit
- contains(QT, webkit): {
- # these can be overridden by mkspecs/modules/qt_webkit.pri
- isEmpty(QT_WEBKIT_MAJOR_VERSION) {
- QT_WEBKIT_MAJOR_VERSION = $${QT_MAJOR_VERSION}
- QT_WEBKIT_MINOR_VERSION = $${QT_MINOR_VERSION}
- QT_WEBKIT_PATCH_VERSION = $${QT_PATCH_VERSION}
- }
-
- webkit_pkg_name = QtWebKit
- pkg_depends_webkit += \
- "; Dependency to Qt Webkit" \
- "(0x200267C2), $${QT_WEBKIT_MAJOR_VERSION}, $${QT_WEBKIT_MINOR_VERSION}, $${QT_WEBKIT_PATCH_VERSION}, {$$addLanguageDependentPkgItem(webkit_pkg_name)}"
- } else {
- default_deployment.pkg_prerules -= pkg_depends_webkit
- }
-} else {
- default_deployment.pkg_prerules -= pkg_depends_webkit pkg_depends_qt
-}
-
-isEmpty(TARGET.EPOCSTACKSIZE):TARGET.EPOCSTACKSIZE = 0x14000
-isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x020000 0x800000
-
# Workaround for the fact that Gnupoc and Symbian chose different approaches to
# the letter casing of headers.
contains(CONFIG, is_using_gnupoc) {
diff --git a/mkspecs/features/symbian/qt_config.prf b/mkspecs/features/symbian/qt_config.prf
index 2f446dc..82c1862 100644
--- a/mkspecs/features/symbian/qt_config.prf
+++ b/mkspecs/features/symbian/qt_config.prf
@@ -3,7 +3,7 @@ load(qt_config)
!contains(QMAKE_HOST.os, "Windows") {
# Test for the existence of lower cased headers, a sign of using Gnupoc.
# Note that the qmake "exists" test won't do because it is case insensitive.
- system("test -f $${EPOCROOT}/epoc32/include/akndoc.h") {
+ system("test -f $${EPOCROOT}epoc32/include/akndoc.h") {
CONFIG += is_using_gnupoc
}
}
diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf
index 0d2e053..28046b4 100644
--- a/mkspecs/features/symbian/symbian_building.prf
+++ b/mkspecs/features/symbian/symbian_building.prf
@@ -1,7 +1,12 @@
-linux-armcc {
+symbian-armcc {
QMAKE_CFLAGS += $$QMAKE_CFLAGS.ARMCC
QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS.ARMCC
-} else:linux-gcce {
+ # This is to prevent inclusion of the shipped RVCT headers, which are often in the
+ # environment variable RVCTxxINC by default. -J prevents the searching of that location,
+ # but needs a path, so just specify somewhere guaranteed not to contain header files.
+ QMAKE_CFLAGS += -J$${EPOCROOT}epoc32/ignore_this_path
+ QMAKE_CXXFLAGS += -J$${EPOCROOT}epoc32/ignore_this_path
+} else:symbian-gcce {
QMAKE_CFLAGS += $$QMAKE_CFLAGS.GCCE
QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS.GCCE
}
@@ -16,7 +21,7 @@ else:clean_TARGET = $$TARGET
!contains(clean_TARGET, ".*[ -/].*"):eval(TMPVAR = \$\$QMAKE_$${clean_TARGET}_LFLAGS)
!isEmpty(TMPVAR) {
QMAKE_LFLAGS += $$TMPVAR
-} else :linux-gcce { # lets provide a simple default. Without elf2e32 complains
+} else :symbian-gcce { # lets provide a simple default. Without elf2e32 complains
QMAKE_LFLAGS += -Ttext 0x80000 -Tdata 0x400000
}
@@ -62,8 +67,8 @@ for(libToProcess, libsToProcess) {
} else {
qt_newLib = $$processSymbianLibrary($$qt_library)
contains(qt_newLib, ".*\\.dso$")|contains(qt_newLib, ".*\\.lib$"):PRE_TARGETDEPS += $$qt_newLib
- linux-gcce:qt_newLib = "-l:$$qt_newLib"
- eval($$libToProcess += \$\$qt_newLib)
+ symbian-gcce:qt_newLib = "-l:$$qt_newLib"
+ eval($$libToProcess *= \$\$qt_newLib)
}
}
}
@@ -89,12 +94,13 @@ count(splitVersion, 0) {
decVersion = "10.0"
} else {
count(splitVersion, 3) {
- hexVersion = $$system("sh -c 'printf %02x $$member(splitVersion, 0)'")
- hexPart2 = $$system("sh -c 'printf %02x $$member(splitVersion, 1)'")
- hexPart2 = $$hexPart2$$system("sh -c 'printf %02x $$member(splitVersion, 2)'")
- decVersion = $$system("sh -c 'printf %1d 0x$$hexVersion'").
+ hexVersion = $$system("perl -e \"printf (\\\"%02x\\\", $$member(splitVersion, 0))\"")
+ hexPart2 = $$system("perl -e \"printf (\\\"%02x\\\", $$member(splitVersion, 1))\"")
+ hexPart2 = $$hexPart2$$system("perl -e \"printf (\\\"%02x\\\", $$member(splitVersion, 2))\"")
+ decVersion = $$system("perl -e \"printf (\\\"%1d\\\", 0x$$hexVersion)\"").
hexVersion = $$hexVersion$$hexPart2
- decVersion = $$decVersion$$system("sh -c 'printf %d 0x$$hexPart2'")
+ decVersion = $$decVersion$$system("perl -e \"printf (\\\"%d\\\", 0x$$hexPart2)\"")
+
!contains(hexVersion, "[0-9a-f]{8}"):hexVersion = "00$${hexVersion}"
} else { # app code may have different numbering...
hexVersion = $$VERSION
@@ -117,7 +123,9 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) {
contains(CONFIG, plugin):QMAKE_ELF2E32_FLAGS += --definput=plugin_commonu.def
!isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK = $$escape_expand(\\n\\t)$$QMAKE_POST_LINK
- QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${baseTarget}.dll $$symbianDestdir/$${baseTarget}.sym \
+ moveCmd = $$QMAKE_MOVE $$symbianDestdir/$${baseTarget}.dll $$symbianDestdir/$${baseTarget}.sym
+ contains(QMAKE_HOST.os,Windows):moveCmd = $$replace(moveCmd, /, \\)
+ QMAKE_POST_LINK = $$moveCmd \
&& $$QMAKE_ELF2E32_WRAPPER --version=$$decVersion \
--sid=$$TARGET.SID \
--uid1=0x10000079 \
@@ -129,7 +137,7 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) {
--tmpdso=$${symbianObjdir}/$${baseTarget}.dso \
--dso=$${symbianDestdir}/$${baseTarget}.dso \
--defoutput=$$symbianObjdir/$${baseTarget}.def \
- --linkas=$${baseTarget}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll \
+ --linkas=\"$${baseTarget}{$${hexVersion}}[$${intUid3}].dll\" \
--heap=$$epoc_heap_size \
--stack=$$TARGET.EPOCSTACKSIZE \
$$elf2e32_LIBPATH \
@@ -142,10 +150,15 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) {
QMAKE_CLEAN += $${symbianObjdir}/$${baseTarget}.dso
QMAKE_CLEAN += $${symbianObjdir}/$${baseTarget}.def
- linux-armcc: {
- LIBS += usrt2_2.lib dfpaeabi.dso dfprvct2_2.dso drtaeabi.dso scppnwdl.dso drtrvct2_2.dso h_t__uf.l\\(switch8.o\\)
- LIBS += -ledllstub.lib -ledll.lib\\(uc_dll_.o\\)
- } else :linux-gcce {
+ symbian-armcc: {
+ LIBS += usrt2_2.lib dfpaeabi.dso dfprvct2_2.dso drtaeabi.dso scppnwdl.dso drtrvct2_2.dso
+ # Quotation unfortunately is different on Windows and unix.
+ contains(QMAKE_HOST.os, Windows) {
+ LIBS += \"h_t__uf.l(switch8.o)\" edllstub.lib \"edll.lib(uc_dll_.o)\"
+ } else {
+ LIBS += h_t__uf.l\\(switch8.o\\) edllstub.lib edll.lib\\(uc_dll_.o\\)
+ }
+ } else :symbian-gcce {
LIBS += \
-l:edllstub.lib \
-l:edll.lib \
@@ -157,13 +170,15 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) {
-lgcc
}
- QMAKE_LFLAGS += --soname $${baseTarget}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll
+ QMAKE_LFLAGS += --soname \"$${baseTarget}{$${hexVersion}}[$${intUid3}].dll\"
DEFINES += __DLL__
}
contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@:.*") {
!isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK = $$escape_expand(\\n\\t)$$QMAKE_POST_LINK
- QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${baseTarget} $$symbianDestdir/$${baseTarget}.sym \
+ moveCmd = $$QMAKE_MOVE $$symbianDestdir/$${baseTarget} $$symbianDestdir/$${baseTarget}.sym
+ contains(QMAKE_HOST.os,Windows):moveCmd = $$replace(moveCmd, /, \\)
+ QMAKE_POST_LINK = $$moveCmd \
&& $$QMAKE_ELF2E32_WRAPPER --version $$decVersion \
--sid=$$TARGET.SID \
--uid1=0x1000007a \
@@ -172,7 +187,7 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@:.*") {
--targettype=EXE \
--elfinput=$${symbianDestdir}/$${baseTarget}.sym \
--output=$${symbianDestdir}/$${baseTarget}.exe \
- --linkas=$${baseTarget}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe \
+ --linkas=\"$${baseTarget}{$${hexVersion}}[$${intUid3}].exe\" \
--heap=$$epoc_heap_size \
--stack=$$TARGET.EPOCSTACKSIZE \
$$elf2e32_LIBPATH \
@@ -185,7 +200,7 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@:.*") {
QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.exe
QMAKE_CLEAN += $${symbianDestdir}/$${baseTarget}
- linux-armcc: {
+ symbian-armcc: {
QMAKE_LIBS += usrt2_2.lib dfpaeabi.dso dfprvct2_2.dso drtaeabi.dso scppnwdl.dso drtrvct2_2.dso h_t__uf.l\\(switch8.o\\)
QMAKE_LIBS += -leexe.lib\\(uc_exe_.o\\)
contains(CONFIG, "qt") {
@@ -195,7 +210,7 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@:.*") {
QMAKE_LIBS -= $$QMAKE_LIBS_NO_QT_ENTRY
QMAKE_LIBS += $$QMAKE_LIBS_NO_QT_ENTRY
}
- } else :linux-gcce {
+ } else :symbian-gcce {
# notice that we can't merge these as ordering of arguments is important.
QMAKE_LIBS += \
-l:eexe.lib \
@@ -220,18 +235,14 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@:.*") {
QMAKE_LFLAGS += --shared
}
- QMAKE_LFLAGS += --soname $${baseTarget}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe
+ QMAKE_LFLAGS += --soname \"$${baseTarget}{$${hexVersion}}[$${intUid3}].exe\"
DEFINES += __EXE__
}
# Symbian resource files
-linux-armcc: {
- SYMBIAN_RVCT22INC=$$(RVCT22INC)
- !isEmpty(SYMBIAN_RVCT22INC):symbian_resources_INCLUDES = -I$${SYMBIAN_RVCT22INC}
-}
-symbian_resources_INCLUDES = $$replace(symbian_resources_INCLUDES, ",", " -I")
-symbian_resources_INCLUDES += $$join(INCLUDEPATH, " -I", "-I")
+symbian_resources_INCLUDES = $$join(INCLUDEPATH, " -I", "-I")
symbian_resources_DEFINES = $$join(DEFINES, " -D", "-D")
+symbian_resources_DEFINES += -D__QT_SYMBIAN_RESOURCE__
symbian_resources_RCC_DIR = $$replace(RCC_DIR, "/$", "")
symbian_resources_INCLUDES += "-I$$symbian_resources_RCC_DIR"
@@ -246,6 +257,7 @@ for(symbian_resource, SYMBIAN_RESOURCES) {
symbianresources.input = SYMBIAN_RESOURCES
symbianresources.output = $$symbian_resources_RCC_DIR/${QMAKE_FILE_BASE}$${QT_LIBINFIX}.rsg
symbianresources.commands = cpp -nostdinc -undef \
+ -include $$QMAKE_SYMBIAN_INCLUDES \
$$symbian_resources_INCLUDES \
$$symbian_resources_DEFINES \
${QMAKE_FILE_NAME} \
@@ -261,46 +273,79 @@ symbianresources.CONFIG = no_link target_predeps
QMAKE_EXTRA_COMPILERS += symbianresources
+# This section generates the rsg and rsc files for symbian.
contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") {
- # Make our own extra target in order to get dependencies for generated
- # files right. This also avoids the warning about files not found.
- symbianGenResource.target = $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
- symbianGenResource.commands = cpp -nostdinc -undef \
- $$symbian_resources_INCLUDES \
- $$symbian_resources_DEFINES \
- $${baseTarget}.rss \
- > $${symbian_resources_RCC_DIR}/$${baseTarget}.rpp \
- && rcomp -u -m045,046,047 \
- -s$${symbian_resources_RCC_DIR}/$${baseTarget}.rpp \
- -o$${symbianDestdir}/$${baseTarget}.rsc \
- -h$${symbian_resources_RCC_DIR}/$${baseTarget}.rsg \
- -i$${baseTarget}.rss
- silent:symbianGenResource.commands = @echo rcomp $${baseTarget}.rss && $$symbianGenResource.commands
- symbianGenResource.depends = $${baseTarget}.rss
- PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
- QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
- QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}.rpp
- QMAKE_DISTCLEAN += $${baseTarget}.rss
- QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.rsc
-
- symbianGenRegResource.target = $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg
- symbianGenRegResource.commands = cpp -nostdinc -undef \
- $$symbian_resources_INCLUDES \
- $$symbian_resources_DEFINES \
- $${baseTarget}_reg.rss \
- > $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp \
- && rcomp -u -m045,046,047 \
- -s$${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp \
- -o$${symbianDestdir}/$${baseTarget}_reg.rsc \
- -h$${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg \
- -i$${baseTarget}_reg.rss
- silent:symbianGenRegResource.commands = @echo rcomp $${baseTarget}_reg.rss && $$symbianGenRegResource.commands
- symbianGenRegResource.depends = $${baseTarget}_reg.rss $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
- PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg
- QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg
- QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp
- QMAKE_DISTCLEAN += $${baseTarget}_reg.rss
- QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}_reg.rsc
+ # Look for extra languages for the resources, and then generate a target for each one.
+ localize_deployment:symbianGenResourceLanguages = $$SYMBIAN_MATCHED_LANGUAGES default
+ else:symbianGenResourceLanguages = default
+ for(language, symbianGenResourceLanguages) {
+ # Special languages get their language number appended to the filename.
+ contains(language, default) {
+ symbianGenResource_DEFINES = $$symbian_resources_DEFINES
+ rpp = $${symbian_resources_RCC_DIR}/$${baseTarget}.rpp
+ rsc = $${symbianDestdir}/$${baseTarget}.rsc
+ rsg = $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
+ } else {
+ languageNo = $$eval(SYMBIAN_LANG.$$language)
+ symbianGenResource_DEFINES = $$symbian_resources_DEFINES -DLANGUAGE_$${languageNo}
+ rpp = $${symbian_resources_RCC_DIR}/$${baseTarget}_$${languageNo}.rpp
+ rsc = $${symbianDestdir}/$${baseTarget}.r$${languageNo}
+ rsg = $${symbian_resources_RCC_DIR}/$${baseTarget}_$${languageNo}.rsg
+ }
+
+ # Make our own extra target in order to get dependencies for generated
+ # files right. This also avoids the warning about files not found.
+ eval(symbianGenResource_$${language}.target = $$rsg)
+ eval(symbianGenResource_$${language}.commands = cpp -nostdinc -undef \
+ -include $$QMAKE_SYMBIAN_INCLUDES \
+ $$symbian_resources_INCLUDES \
+ $$symbianGenResource_DEFINES \
+ $${baseTarget}.rss \
+ > $$rpp \
+ && rcomp -u -m045,046,047 \
+ -s$$rpp \
+ -o$$rsc \
+ -h$$rsg \
+ -i$${baseTarget}.rss)
+ silent:eval(symbianGenResource_$${language}.commands = @echo rcomp $${baseTarget}.rss && $$eval(symbianGenResource_$${language}.commands))
+ eval(symbianGenResource_$${language}.depends = $${baseTarget}.rss)
+ PRE_TARGETDEPS += $$rsg
+ QMAKE_CLEAN += $$rsg $$rpp
+ QMAKE_DISTCLEAN += $$rsc
+
+ QMAKE_EXTRA_TARGETS += symbianGenResource_$${language}
+
+ # Note that we depend on the base rsg file, even if dealing with a specific language.
+ # hence we don't use $$rsg on the next line.
+ eval(symbianGenRegResource_$${language}.depends = $${baseTarget}_reg.rss $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg)
+ contains(language, default) {
+ rpp = $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp
+ rsc = $${symbianDestdir}/$${baseTarget}_reg.rsc
+ rsg = $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg
+ } else {
+ rpp = $${symbian_resources_RCC_DIR}/$${baseTarget}_reg_$${languageNo}.rpp
+ rsc = $${symbianDestdir}/$${baseTarget}_reg.r$${languageNo}
+ rsg = $${symbian_resources_RCC_DIR}/$${baseTarget}_reg_$${languageNo}.rsg
+ }
+ eval(symbianGenRegResource_$${language}.target = $$rsg)
+ eval(symbianGenRegResource_$${language}.commands = cpp -nostdinc -undef \
+ -include $$QMAKE_SYMBIAN_INCLUDES \
+ $$symbian_resources_INCLUDES \
+ $$symbianGenResource_DEFINES \
+ $${baseTarget}_reg.rss \
+ > $$rpp \
+ && rcomp -u -m045,046,047 \
+ -s$$rpp \
+ -o$$rsc \
+ -h$$rsg \
+ -i$${baseTarget}_reg.rss)
+ silent:eval(symbianGenRegResource_$${language}.commands = @echo rcomp $${baseTarget}_reg.rss && $$eval(symbianGenRegResource_$${language}.commands))
+ PRE_TARGETDEPS += $$rsg
+ QMAKE_CLEAN += $$rsg $$rpp
+ QMAKE_DISTCLEAN += $$rsc
+
+ QMAKE_EXTRA_TARGETS += symbianGenRegResource_$${language}
+ }
# Trick to get qmake to create the RCC_DIR for us.
symbianRccDirCreation.input = SOURCES
@@ -308,14 +353,15 @@ contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") {
symbianRccDirCreation.output = $${symbian_resources_RCC_DIR}/symbian_resource_dummy
symbianRccDirCreation.CONFIG = no_link combine
- QMAKE_EXTRA_TARGETS += symbianGenResource symbianGenRegResource
QMAKE_EXTRA_COMPILERS += symbianRccDirCreation
- QMAKE_DISTCLEAN += $${baseTarget}.loc
+ QMAKE_DISTCLEAN += $${baseTarget}.rss \
+ $${baseTarget}_reg.rss \
+ $${baseTarget}.loc
}
# Generated pkg files
-QMAKE_DISTCLEAN += $${baseTarget}_template.pkg
-QMAKE_DISTCLEAN += $${baseTarget}_installer.pkg
-QMAKE_DISTCLEAN += $${baseTarget}_stub.pkg
+QMAKE_DISTCLEAN += $${baseTarget}_template.pkg \
+ $${baseTarget}_installer.pkg \
+ $${baseTarget}_stub.pkg
diff --git a/mkspecs/symbian/linux-gcce/features/default_post.prf b/mkspecs/symbian-armcc/features/default_post.prf
index 7aa1f4d..7aa1f4d 100644
--- a/mkspecs/symbian/linux-gcce/features/default_post.prf
+++ b/mkspecs/symbian-armcc/features/default_post.prf
diff --git a/mkspecs/symbian/linux-armcc/qmake.conf b/mkspecs/symbian-armcc/qmake.conf
index f058421..77a1966 100644
--- a/mkspecs/symbian/linux-armcc/qmake.conf
+++ b/mkspecs/symbian-armcc/qmake.conf
@@ -1,10 +1,10 @@
#
-# qmake configuration for symbian/linux-armcc
+# qmake configuration for symbian-armcc
#
-include(../../common/symbian/symbian-makefile.conf)
+include(../common/symbian/symbian-makefile.conf)
-include(../../common/armcc.conf)
+include(../common/armcc.conf)
QMAKE_RVCT_LINKSTYLE = 1
@@ -53,10 +53,7 @@ INCLUDEPATH = $${EPOCROOT}epoc32/include \
exists($${EPOCROOT}epoc32/include/rvct2_2) {
INCLUDEPATH += $${EPOCROOT}epoc32/include/rvct2_2
- QMAKE_CFLAGS += --preinclude rvct2_2.h
- QMAKE_CXXFLAGS += --preinclude rvct2_2.h
+ DEFINES *= __QT_RVCT_HEADER_IS_2_2__
} else {
INCLUDEPATH += $${EPOCROOT}epoc32/include/rvct
- QMAKE_CFLAGS += --preinclude rvct.h
- QMAKE_CXXFLAGS += --preinclude rvct.h
}
diff --git a/mkspecs/symbian/linux-armcc/qplatformdefs.h b/mkspecs/symbian-armcc/qplatformdefs.h
index 19c97ff..0eb74ca 100644
--- a/mkspecs/symbian/linux-armcc/qplatformdefs.h
+++ b/mkspecs/symbian-armcc/qplatformdefs.h
@@ -39,4 +39,4 @@
**
****************************************************************************/
-#include "../../common/symbian/qplatformdefs.h"
+#include "../common/symbian/qplatformdefs.h"
diff --git a/mkspecs/symbian/linux-armcc/features/default_post.prf b/mkspecs/symbian-gcce/features/default_post.prf
index 7aa1f4d..7aa1f4d 100644
--- a/mkspecs/symbian/linux-armcc/features/default_post.prf
+++ b/mkspecs/symbian-gcce/features/default_post.prf
diff --git a/mkspecs/symbian/linux-gcce/qmake.conf b/mkspecs/symbian-gcce/qmake.conf
index 62cc9ae..62a079b 100644
--- a/mkspecs/symbian/linux-gcce/qmake.conf
+++ b/mkspecs/symbian-gcce/qmake.conf
@@ -1,10 +1,10 @@
#
-# qmake configuration for symbian/linux-gcce
+# qmake configuration for symbian-gcce
#
-include(../../common/symbian/symbian-makefile.conf)
+include(../common/symbian/symbian-makefile.conf)
-include(../../common/g++.conf)
+include(../common/g++.conf)
QMAKE_CC = arm-none-symbianelf-gcc
QMAKE_CXX = arm-none-symbianelf-g++
@@ -53,40 +53,40 @@ DEFINES += __GCCE__ \
UNICODE
QMAKE_LFLAGS_APP += --entry=_E32Startup -u _E32Startup
-QMAKE_LFLAGS_SHLIB += --default-symver --entry=_E32Dll -u _E32Dll
+QMAKE_LFLAGS_SHLIB += -shared --default-symver --entry=_E32Dll -u _E32Dll
QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB
-gcceExtraFlags = --include=${EPOCROOT}/epoc32/include/gcce/gcce.h -march=armv5t -mapcs -mthumb-interwork -nostdinc -c -msoft-float -T script
+gcceExtraFlags = --include=$${EPOCROOT}epoc32/include/gcce/gcce.h -march=armv5t -mapcs -mthumb-interwork -nostdinc -c -msoft-float -T script
QMAKE_CFLAGS += $${gcceExtraFlags}
QMAKE_CXXFLAGS += $${gcceExtraFlags} -x c++ -fexceptions -fno-unit-at-a-time -fvisibility-inlines-hidden
#If we are not going to link to Qt or qtmain.lib, we need to include this at least once.
isEmpty(QT):contains(TEMPLATE, app) {
- QMAKE_CXXFLAGS += --include=${EPOCROOT}/epoc32/include/stdapis/staticlibinit_gcce.h
+ QMAKE_CXXFLAGS += --include=$${EPOCROOT}epoc32/include/stdapis/staticlibinit_gcce.h
}
QMAKE_LFLAGS += --target1-abs \
--no-undefined \
--nostdlib
-QMAKE_LIBDIR += ${EPOCROOT}/epoc32/release/armv5/udeb/
+QMAKE_LIBDIR += $${EPOCROOT}epoc32/release/armv5/udeb/
# g++ knows the path to the gcc-shipped-libs, ld doesn't. So cache the full path in the generate Makefile
-QMAKE_GCC_SEARCH_DIRS =$$system($$QMAKE_CXX -print-search-dirs)
-for(line, QMAKE_GCC_SEARCH_DIRS) {
- contains(line, "libraries:") {
- foundIt="1"
- } else {
- contains(foundIt, "1") {
- QMAKE_LFLAGS += $$replace(line, "[=:]", " -L")
- }
- }
+QMAKE_GCC_SEARCH_DIRS = $$system($$QMAKE_CXX -print-search-dirs)
+QMAKE_GCC_SEARCH_DIRS = "$$join(QMAKE_GCC_SEARCH_DIRS, " ")"
+QMAKE_GCC_SEARCH_DIRS = $$replace(QMAKE_GCC_SEARCH_DIRS, ".*libraries: *", "")
+QMAKE_GCC_SEARCH_DIRS = $$replace(QMAKE_GCC_SEARCH_DIRS, "=", "")
+contains(QMAKE_HOST.os,Windows) {
+ QMAKE_GCC_SEARCH_DIRS = $$split(QMAKE_GCC_SEARCH_DIRS, ;)
+} else {
+ QMAKE_GCC_SEARCH_DIRS = $$split(QMAKE_GCC_SEARCH_DIRS, :)
}
+for(line, QMAKE_GCC_SEARCH_DIRS):QMAKE_LIBDIR += $$line
-QMAKE_LIBDIR += $${EPOCROOT}/epoc32/release/armv5/lib
+QMAKE_LIBDIR += $${EPOCROOT}epoc32/release/armv5/lib
-INCLUDEPATH = ${EPOCROOT}/epoc32/include/ \
- $${EPOCROOT}/epoc32/include/variant \
- $${EPOCROOT}/epoc32/include/stdapis \
- $${EPOCROOT}/epoc32/include/gcce \
+INCLUDEPATH = $${EPOCROOT}epoc32/include/ \
+ $${EPOCROOT}epoc32/include/variant \
+ $${EPOCROOT}epoc32/include/stdapis \
+ $${EPOCROOT}epoc32/include/gcce \
$$INCLUDEPATH
diff --git a/mkspecs/symbian/linux-gcce/qplatformdefs.h b/mkspecs/symbian-gcce/qplatformdefs.h
index ae46e15..9d95a37 100644
--- a/mkspecs/symbian/linux-gcce/qplatformdefs.h
+++ b/mkspecs/symbian-gcce/qplatformdefs.h
@@ -39,5 +39,5 @@
**
****************************************************************************/
-#include "../../common/symbian/qplatformdefs.h"
+#include "../common/symbian/qplatformdefs.h"
diff --git a/mkspecs/symbian-sbsv2/flm/qt/qmake_clean.flm b/mkspecs/symbian-sbsv2/flm/qt/qmake_clean.flm
index fe35e6e..c9a88fc 100644
--- a/mkspecs/symbian-sbsv2/flm/qt/qmake_clean.flm
+++ b/mkspecs/symbian-sbsv2/flm/qt/qmake_clean.flm
@@ -13,6 +13,6 @@ SINGLETON:=$(call sanitise,QMAKE_CLEAN_SINGLETON_$(EXTENSION_ROOT))
ifeq ($($(SINGLETON)),)
# Prevent duplicate targets from being created
$(SINGLETON):=1
-$(eval $(call GenerateStandardCleanTarget,$(CLEAN_FILES),''))
+$(eval $(call GenerateStandardCleanTarget,$(wildcard $(patsubst "%",%,$(CLEAN_FILES)))))
endif
diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf
index 65ae590..da65727 100644
--- a/mkspecs/win32-g++/qmake.conf
+++ b/mkspecs/win32-g++/qmake.conf
@@ -62,6 +62,8 @@ QMAKE_LFLAGS_WINDOWS = -Wl,-subsystem,windows
QMAKE_LFLAGS_DLL = -shared
QMAKE_LINK_OBJECT_MAX = 10
QMAKE_LINK_OBJECT_SCRIPT= object_script
+QMAKE_PREFIX_STATICLIB = lib
+QMAKE_EXTENSION_STATICLIB = a
QMAKE_LIBS =
diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp
index 6c43b6f..26d587d 100644
--- a/qmake/generators/metamakefile.cpp
+++ b/qmake/generators/metamakefile.cpp
@@ -488,6 +488,8 @@ MetaMakefileGenerator::createMakefileGenerator(QMakeProject *proj, bool noIO)
mkfile = new SymbianSbsv2MakefileGenerator;
} else if(gen == "SYMBIAN_UNIX") {
mkfile = new SymbianMakefileTemplate<UnixMakefileGenerator>;
+ } else if(gen == "SYMBIAN_MINGW") {
+ mkfile = new SymbianMakefileTemplate<MingwMakefileGenerator>;
} else {
fprintf(stderr, "Unknown generator specified: %s\n", gen.toLatin1().constData());
}
@@ -544,7 +546,7 @@ MetaMakefileGenerator::modesForGenerator(const QString &gen,
} else if (gen == "PROJECTBUILDER" || gen == "XCODE") {
*host_mode = Option::HOST_MACX_MODE;
*target_mode = Option::TARG_MACX_MODE;
- } else if (gen == "SYMBIAN_ABLD" || gen == "SYMBIAN_SBSV2" || gen == "SYMBIAN_UNIX") {
+ } else if (gen == "SYMBIAN_ABLD" || gen == "SYMBIAN_SBSV2" || gen == "SYMBIAN_UNIX" || gen == "SYMBIAN_MINGW") {
#if defined(Q_OS_MAC)
*host_mode = Option::HOST_MACX_MODE;
#elif defined(Q_OS_UNIX)
diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp
index 96d7725..c0afaaf 100644
--- a/qmake/generators/symbian/symbiancommon.cpp
+++ b/qmake/generators/symbian/symbiancommon.cpp
@@ -394,8 +394,7 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile,
t << manufacturerStr << endl;
}
- // ### FIXME: remove epocBuild check once makefile based mkspecs support localized resource generation
- if (epocBuild && symbianLocalizationList.size()) {
+ if (symbianLocalizationList.size()) {
// Add localized resources to DEPLOYMENT if default resource deployment is done
addLocalizedResourcesToDeployment("default_resource_deployment.sources", symbianLocalizationList);
addLocalizedResourcesToDeployment("default_reg_deployment.sources", symbianLocalizationList);
diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp
index f94a63f..0fdef86 100644
--- a/qmake/generators/symbian/symmake_sbsv2.cpp
+++ b/qmake/generators/symbian/symmake_sbsv2.cpp
@@ -727,7 +727,10 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t
QStringList absoluteCleanFiles;
foreach (QString cleanFile, cleanFiles) {
QFileInfo fi(cleanFile);
- absoluteCleanFiles << fi.absoluteFilePath();
+ QString fileName = QLatin1String("\"");
+ fileName.append(fi.absoluteFilePath());
+ fileName.append(QLatin1String("\""));
+ absoluteCleanFiles << fileName;
}
t << "START EXTENSION qt/qmake_clean" << endl;
t << "OPTION CLEAN_FILES " << absoluteCleanFiles.join(" ") << endl;
diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp
index ea9e9e1..6064080 100644
--- a/qmake/generators/win32/mingw_make.cpp
+++ b/qmake/generators/win32/mingw_make.cpp
@@ -199,8 +199,31 @@ void createArObjectScriptFile(const QString &fileName, const QString &target, co
}
}
+void createRvctObjectScriptFile(const QString &fileName, const QStringList &objList)
+{
+ QString filePath = Option::output_dir + QDir::separator() + fileName;
+ QFile file(filePath);
+ if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
+ QTextStream t(&file);
+ for (QStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
+ if (QDir::isRelativePath(*it))
+ t << "./" << *it << endl;
+ else
+ t << *it << endl;
+ }
+ t.flush();
+ file.close();
+ }
+}
+
void MingwMakefileGenerator::writeMingwParts(QTextStream &t)
{
+ if (!project->isEmpty("QMAKE_SYMBIAN_SHLIB")) {
+ t << "vpath %.dso " << project->values("QMAKE_LIBDIR").join(";") << endl;
+ t << "vpath %.lib " << project->values("QMAKE_LIBDIR").join(";") << endl;
+ t << "\n\n";
+ }
+
writeStandardParts(t);
if (!preCompHeaderOut.isEmpty()) {
@@ -267,7 +290,7 @@ void MingwMakefileGenerator::init()
if(configs.indexOf("qt") == -1)
configs.append("qt");
- if(project->isActiveConfig("dll")) {
+ if(project->isActiveConfig("dll") && project->values("QMAKE_SYMBIAN_SHLIB").isEmpty()) {
QString destDir = "";
if(!project->first("DESTDIR").isEmpty())
destDir = Option::fixPathToTargetOS(project->first("DESTDIR") + Option::dir_sep, false, false);
@@ -276,7 +299,7 @@ void MingwMakefileGenerator::init()
project->values("QMAKE_LFLAGS").append(QString("-Wl,--out-implib,") + project->first("MINGW_IMPORT_LIB"));
}
- if(!project->values("DEF_FILE").isEmpty())
+ if(!project->values("DEF_FILE").isEmpty() && project->values("QMAKE_SYMBIAN_SHLIB").isEmpty())
project->values("QMAKE_LFLAGS").append(QString("-Wl,") + project->first("DEF_FILE"));
MakefileGenerator::init();
@@ -312,12 +335,9 @@ void MingwMakefileGenerator::init()
void MingwMakefileGenerator::fixTargetExt()
{
if (project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") {
- project->values("TARGET_EXT").append(".a");
project->values("QMAKE_LFLAGS").append("-static");
- project->values("TARGET").first() = "lib" + project->first("TARGET");
- } else {
- Win32MakefileGenerator::fixTargetExt();
}
+ Win32MakefileGenerator::fixTargetExt();
}
void MingwMakefileGenerator::writeIncPart(QTextStream &t)
@@ -345,17 +365,28 @@ void MingwMakefileGenerator::writeLibsPart(QTextStream &t)
t << "LIBS = ";
if(!project->values("QMAKE_LIBDIR").isEmpty())
writeLibDirPart(t);
- t << var("QMAKE_LIBS").replace(QRegExp("(\\slib|^lib)")," -l") << ' '
- << var("QMAKE_LIBS_PRIVATE").replace(QRegExp("(\\slib|^lib)")," -l") << endl;
+ if (project->isActiveConfig("rvct_linker")) {
+ t << var("QMAKE_LIBS") << ' '
+ << var("QMAKE_LIBS_PRIVATE") << endl;
+ } else {
+ t << var("QMAKE_LIBS").replace(QRegExp("(\\slib|^lib)")," -l") << ' '
+ << var("QMAKE_LIBS_PRIVATE").replace(QRegExp("(\\slib|^lib)")," -l") << endl;
+ }
}
}
void MingwMakefileGenerator::writeLibDirPart(QTextStream &t)
{
QStringList libDirs = project->values("QMAKE_LIBDIR");
- for (int i = 0; i < libDirs.size(); ++i)
+ QString libArg = QString::fromLatin1("-L");
+ if (project->isActiveConfig("rvct_linker"))
+ libArg = QString::fromLatin1("--userlibpath ");
+ for (int i = 0; i < libDirs.size(); ++i) {
libDirs[i].remove("\"");
- t << valGlue(libDirs,"-L"+quote,quote+" -L" +quote,quote) << " ";
+ if (libDirs[i].endsWith("\\"))
+ libDirs[i].chop(1);
+ }
+ t << valGlue(libDirs, libArg+quote, quote+" "+libArg+quote, quote) << " ";
}
void MingwMakefileGenerator::writeObjectsPart(QTextStream &t)
@@ -367,20 +398,33 @@ void MingwMakefileGenerator::writeObjectsPart(QTextStream &t)
if (!var("BUILD_NAME").isEmpty()) {
ar_script_file += "." + var("BUILD_NAME");
}
- createArObjectScriptFile(ar_script_file, var("DEST_TARGET"), project->values("OBJECTS"));
// QMAKE_LIB is used for win32, including mingw, whereas QMAKE_AR is used on Unix.
- // Strip off any options since the ar commands will be read from file.
- QString ar_cmd = var("QMAKE_LIB").section(" ", 0, 0);;
- if (ar_cmd.isEmpty())
- ar_cmd = "ar";
- objectsLinkLine = ar_cmd + " -M < " + ar_script_file;
+ if (project->isActiveConfig("rvct_linker")) {
+ createRvctObjectScriptFile(ar_script_file, project->values("OBJECTS"));
+ QString ar_cmd = project->values("QMAKE_LIB").join(" ");
+ if (ar_cmd.isEmpty())
+ ar_cmd = "armar --create";
+ objectsLinkLine = ar_cmd + " " + var("DEST_TARGET") + " --via " + ar_script_file;
+ } else {
+ // Strip off any options since the ar commands will be read from file.
+ QString ar_cmd = var("QMAKE_LIB").section(" ", 0, 0);;
+ if (ar_cmd.isEmpty())
+ ar_cmd = "ar";
+ createArObjectScriptFile(ar_script_file, var("DEST_TARGET"), project->values("OBJECTS"));
+ objectsLinkLine = ar_cmd + " -M < " + ar_script_file;
+ }
} else {
QString ld_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET");
if (!var("BUILD_NAME").isEmpty()) {
ld_script_file += "." + var("BUILD_NAME");
}
- createLdObjectScriptFile(ld_script_file, project->values("OBJECTS"));
- objectsLinkLine = ld_script_file;
+ if (project->isActiveConfig("rvct_linker")) {
+ createRvctObjectScriptFile(ld_script_file, project->values("OBJECTS"));
+ objectsLinkLine = QString::fromLatin1("--via ") + ld_script_file;
+ } else {
+ createLdObjectScriptFile(ld_script_file, project->values("OBJECTS"));
+ objectsLinkLine = ld_script_file;
+ }
}
Win32MakefileGenerator::writeObjectsPart(t);
}
diff --git a/qmake/generators/win32/mingw_make.h b/qmake/generators/win32/mingw_make.h
index 007b48b..5bc9c7b 100644
--- a/qmake/generators/win32/mingw_make.h
+++ b/qmake/generators/win32/mingw_make.h
@@ -54,17 +54,17 @@ public:
protected:
QString escapeDependencyPath(const QString &path) const;
QString getLibTarget();
+ bool writeMakefile(QTextStream &);
+ void init();
private:
bool isWindowsShell() const;
void writeMingwParts(QTextStream &);
void writeIncPart(QTextStream &t);
void writeLibsPart(QTextStream &t);
void writeLibDirPart(QTextStream &t);
- bool writeMakefile(QTextStream &);
void writeObjectsPart(QTextStream &t);
void writeBuildRulesPart(QTextStream &t);
void writeRcFilePart(QTextStream &t);
- void init();
void processPrlVariable(const QString &var, const QStringList &l);
QStringList &findDependencies(const QString &file);
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index d92eb69..947bd23 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -303,7 +303,8 @@ void Win32MakefileGenerator::processVars()
// TARGET_VERSION_EXT will be used to add a version number onto the target name
if (project->values("TARGET_VERSION_EXT").isEmpty()
- && !project->values("VER_MAJ").isEmpty())
+ && !project->values("VER_MAJ").isEmpty()
+ && project->values("QMAKE_SYMBIAN_SHLIB").isEmpty())
project->values("TARGET_VERSION_EXT").append(project->values("VER_MAJ").first());
if(project->isEmpty("QMAKE_COPY_FILE"))
@@ -331,16 +332,43 @@ void Win32MakefileGenerator::processVars()
if(!(*libDir_it).isEmpty())
(*libDir_it) = Option::fixPathToTargetOS((*libDir_it), false, false);
}
+
+ if (project->values("TEMPLATE").contains("app")) {
+ project->values("QMAKE_CFLAGS") += project->values("QMAKE_CFLAGS_APP");
+ project->values("QMAKE_CXXFLAGS") += project->values("QMAKE_CXXFLAGS_APP");
+ project->values("QMAKE_LFLAGS") += project->values("QMAKE_LFLAGS_APP");
+ } else if (project->values("TEMPLATE").contains("lib") && project->isActiveConfig("dll")) {
+ if(!project->isActiveConfig("plugin") || !project->isActiveConfig("plugin_no_share_shlib_cflags")) {
+ project->values("QMAKE_CFLAGS") += project->values("QMAKE_CFLAGS_SHLIB");
+ project->values("QMAKE_CXXFLAGS") += project->values("QMAKE_CXXFLAGS_SHLIB");
+ }
+ if (project->isActiveConfig("plugin")) {
+ project->values("QMAKE_CFLAGS") += project->values("QMAKE_CFLAGS_PLUGIN");
+ project->values("QMAKE_CXXFLAGS") += project->values("QMAKE_CXXFLAGS_PLUGIN");
+ project->values("QMAKE_LFLAGS") += project->values("QMAKE_LFLAGS_PLUGIN");
+ } else {
+ project->values("QMAKE_LFLAGS") += project->values("QMAKE_LFLAGS_SHLIB");
+ }
+ }
}
void Win32MakefileGenerator::fixTargetExt()
{
- if (!project->values("QMAKE_APP_FLAG").isEmpty())
+ if (project->isEmpty("QMAKE_EXTENSION_STATICLIB"))
+ project->values("QMAKE_EXTENSION_STATICLIB").append("lib");
+ if (project->isEmpty("QMAKE_EXTENSION_SHLIB"))
+ project->values("QMAKE_EXTENSION_SHLIB").append("dll");
+
+ if (!project->values("QMAKE_APP_FLAG").isEmpty()) {
project->values("TARGET_EXT").append(".exe");
- else if (project->isActiveConfig("shared"))
- project->values("TARGET_EXT").append(project->first("TARGET_VERSION_EXT") + ".dll");
- else
- project->values("TARGET_EXT").append(".lib");
+ } else if (project->isActiveConfig("shared")) {
+ project->values("TARGET_EXT").append(project->first("TARGET_VERSION_EXT") + "."
+ + project->first("QMAKE_EXTENSION_SHLIB"));
+ project->values("TARGET").first() = project->first("QMAKE_PREFIX_SHLIB") + project->first("TARGET");
+ } else {
+ project->values("TARGET_EXT").append("." + project->first("QMAKE_EXTENSION_STATICLIB"));
+ project->values("TARGET").first() = project->first("QMAKE_PREFIX_STATICLIB") + project->first("TARGET");
+ }
}
void Win32MakefileGenerator::processRcFileVar()
@@ -662,10 +690,10 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
if(project->isActiveConfig("shared") && !project->values("DLLDESTDIR").isEmpty()) {
QStringList dlldirs = project->values("DLLDESTDIR");
for (QStringList::Iterator dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir) {
- t << "\n\t" << "-$(COPY_FILE) \"$(DESTDIR_TARGET)\" " << Option::fixPathToTargetOS(*dlldir, false);
+ t << "\t" << "-$(COPY_FILE) \"$(DESTDIR_TARGET)\" " << Option::fixPathToTargetOS(*dlldir, false) << endl;
}
}
- t << endl << endl;
+ t << endl;
writeRcFilePart(t);
diff --git a/qmake/project.cpp b/qmake/project.cpp
index 9c99c44..e985401 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -1654,7 +1654,6 @@ 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) {
- validateModes();
feature_roots = new QStringList(qmake_feature_paths(prop));
qmakeAddCacheClear(qmakeDeleteCacheClear_QStringList, (void**)&feature_roots);
}
diff --git a/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri b/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri
index b98617f..3ec3e97 100644
--- a/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri
+++ b/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri
@@ -1,5 +1,5 @@
-QT_WEBKIT_VERSION = 4.7.2
+QT_WEBKIT_VERSION = 4.7.4
QT_WEBKIT_MAJOR_VERSION = 4
QT_WEBKIT_MINOR_VERSION = 7
-QT_WEBKIT_PATCH_VERSION = 2
+QT_WEBKIT_PATCH_VERSION = 4
QT_CONFIG += webkit
diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri
index 86800ef..65de6e0 100644
--- a/src/corelib/global/global.pri
+++ b/src/corelib/global/global.pri
@@ -19,7 +19,7 @@ INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global
# Only used on platforms with CONFIG += precompile_header
PRECOMPILED_HEADER = global/qt_pch.h
-linux*:!static:!linux-armcc:!linux-gcce {
+linux*:!static:!symbian-armcc:!symbian-gcce {
QMAKE_LFLAGS += -Wl,-e,qt_core_boilerplate
prog=$$quote(if (/program interpreter: (.*)]/) { print $1; })
DEFINES += ELF_INTERPRETER=\\\"$$system(readelf -l /bin/ls | perl -n -e \'$$prog\')\\\"
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 62d83cc..25ddd24 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1862,7 +1862,7 @@ QSysInfo::SymbianVersion QSysInfo::symbianVersion()
else if (minor == 1) {
return cachedSymbianVersion = SV_SF_2;
}
- else if (minor == 2) {
+ else if (minor >= 2) {
return cachedSymbianVersion = SV_SF_3;
}
}
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index fcee35d..55c96c6 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -44,11 +44,11 @@
#include <stddef.h>
-#define QT_VERSION_STR "4.7.2"
+#define QT_VERSION_STR "4.7.4"
/*
QT_VERSION is (major << 16) + (minor << 8) + patch.
*/
-#define QT_VERSION 0x040702
+#define QT_VERSION 0x040704
/*
can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0))
*/
@@ -284,7 +284,7 @@ namespace QT_NAMESPACE {}
# endif
#endif
-#if defined(Q_OS_MAC64) && !defined(QT_MAC_USE_COCOA) && !defined(QT_BUILD_QMAKE)
+#if defined(Q_OS_MAC64) && !defined(QT_MAC_USE_COCOA) && !defined(QT_BUILD_QMAKE) && !defined(QT_BOOTSTRAPPED)
#error "You are building a 64-bit application, but using a 32-bit version of Qt. Check your build configuration."
#endif
@@ -2453,7 +2453,10 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf();
#ifdef SYMBIAN_GRAPHICS_TRANSITION_EFFECTS_SIGNALING_AVAILABLE
# define Q_SYMBIAN_TRANSITION_EFFECTS
#endif
+#endif
+#ifdef SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS
+#define Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS
#endif
//Symbian does not support data imports from a DLL
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 398f9bf..4d70744 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -575,7 +575,8 @@ public:
PreferDither = 0x00000040,
AvoidDither = 0x00000080,
- NoOpaqueDetection = 0x00000100
+ NoOpaqueDetection = 0x00000100,
+ NoFormatConversion = 0x00000200
};
Q_DECLARE_FLAGS(ImageConversionFlags, ImageConversionFlag)
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index c70837c..22ad83b 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -683,6 +683,10 @@
until a non-opaque pixel is found, or if you want the pixmap to
retain an alpha channel for some other reason. If the image has no
alpha channel this flag has no effect.
+
+ \omitvalue NoFormatConversion Don't do any format conversions on the image.
+ Can be useful when converting a QImage to a QPixmap for a one-time
+ rendering operation for example.
*/
/*! \enum Qt::GUIStyle
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index 5177339..c2bc895 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -54,6 +54,11 @@
#include <private/qeventdispatcher_unix_p.h>
#endif
+#ifdef Q_OS_SYMBIAN
+#include <hal.h>
+#include <hal_data.h>
+#endif
+
#include "qthreadstorage.h"
#include "qthread_p.h"
@@ -63,6 +68,12 @@
#include <sched.h>
#include <errno.h>
+// You only find these enumerations on Symbian^3 onwards, so we need to provide our own
+// to remain compatible with older releases. They won't be called by pre-Sym^3 SDKs.
+
+// HALData::ENumCpus
+#define QT_HALData_ENumCpus 119
+
#ifdef Q_OS_BSD4
#include <sys/sysctl.h>
#endif
@@ -422,8 +433,20 @@ int QThread::idealThreadCount()
// as of aug 2008 Integrity only supports one single core CPU
cores = 1;
#elif defined(Q_OS_SYMBIAN)
- // ### TODO - Get the number of cores from HAL? when multicore architectures (SMP) are supported
- cores = 1;
+ if (QSysInfo::symbianVersion() >= QSysInfo::SV_SF_3) {
+ TInt inumcpus;
+ TInt err;
+ err = HAL::Get((HALData::TAttribute)QT_HALData_ENumCpus, inumcpus);
+ if (err != KErrNone) {
+ cores = 1;
+ } else if ( inumcpus <= 0 ) {
+ cores = 1;
+ } else {
+ cores = inumcpus;
+ }
+ } else {
+ cores = 1;
+ }
#elif defined(Q_OS_VXWORKS)
// VxWorks
# if defined(QT_VXWORKS_HAS_CPUSET)
diff --git a/src/declarative/debugger/qdeclarativedebugservice_p.h b/src/declarative/debugger/qdeclarativedebugservice_p.h
index 1730d11..5e30350 100644
--- a/src/declarative/debugger/qdeclarativedebugservice_p.h
+++ b/src/declarative/debugger/qdeclarativedebugservice_p.h
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QDeclarativeDebugServicePrivate;
-class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugService : public QObject
+class Q_DECLARATIVE_EXPORT QDeclarativeDebugService : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativeDebugService)
diff --git a/src/declarative/declarative.pro b/src/declarative/declarative.pro
index 1ad888b..f3a7db9 100644
--- a/src/declarative/declarative.pro
+++ b/src/declarative/declarative.pro
@@ -29,6 +29,8 @@ symbian: {
LIBS += -lefsrv
}
+linux-g++-maemo:DEFINES += QDECLARATIVEVIEW_NOBACKGROUND
+
DEFINES += QT_NO_OPENTYPE
INCLUDEPATH += ../3rdparty/harfbuzz/src
diff --git a/src/declarative/graphicsitems/qdeclarativeanchors.cpp b/src/declarative/graphicsitems/qdeclarativeanchors.cpp
index 444bbd4..5ff6d2c 100644
--- a/src/declarative/graphicsitems/qdeclarativeanchors.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeanchors.cpp
@@ -175,16 +175,19 @@ QDeclarativeAnchors::~QDeclarativeAnchors()
void QDeclarativeAnchorsPrivate::fillChanged()
{
+ Q_Q(QDeclarativeAnchors);
if (!fill || !isItemComplete())
return;
if (updatingFill < 2) {
++updatingFill;
+ qreal horizontalMargin = q->mirrored() ? rightMargin : leftMargin;
+
if (fill == item->parentItem()) { //child-parent
- setItemPos(QPointF(leftMargin, topMargin));
+ setItemPos(QPointF(horizontalMargin, topMargin));
} else if (fill->parentItem() == item->parentItem()) { //siblings
- setItemPos(QPointF(fill->x()+leftMargin, fill->y()+topMargin));
+ setItemPos(QPointF(fill->x()+horizontalMargin, fill->y()+topMargin));
}
QGraphicsItemPrivate *fillPrivate = QGraphicsItemPrivate::get(fill);
setItemSize(QSizeF(fillPrivate->width()-leftMargin-rightMargin, fillPrivate->height()-topMargin-bottomMargin));
@@ -199,18 +202,21 @@ void QDeclarativeAnchorsPrivate::fillChanged()
void QDeclarativeAnchorsPrivate::centerInChanged()
{
+ Q_Q(QDeclarativeAnchors);
if (!centerIn || fill || !isItemComplete())
return;
if (updatingCenterIn < 2) {
++updatingCenterIn;
+
+ qreal effectiveHCenterOffset = q->mirrored() ? -hCenterOffset : hCenterOffset;
if (centerIn == item->parentItem()) {
- QPointF p(hcenter(item->parentItem()) - hcenter(item) + hCenterOffset,
+ QPointF p(hcenter(item->parentItem()) - hcenter(item) + effectiveHCenterOffset,
vcenter(item->parentItem()) - vcenter(item) + vCenterOffset);
setItemPos(p);
} else if (centerIn->parentItem() == item->parentItem()) {
- QPointF p(centerIn->x() + hcenter(centerIn) - hcenter(item) + hCenterOffset,
+ QPointF p(centerIn->x() + hcenter(centerIn) - hcenter(item) + effectiveHCenterOffset,
centerIn->y() + vcenter(centerIn) - vcenter(item) + vCenterOffset);
setItemPos(p);
}
@@ -311,6 +317,13 @@ void QDeclarativeAnchors::componentComplete()
d->componentComplete = true;
}
+bool QDeclarativeAnchors::mirrored()
+{
+ Q_D(QDeclarativeAnchors);
+ QGraphicsItemPrivate * itemPrivate = QGraphicsItemPrivate::get(d->item);
+ return itemPrivate->isDeclarativeItem ? static_cast<QDeclarativeItemPrivate *>(itemPrivate)->effectiveLayoutMirror : false;
+}
+
void QDeclarativeAnchorsPrivate::setItemHeight(qreal v)
{
updatingMe = true;
@@ -570,58 +583,94 @@ void QDeclarativeAnchorsPrivate::updateVerticalAnchors()
}
}
+inline QDeclarativeAnchorLine::AnchorLine reverseAnchorLine(QDeclarativeAnchorLine::AnchorLine anchorLine) {
+ if (anchorLine == QDeclarativeAnchorLine::Left) {
+ return QDeclarativeAnchorLine::Right;
+ } else if (anchorLine == QDeclarativeAnchorLine::Right) {
+ return QDeclarativeAnchorLine::Left;
+ } else {
+ return anchorLine;
+ }
+}
+
void QDeclarativeAnchorsPrivate::updateHorizontalAnchors()
{
+ Q_Q(QDeclarativeAnchors);
if (fill || centerIn || !isItemComplete())
return;
- if (updatingHorizontalAnchor < 2) {
+ if (updatingHorizontalAnchor < 3) {
++updatingHorizontalAnchor;
+ qreal effectiveRightMargin, effectiveLeftMargin, effectiveHorizontalCenterOffset;
+ QDeclarativeAnchorLine effectiveLeft, effectiveRight, effectiveHorizontalCenter;
+ QDeclarativeAnchors::Anchor effectiveLeftAnchor, effectiveRightAnchor;
+ if (q->mirrored()) {
+ effectiveLeftAnchor = QDeclarativeAnchors::RightAnchor;
+ effectiveRightAnchor = QDeclarativeAnchors::LeftAnchor;
+ effectiveLeft.item = right.item;
+ effectiveLeft.anchorLine = reverseAnchorLine(right.anchorLine);
+ effectiveRight.item = left.item;
+ effectiveRight.anchorLine = reverseAnchorLine(left.anchorLine);
+ effectiveHorizontalCenter.item = hCenter.item;
+ effectiveHorizontalCenter.anchorLine = reverseAnchorLine(hCenter.anchorLine);
+ effectiveLeftMargin = rightMargin;
+ effectiveRightMargin = leftMargin;
+ effectiveHorizontalCenterOffset = -hCenterOffset;
+ } else {
+ effectiveLeftAnchor = QDeclarativeAnchors::LeftAnchor;
+ effectiveRightAnchor = QDeclarativeAnchors::RightAnchor;
+ effectiveLeft = left;
+ effectiveRight = right;
+ effectiveHorizontalCenter = hCenter;
+ effectiveLeftMargin = leftMargin;
+ effectiveRightMargin = rightMargin;
+ effectiveHorizontalCenterOffset = hCenterOffset;
+ }
+
QGraphicsItemPrivate *itemPrivate = QGraphicsItemPrivate::get(item);
- if (usedAnchors & QDeclarativeAnchors::LeftAnchor) {
+ if (usedAnchors & effectiveLeftAnchor) {
//Handle stretching
bool invalid = true;
qreal width = 0.0;
- if (usedAnchors & QDeclarativeAnchors::RightAnchor) {
- invalid = calcStretch(left, right, leftMargin, -rightMargin, QDeclarativeAnchorLine::Left, width);
+ if (usedAnchors & effectiveRightAnchor) {
+ invalid = calcStretch(effectiveLeft, effectiveRight, effectiveLeftMargin, -effectiveRightMargin, QDeclarativeAnchorLine::Left, width);
} else if (usedAnchors & QDeclarativeAnchors::HCenterAnchor) {
- invalid = calcStretch(left, hCenter, leftMargin, hCenterOffset, QDeclarativeAnchorLine::Left, width);
+ invalid = calcStretch(effectiveLeft, effectiveHorizontalCenter, effectiveLeftMargin, effectiveHorizontalCenterOffset, QDeclarativeAnchorLine::Left, width);
width *= 2;
}
if (!invalid)
setItemWidth(width);
//Handle left
- if (left.item == item->parentItem()) {
- setItemX(adjustedPosition(left.item, left.anchorLine) + leftMargin);
- } else if (left.item->parentItem() == item->parentItem()) {
- setItemX(position(left.item, left.anchorLine) + leftMargin);
+ if (effectiveLeft.item == item->parentItem()) {
+ setItemX(adjustedPosition(effectiveLeft.item, effectiveLeft.anchorLine) + effectiveLeftMargin);
+ } else if (effectiveLeft.item->parentItem() == item->parentItem()) {
+ setItemX(position(effectiveLeft.item, effectiveLeft.anchorLine) + effectiveLeftMargin);
}
- } else if (usedAnchors & QDeclarativeAnchors::RightAnchor) {
+ } else if (usedAnchors & effectiveRightAnchor) {
//Handle stretching (left + right case is handled in updateLeftAnchor)
if (usedAnchors & QDeclarativeAnchors::HCenterAnchor) {
qreal width = 0.0;
- bool invalid = calcStretch(hCenter, right, hCenterOffset, -rightMargin,
+ bool invalid = calcStretch(effectiveHorizontalCenter, effectiveRight, effectiveHorizontalCenterOffset, -effectiveRightMargin,
QDeclarativeAnchorLine::Left, width);
if (!invalid)
setItemWidth(width*2);
}
//Handle right
- if (right.item == item->parentItem()) {
- setItemX(adjustedPosition(right.item, right.anchorLine) - itemPrivate->width() - rightMargin);
- } else if (right.item->parentItem() == item->parentItem()) {
- setItemX(position(right.item, right.anchorLine) - itemPrivate->width() - rightMargin);
+ if (effectiveRight.item == item->parentItem()) {
+ setItemX(adjustedPosition(effectiveRight.item, effectiveRight.anchorLine) - itemPrivate->width() - effectiveRightMargin);
+ } else if (effectiveRight.item->parentItem() == item->parentItem()) {
+ setItemX(position(effectiveRight.item, effectiveRight.anchorLine) - itemPrivate->width() - effectiveRightMargin);
}
} else if (usedAnchors & QDeclarativeAnchors::HCenterAnchor) {
//Handle hCenter
- if (hCenter.item == item->parentItem()) {
- setItemX(adjustedPosition(hCenter.item, hCenter.anchorLine) - hcenter(item) + hCenterOffset);
- } else if (hCenter.item->parentItem() == item->parentItem()) {
- setItemX(position(hCenter.item, hCenter.anchorLine) - hcenter(item) + hCenterOffset);
+ if (effectiveHorizontalCenter.item == item->parentItem()) {
+ setItemX(adjustedPosition(effectiveHorizontalCenter.item, effectiveHorizontalCenter.anchorLine) - hcenter(item) + effectiveHorizontalCenterOffset);
+ } else if (effectiveHorizontalCenter.item->parentItem() == item->parentItem()) {
+ setItemX(position(effectiveHorizontalCenter.item, effectiveHorizontalCenter.anchorLine) - hcenter(item) + effectiveHorizontalCenterOffset);
}
}
-
--updatingHorizontalAnchor;
} else {
// ### Make this certain :)
diff --git a/src/declarative/graphicsitems/qdeclarativeanchors_p.h b/src/declarative/graphicsitems/qdeclarativeanchors_p.h
index d2c0a89..388d6b9 100644
--- a/src/declarative/graphicsitems/qdeclarativeanchors_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeanchors_p.h
@@ -79,6 +79,7 @@ class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeAnchors : public QObject
Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged)
Q_PROPERTY(QGraphicsObject *fill READ fill WRITE setFill RESET resetFill NOTIFY fillChanged)
Q_PROPERTY(QGraphicsObject *centerIn READ centerIn WRITE setCenterIn RESET resetCenterIn NOTIFY centerInChanged)
+ Q_PROPERTY(bool mirrored READ mirrored NOTIFY mirroredChanged REVISION 1)
public:
QDeclarativeAnchors(QObject *parent=0);
@@ -163,6 +164,8 @@ public:
void classBegin();
void componentComplete();
+ bool mirrored();
+
Q_SIGNALS:
void leftChanged();
void rightChanged();
@@ -181,9 +184,11 @@ Q_SIGNALS:
void verticalCenterOffsetChanged();
void horizontalCenterOffsetChanged();
void baselineOffsetChanged();
+ Q_REVISION(1) void mirroredChanged();
private:
friend class QDeclarativeItem;
+ friend class QDeclarativeItemPrivate;
friend class QDeclarativeGraphicsWidget;
Q_DISABLE_COPY(QDeclarativeAnchors)
Q_DECLARE_PRIVATE(QDeclarativeAnchors)
diff --git a/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h b/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h
index c4508e0..d8d2f15 100644
--- a/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h
@@ -133,6 +133,7 @@ public:
bool checkVAnchorValid(QDeclarativeAnchorLine anchor) const;
bool calcStretch(const QDeclarativeAnchorLine &edge1, const QDeclarativeAnchorLine &edge2, qreal offset1, qreal offset2, QDeclarativeAnchorLine::AnchorLine line, qreal &stretch);
+ bool isMirrored() const;
void updateHorizontalAnchors();
void updateVerticalAnchors();
void fillChanged();
diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
index 016b87d..8cc8165 100644
--- a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
@@ -231,9 +231,18 @@ void QDeclarativeAnimatedImage::load()
{
Q_D(QDeclarativeAnimatedImage);
+ QDeclarativeImageBase::Status oldStatus = d->status;
+ qreal oldProgress = d->progress;
+
if (d->url.isEmpty()) {
delete d->_movie;
+ d->setPixmap(QPixmap());
+ d->progress = 0;
d->status = Null;
+ if (d->status != oldStatus)
+ emit statusChanged(d->status);
+ if (d->progress != oldProgress)
+ emit progressChanged(d->progress);
} else {
#ifndef QT_NO_LOCALFILE_OPTIMIZED_QML
QString lf = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(d->url);
@@ -245,7 +254,8 @@ void QDeclarativeAnimatedImage::load()
delete d->_movie;
d->_movie = 0;
d->status = Error;
- emit statusChanged(d->status);
+ if (d->status != oldStatus)
+ emit statusChanged(d->status);
return;
}
connect(d->_movie, SIGNAL(stateChanged(QMovie::MovieState)),
@@ -262,20 +272,25 @@ void QDeclarativeAnimatedImage::load()
d->setPixmap(d->_movie->currentPixmap());
d->status = Ready;
d->progress = 1.0;
- emit statusChanged(d->status);
- emit sourceChanged(d->url);
- emit progressChanged(d->progress);
+ if (d->status != oldStatus)
+ emit statusChanged(d->status);
+ if (d->progress != oldProgress)
+ emit progressChanged(d->progress);
return;
}
#endif
d->status = Loading;
+ d->progress = 0;
+ emit statusChanged(d->status);
+ emit progressChanged(d->progress);
QNetworkRequest req(d->url);
req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true);
d->reply = qmlEngine(this)->networkAccessManager()->get(req);
QObject::connect(d->reply, SIGNAL(finished()),
this, SLOT(movieRequestFinished()));
+ QObject::connect(d->reply, SIGNAL(downloadProgress(qint64,qint64)),
+ this, SLOT(requestProgress(qint64,qint64)));
}
- emit statusChanged(d->status);
}
#define ANIMATEDIMAGE_MAXIMUM_REDIRECT_RECURSION 16
diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
index c03c624..8f37e90 100644
--- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
@@ -149,6 +149,20 @@ QT_BEGIN_NAMESPACE
\sa Image, AnimatedImage
*/
+/*!
+ \qmlproperty bool BorderImage::asynchronous
+
+ Specifies that images on the local filesystem should be loaded
+ asynchronously in a separate thread. The default value is
+ false, causing the user interface thread to block while the
+ image is loaded. Setting \a asynchronous to true is useful where
+ maintaining a responsive user interface is more desirable
+ than having images immediately visible.
+
+ Note that this property is only valid for images read from the
+ local filesystem. Images loaded via a network resource (e.g. HTTP)
+ are always loaded asynchonously.
+*/
QDeclarativeBorderImage::QDeclarativeBorderImage(QDeclarativeItem *parent)
: QDeclarativeImageBase(*(new QDeclarativeBorderImagePrivate), parent)
{
@@ -200,6 +214,15 @@ QDeclarativeBorderImage::~QDeclarativeBorderImage()
*/
/*!
+ \qmlproperty bool BorderImage::cache
+ \since Quick 1.1
+
+ Specifies whether the image should be cached. The default value is
+ true. Setting \a cache to false is useful when dealing with large images,
+ to make sure that they aren't cached at the expense of small 'ui element' images.
+*/
+
+/*!
\qmlproperty bool BorderImage::mirror
\since Quick 1.1
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index 55b05b9..511f789 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -143,7 +143,7 @@ QDeclarativeFlickablePrivate::QDeclarativeFlickablePrivate()
, stealMouse(false), pressed(false), interactive(true), calcVelocity(false)
, deceleration(500), maxVelocity(2000), reportedVelocitySmoothing(100)
, delayedPressEvent(0), delayedPressTarget(0), pressDelay(0), fixupDuration(600)
- , vTime(0), visibleArea(0)
+ , fixupMode(Normal), vTime(0), visibleArea(0)
, flickableDirection(QDeclarativeFlickable::AutoFlickDirection)
, boundsBehavior(QDeclarativeFlickable::DragAndOvershootBounds)
{
@@ -219,6 +219,7 @@ void QDeclarativeFlickablePrivate::flick(AxisData &data, qreal minExtent, qreal
{
Q_Q(QDeclarativeFlickable);
qreal maxDistance = -1;
+ data.fixingUp = false;
bool overShoot = boundsBehavior == QDeclarativeFlickable::DragAndOvershootBounds;
// -ve velocity means list is moving up
if (velocity > 0) {
@@ -288,24 +289,45 @@ void QDeclarativeFlickablePrivate::fixup(AxisData &data, qreal minExtent, qreal
if (data.move.value() > minExtent || maxExtent > minExtent) {
timeline.reset(data.move);
if (data.move.value() != minExtent) {
- if (fixupDuration) {
- qreal dist = minExtent - data.move;
- timeline.move(data.move, minExtent - dist/2, QEasingCurve(QEasingCurve::InQuad), fixupDuration/4);
- timeline.move(data.move, minExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4);
- } else {
+ switch (fixupMode) {
+ case Immediate:
timeline.set(data.move, minExtent);
+ break;
+ case ExtentChanged:
+ // The target has changed. Don't start from the beginning; just complete the
+ // second half of the animation using the new extent.
+ timeline.move(data.move, minExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4);
+ data.fixingUp = true;
+ break;
+ default: {
+ qreal dist = minExtent - data.move;
+ timeline.move(data.move, minExtent - dist/2, QEasingCurve(QEasingCurve::InQuad), fixupDuration/4);
+ timeline.move(data.move, minExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4);
+ data.fixingUp = true;
+ }
}
}
} else if (data.move.value() < maxExtent) {
timeline.reset(data.move);
- if (fixupDuration) {
- qreal dist = maxExtent - data.move;
- timeline.move(data.move, maxExtent - dist/2, QEasingCurve(QEasingCurve::InQuad), fixupDuration/4);
- timeline.move(data.move, maxExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4);
- } else {
+ switch (fixupMode) {
+ case Immediate:
timeline.set(data.move, maxExtent);
+ break;
+ case ExtentChanged:
+ // The target has changed. Don't start from the beginning; just complete the
+ // second half of the animation using the new extent.
+ timeline.move(data.move, maxExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4);
+ data.fixingUp = true;
+ break;
+ default: {
+ qreal dist = maxExtent - data.move;
+ timeline.move(data.move, maxExtent - dist/2, QEasingCurve(QEasingCurve::InQuad), fixupDuration/4);
+ timeline.move(data.move, maxExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4);
+ data.fixingUp = true;
+ }
}
}
+ fixupMode = Normal;
vTime = timeline.time();
}
@@ -688,6 +710,12 @@ void QDeclarativeFlickablePrivate::handleMousePressEvent(QGraphicsSceneMouseEven
vData.velocity = 0;
hData.dragStartOffset = 0;
vData.dragStartOffset = 0;
+ hData.dragMinBound = q->minXExtent();
+ vData.dragMinBound = q->minYExtent();
+ hData.dragMaxBound = q->maxXExtent();
+ vData.dragMaxBound = q->maxYExtent();
+ hData.fixingUp = false;
+ vData.fixingUp = false;
lastPos = QPoint();
QDeclarativeItemPrivate::start(lastPosTime);
pressPos = event->pos();
@@ -716,8 +744,8 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent
if (!vMoved)
vData.dragStartOffset = dy;
qreal newY = dy + vData.pressPos - vData.dragStartOffset;
- const qreal minY = q->minYExtent();
- const qreal maxY = q->maxYExtent();
+ const qreal minY = vData.dragMinBound;
+ const qreal maxY = vData.dragMaxBound;
if (newY > minY)
newY = minY + (newY - minY) / 2;
if (newY < maxY && maxY - minY <= 0)
@@ -748,8 +776,8 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent
if (!hMoved)
hData.dragStartOffset = dx;
qreal newX = dx + hData.pressPos - hData.dragStartOffset;
- const qreal minX = q->minXExtent();
- const qreal maxX = q->maxXExtent();
+ const qreal minX = hData.dragMinBound;
+ const qreal maxX = hData.dragMaxBound;
if (newX > minX)
newX = minX + (newX - minX) / 2;
if (newX < maxX && maxX - minX <= 0)
@@ -1065,10 +1093,8 @@ void QDeclarativeFlickable::geometryChanged(const QRectF &newGeometry,
}
// Make sure that we're entirely in view.
if (!d->pressed && !d->movingHorizontally && !d->movingVertically) {
- int oldDuration = d->fixupDuration;
- d->fixupDuration = 0;
+ d->fixupMode = QDeclarativeFlickablePrivate::Immediate;
d->fixupX();
- d->fixupDuration = oldDuration;
}
}
if (newGeometry.height() != oldGeometry.height()) {
@@ -1080,10 +1106,8 @@ void QDeclarativeFlickable::geometryChanged(const QRectF &newGeometry,
}
// Make sure that we're entirely in view.
if (!d->pressed && !d->movingHorizontally && !d->movingVertically) {
- int oldDuration = d->fixupDuration;
- d->fixupDuration = 0;
+ d->fixupMode = QDeclarativeFlickablePrivate::Immediate;
d->fixupY();
- d->fixupDuration = oldDuration;
}
}
@@ -1258,10 +1282,11 @@ void QDeclarativeFlickable::setContentWidth(qreal w)
d->contentItem->setWidth(w);
// Make sure that we're entirely in view.
if (!d->pressed && !d->movingHorizontally && !d->movingVertically) {
- int oldDuration = d->fixupDuration;
- d->fixupDuration = 0;
+ d->fixupMode = QDeclarativeFlickablePrivate::Immediate;
+ d->fixupX();
+ } else if (!d->pressed && d->hData.fixingUp) {
+ d->fixupMode = QDeclarativeFlickablePrivate::ExtentChanged;
d->fixupX();
- d->fixupDuration = oldDuration;
}
emit contentWidthChanged();
d->updateBeginningEnd();
@@ -1285,10 +1310,11 @@ void QDeclarativeFlickable::setContentHeight(qreal h)
d->contentItem->setHeight(h);
// Make sure that we're entirely in view.
if (!d->pressed && !d->movingHorizontally && !d->movingVertically) {
- int oldDuration = d->fixupDuration;
- d->fixupDuration = 0;
+ d->fixupMode = QDeclarativeFlickablePrivate::Immediate;
+ d->fixupY();
+ } else if (!d->pressed && d->vData.fixingUp) {
+ d->fixupMode = QDeclarativeFlickablePrivate::ExtentChanged;
d->fixupY();
- d->fixupDuration = oldDuration;
}
emit contentHeightChanged();
d->updateBeginningEnd();
@@ -1297,11 +1323,10 @@ void QDeclarativeFlickable::setContentHeight(qreal h)
/*!
\qmlmethod Flickable::resizeContent(real width, real height, QPointF center)
\preliminary
+ \since Quick 1.1
Resizes the content to \a width x \a height about \a center.
- \bold {This method was added in QtQuick 1.1.}
-
This does not scale the contents of the Flickable - it only resizes the \l contentWidth
and \l contentHeight.
@@ -1333,11 +1358,10 @@ void QDeclarativeFlickable::resizeContent(qreal w, qreal h, QPointF center)
/*!
\qmlmethod Flickable::returnToBounds()
\preliminary
+ \since Quick 1.1
Ensures the content is within legal bounds.
- \bold {This method was added in QtQuick 1.1.}
-
This may be called to ensure that the content is within legal bounds
after manually positioning the content.
*/
@@ -1406,8 +1430,10 @@ bool QDeclarativeFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event)
QGraphicsScene *s = scene();
QDeclarativeItem *grabber = s ? qobject_cast<QDeclarativeItem*>(s->mouseGrabberItem()) : 0;
+ QGraphicsItem *grabberItem = s ? s->mouseGrabberItem() : 0;
+ bool disabledItem = grabberItem && !grabberItem->isEnabled();
bool stealThisEvent = d->stealMouse;
- if ((stealThisEvent || myRect.contains(event->scenePos().toPoint())) && (!grabber || !grabber->keepMouseGrab())) {
+ if ((stealThisEvent || myRect.contains(event->scenePos().toPoint())) && (!grabber || !grabber->keepMouseGrab() || disabledItem)) {
mouseEvent.setAccepted(false);
for (int i = 0x1; i <= 0x10; i <<= 1) {
if (event->buttons() & i) {
@@ -1454,12 +1480,12 @@ bool QDeclarativeFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event)
break;
}
grabber = qobject_cast<QDeclarativeItem*>(s->mouseGrabberItem());
- if (grabber && stealThisEvent && !grabber->keepMouseGrab() && grabber != this) {
+ if ((grabber && stealThisEvent && !grabber->keepMouseGrab() && grabber != this) || disabledItem) {
d->clearDelayedPress();
grabMouse();
}
- return stealThisEvent || d->delayedPressEvent;
+ return stealThisEvent || d->delayedPressEvent || disabledItem;
} else if (d->lastPosTime.isValid()) {
d->lastPosTime.invalidate();
}
@@ -1662,6 +1688,7 @@ void QDeclarativeFlickable::movementXEnding()
emit movementEnded();
}
}
+ d->hData.fixingUp = false;
}
void QDeclarativeFlickable::movementYEnding()
@@ -1684,6 +1711,7 @@ void QDeclarativeFlickable::movementYEnding()
emit movementEnded();
}
}
+ d->vData.fixingUp = false;
}
void QDeclarativeFlickablePrivate::updateVelocity()
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
index 1b6081c..38a5eb3 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
@@ -94,17 +94,21 @@ public:
struct AxisData {
AxisData(QDeclarativeFlickablePrivate *fp, void (QDeclarativeFlickablePrivate::*func)(qreal))
: move(fp, func), viewSize(-1), smoothVelocity(fp), atEnd(false), atBeginning(true)
+ , fixingUp(false)
{}
QDeclarativeTimeLineValueProxy<QDeclarativeFlickablePrivate> move;
qreal viewSize;
qreal pressPos;
qreal dragStartOffset;
+ qreal dragMinBound;
+ qreal dragMaxBound;
qreal velocity;
qreal flickTarget;
QDeclarativeFlickablePrivate::Velocity smoothVelocity;
bool atEnd : 1;
bool atBeginning : 1;
+ bool fixingUp : 1;
};
void flickX(qreal velocity);
@@ -161,6 +165,9 @@ public:
int pressDelay;
int fixupDuration;
+ enum FixupMode { Normal, Immediate, ExtentChanged };
+ FixupMode fixupMode;
+
static void fixupY_callback(void *);
static void fixupX_callback(void *);
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index dc4196d..546f75e 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -68,19 +68,60 @@ public:
}
~FxGridItem() {}
- qreal rowPos() const { return (view->flow() == QDeclarativeGridView::LeftToRight ? item->y() : item->x()); }
- qreal colPos() const { return (view->flow() == QDeclarativeGridView::LeftToRight ? item->x() : item->y()); }
+ qreal rowPos() const {
+ qreal rowPos = 0;
+ if (view->flow() == QDeclarativeGridView::LeftToRight) {
+ rowPos = item->y();
+ } else {
+ if (view->effectiveLayoutDirection() == Qt::RightToLeft)
+ rowPos = -view->cellWidth()-item->x();
+ else
+ rowPos = item->x();
+ }
+ return rowPos;
+ }
+ qreal colPos() const {
+ qreal colPos = 0;
+ if (view->flow() == QDeclarativeGridView::LeftToRight) {
+ if (view->effectiveLayoutDirection() == Qt::RightToLeft) {
+ int colSize = view->cellWidth();
+ int columns = view->width()/colSize;
+ colPos = colSize * (columns-1) - item->x();
+ } else {
+ colPos = item->x();
+ }
+ } else {
+ colPos = item->y();
+ }
+
+ return colPos;
+ }
+
qreal endRowPos() const {
- return view->flow() == QDeclarativeGridView::LeftToRight
- ? item->y() + view->cellHeight() - 1
- : item->x() + view->cellWidth() - 1;
+ if (view->flow() == QDeclarativeGridView::LeftToRight) {
+ return item->y() + view->cellHeight() - 1;
+ } else {
+ if (view->effectiveLayoutDirection() == Qt::RightToLeft)
+ return -item->x() - 1;
+ else
+ return item->x() + view->cellWidth() - 1;
+ }
}
void setPosition(qreal col, qreal row) {
- if (view->flow() == QDeclarativeGridView::LeftToRight) {
- item->setPos(QPointF(col, row));
+ if (view->effectiveLayoutDirection() == Qt::RightToLeft) {
+ if (view->flow() == QDeclarativeGridView::LeftToRight) {
+ int columns = view->width()/view->cellWidth();
+ item->setPos(QPointF((view->cellWidth() * (columns-1) - col), row));
+ } else {
+ item->setPos(QPointF(-view->cellWidth()-row, col));
+ }
} else {
- item->setPos(QPointF(row, col));
+ if (view->flow() == QDeclarativeGridView::LeftToRight)
+ item->setPos(QPointF(col, row));
+ else
+ item->setPos(QPointF(row, col));
}
+
}
bool contains(qreal x, qreal y) const {
return (x >= item->x() && x < item->x() + view->cellWidth() &&
@@ -101,10 +142,12 @@ class QDeclarativeGridViewPrivate : public QDeclarativeFlickablePrivate
public:
QDeclarativeGridViewPrivate()
- : currentItem(0), flow(QDeclarativeGridView::LeftToRight)
+ : currentItem(0), layoutDirection(Qt::LeftToRight), flow(QDeclarativeGridView::LeftToRight)
, visibleIndex(0) , currentIndex(-1)
, cellWidth(100), cellHeight(100), columns(1), requestedIndex(-1), itemCount(0)
- , highlightRangeStart(0), highlightRangeEnd(0), highlightRange(QDeclarativeGridView::NoHighlightRange)
+ , highlightRangeStart(0), highlightRangeEnd(0)
+ , highlightRangeStartValid(false), highlightRangeEndValid(false)
+ , highlightRange(QDeclarativeGridView::NoHighlightRange)
, highlightComponent(0), highlight(0), trackedItem(0)
, moveReason(Other), buffer(0), highlightXAnimator(0), highlightYAnimator(0)
, highlightMoveDuration(150)
@@ -144,35 +187,71 @@ public:
return 0;
}
+ bool isRightToLeftTopToBottom() const {
+ Q_Q(const QDeclarativeGridView);
+ return flow == QDeclarativeGridView::TopToBottom && q->effectiveLayoutDirection() == Qt::RightToLeft;
+ }
+
+ void regenerate() {
+ Q_Q(QDeclarativeGridView);
+ if (q->isComponentComplete()) {
+ clear();
+ updateGrid();
+ q->refill();
+ updateCurrent(currentIndex);
+ }
+ }
+
+ void mirrorChange() {
+ Q_Q(QDeclarativeGridView);
+ regenerate();
+ emit q->effectiveLayoutDirectionChanged();
+ }
+
qreal position() const {
Q_Q(const QDeclarativeGridView);
return flow == QDeclarativeGridView::LeftToRight ? q->contentY() : q->contentX();
}
void setPosition(qreal pos) {
Q_Q(QDeclarativeGridView);
- if (flow == QDeclarativeGridView::LeftToRight)
+ if (flow == QDeclarativeGridView::LeftToRight) {
q->QDeclarativeFlickable::setContentY(pos);
- else
- q->QDeclarativeFlickable::setContentX(pos);
+ q->QDeclarativeFlickable::setContentX(0);
+ } else {
+ if (q->effectiveLayoutDirection() == Qt::LeftToRight)
+ q->QDeclarativeFlickable::setContentX(pos);
+ else
+ q->QDeclarativeFlickable::setContentX(-pos-size());
+ q->QDeclarativeFlickable::setContentY(0);
+ }
}
int size() const {
Q_Q(const QDeclarativeGridView);
return flow == QDeclarativeGridView::LeftToRight ? q->height() : q->width();
}
- qreal startPosition() const {
+ qreal originPosition() const {
qreal pos = 0;
if (!visibleItems.isEmpty())
pos = visibleItems.first()->rowPos() - visibleIndex / columns * rowSize();
return pos;
}
- qreal endPosition() const {
+ qreal lastPosition() const {
qreal pos = 0;
if (model && model->count())
pos = rowPosAt(model->count() - 1) + rowSize();
return pos;
}
+ qreal startPosition() const {
+ return isRightToLeftTopToBottom() ? -lastPosition()+1 : originPosition();
+ }
+
+ qreal endPosition() const {
+ return isRightToLeftTopToBottom() ? -originPosition()+1 : lastPosition();
+
+ }
+
bool isValid() const {
return model && model->count() && model->isValid();
}
@@ -227,7 +306,7 @@ public:
}
FxGridItem *firstVisibleItem() const {
- const qreal pos = position();
+ const qreal pos = isRightToLeftTopToBottom() ? -position()-size() : position();
for (int i = 0; i < visibleItems.count(); ++i) {
FxGridItem *item = visibleItems.at(i);
if (item->index != -1 && item->endRowPos() > pos)
@@ -237,15 +316,12 @@ public:
}
int lastVisibleIndex() const {
- int lastIndex = -1;
- for (int i = visibleItems.count()-1; i >= 0; --i) {
- FxGridItem *gridItem = visibleItems.at(i);
- if (gridItem->index != -1) {
- lastIndex = gridItem->index;
- break;
- }
+ for (int i = 0; i < visibleItems.count(); ++i) {
+ FxGridItem *item = visibleItems.at(i);
+ if (item->index != -1)
+ return item->index;
}
- return lastIndex;
+ return -1;
}
// Map a model index to visibleItems list index.
@@ -271,8 +347,15 @@ public:
pos += rowSize()/2;
snapPos = visibleItems.first()->rowPos() - visibleIndex / columns * rowSize();
snapPos = pos - fmodf(pos - snapPos, qreal(rowSize()));
- qreal maxExtent = flow == QDeclarativeGridView::LeftToRight ? -q->maxYExtent() : -q->maxXExtent();
- qreal minExtent = flow == QDeclarativeGridView::LeftToRight ? -q->minYExtent() : -q->minXExtent();
+ qreal maxExtent;
+ qreal minExtent;
+ if (isRightToLeftTopToBottom()) {
+ maxExtent = q->minXExtent();
+ minExtent = q->maxXExtent();
+ } else {
+ maxExtent = flow == QDeclarativeGridView::LeftToRight ? -q->maxYExtent() : -q->maxXExtent();
+ minExtent = flow == QDeclarativeGridView::LeftToRight ? -q->minYExtent() : -q->minXExtent();
+ }
if (snapPos > maxExtent)
snapPos = maxExtent;
if (snapPos < minExtent)
@@ -363,6 +446,7 @@ public:
QList<FxGridItem*> visibleItems;
QHash<QDeclarativeItem*,int> unrequestedItems;
FxGridItem *currentItem;
+ Qt::LayoutDirection layoutDirection;
QDeclarativeGridView::Flow flow;
int visibleIndex;
int currentIndex;
@@ -373,6 +457,8 @@ public:
int itemCount;
qreal highlightRangeStart;
qreal highlightRangeEnd;
+ bool highlightRangeStartValid;
+ bool highlightRangeEndValid;
QDeclarativeGridView::HighlightRangeMode highlightRange;
QDeclarativeComponent *highlightComponent;
FxGridItem *highlight;
@@ -554,7 +640,7 @@ void QDeclarativeGridViewPrivate::refill(qreal from, qreal to, bool doBuffer)
if (!lazyRelease || !changed || deferredRelease) { // avoid destroying items in the same frame that we create
while (visibleItems.count() > 1
&& (item = visibleItems.first())
- && item->endRowPos() < bufferFrom - rowSize()*(item->colPos()/colSize()+1)/(columns+1)) {
+ && item->rowPos()+rowSize()-1 < bufferFrom - rowSize()*(item->colPos()/colSize()+1)/(columns+1)) {
if (item->attached->delayRemove())
break;
// qDebug() << "refill: remove first" << visibleIndex << "top end pos" << item->endRowPos();
@@ -596,12 +682,14 @@ void QDeclarativeGridViewPrivate::refill(qreal from, qreal to, bool doBuffer)
void QDeclarativeGridViewPrivate::updateGrid()
{
Q_Q(QDeclarativeGridView);
+
columns = (int)qMax((flow == QDeclarativeGridView::LeftToRight ? q->width() : q->height()) / colSize(), qreal(1.));
if (isValid()) {
if (flow == QDeclarativeGridView::LeftToRight)
q->setContentHeight(endPosition() - startPosition());
else
- q->setContentWidth(endPosition() - startPosition());
+ q->setContentWidth(lastPosition() - originPosition());
+ setPosition(0);
}
}
@@ -669,10 +757,14 @@ void QDeclarativeGridViewPrivate::updateUnrequestedPositions()
{
QHash<QDeclarativeItem*,int>::const_iterator it;
for (it = unrequestedItems.begin(); it != unrequestedItems.end(); ++it) {
+ QDeclarativeItem *item = it.key();
if (flow == QDeclarativeGridView::LeftToRight) {
- it.key()->setPos(QPointF(colPosAt(*it), rowPosAt(*it)));
+ item->setPos(QPointF(colPosAt(*it), rowPosAt(*it)));
} else {
- it.key()->setPos(QPointF(rowPosAt(*it), colPosAt(*it)));
+ if (isRightToLeftTopToBottom())
+ item->setPos(QPointF(-rowPosAt(*it)-item->width(), colPosAt(*it)));
+ else
+ item->setPos(QPointF(rowPosAt(*it), colPosAt(*it)));
}
}
}
@@ -837,23 +929,30 @@ void QDeclarativeGridViewPrivate::updateFooter()
}
}
if (footer) {
+ qreal colOffset = 0;
+ qreal rowOffset;
+ if (isRightToLeftTopToBottom()) {
+ rowOffset = footer->item->width()-cellWidth;
+ } else {
+ rowOffset = 0;
+ if (q->effectiveLayoutDirection() == Qt::RightToLeft)
+ colOffset = footer->item->width()-cellWidth;
+ }
if (visibleItems.count()) {
- qreal endPos = endPosition();
+ qreal endPos = lastPosition();
if (lastVisibleIndex() == model->count()-1) {
- footer->setPosition(0, endPos);
+ footer->setPosition(colOffset, endPos + rowOffset);
} else {
- qreal visiblePos = position() + q->height();
- if (endPos <= visiblePos || footer->endRowPos() < endPos)
- footer->setPosition(0, endPos);
+ qreal visiblePos = isRightToLeftTopToBottom() ? -position() : position() + size();
+ if (endPos <= visiblePos || footer->endRowPos() < endPos + rowOffset)
+ footer->setPosition(colOffset, endPos + rowOffset);
}
} else {
qreal endPos = 0;
if (header) {
- endPos += flow == QDeclarativeGridView::LeftToRight
- ? header->item->height()
- : header->item->width();
+ endPos += flow == QDeclarativeGridView::LeftToRight ? header->item->height() : header->item->width();
}
- footer->setPosition(0, endPos);
+ footer->setPosition(colOffset, endPos);
}
}
}
@@ -883,16 +982,27 @@ void QDeclarativeGridViewPrivate::updateHeader()
}
}
if (header) {
+ qreal colOffset = 0;
+ qreal rowOffset;
+ if (isRightToLeftTopToBottom()) {
+ rowOffset = -cellWidth;
+ } else {
+ rowOffset = -headerSize();
+ if (q->effectiveLayoutDirection() == Qt::RightToLeft)
+ colOffset = header->item->width()-cellWidth;
+ }
if (visibleItems.count()) {
- qreal startPos = startPosition();
+ qreal startPos = originPosition();
if (visibleIndex == 0) {
- header->setPosition(0, startPos - headerSize());
+ header->setPosition(colOffset, startPos + rowOffset);
} else {
- if (position() <= startPos || header->rowPos() > startPos - headerSize())
- header->setPosition(0, startPos - headerSize());
+ qreal tempPos = isRightToLeftTopToBottom() ? -position()-size() : position();
+ qreal headerPos = isRightToLeftTopToBottom() ? header->rowPos() + cellWidth - headerSize() : header->rowPos();
+ if (tempPos <= startPos || headerPos > startPos + rowOffset)
+ header->setPosition(colOffset, startPos + rowOffset);
}
} else {
- header->setPosition(0, 0);
+ header->setPosition(colOffset, 0);
}
}
}
@@ -912,76 +1022,107 @@ void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
|| (flow == QDeclarativeGridView::LeftToRight && &data == &hData))
return;
- int oldDuration = fixupDuration;
- fixupDuration = moveReason == Mouse ? fixupDuration : 0;
+ fixupMode = moveReason == Mouse ? fixupMode : Immediate;
+
+ qreal highlightStart;
+ qreal highlightEnd;
+ qreal viewPos;
+ if (isRightToLeftTopToBottom()) {
+ // Handle Right-To-Left exceptions
+ viewPos = -position()-size();
+ highlightStart = highlightRangeStartValid ? size()-highlightRangeEnd : highlightRangeStart;
+ highlightEnd = highlightRangeEndValid ? size()-highlightRangeStart : highlightRangeEnd;
+ } else {
+ viewPos = position();
+ highlightStart = highlightRangeStart;
+ highlightEnd = highlightRangeEnd;
+ }
if (snapMode != QDeclarativeGridView::NoSnap) {
- FxGridItem *topItem = snapItemAt(position()+highlightRangeStart);
- FxGridItem *bottomItem = snapItemAt(position()+highlightRangeEnd);
+ qreal tempPosition = isRightToLeftTopToBottom() ? -position()-size() : position();
+ FxGridItem *topItem = snapItemAt(tempPosition+highlightStart);
+ FxGridItem *bottomItem = snapItemAt(tempPosition+highlightEnd);
qreal pos;
if (topItem && bottomItem && haveHighlightRange && highlightRange == QDeclarativeGridView::StrictlyEnforceRange) {
- qreal topPos = qMin(topItem->rowPos() - highlightRangeStart, -maxExtent);
- qreal bottomPos = qMax(bottomItem->rowPos() - highlightRangeEnd, -minExtent);
+ qreal topPos = qMin(topItem->rowPos() - highlightStart, -maxExtent);
+ qreal bottomPos = qMax(bottomItem->rowPos() - highlightEnd, -minExtent);
pos = qAbs(data.move + topPos) < qAbs(data.move + bottomPos) ? topPos : bottomPos;
} else if (topItem) {
- if (topItem->index == 0 && header && position()+highlightRangeStart < header->rowPos()+headerSize()/2)
- pos = header->rowPos() - highlightRangeStart;
- else
- pos = qMax(qMin(topItem->rowPos() - highlightRangeStart, -maxExtent), -minExtent);
+ qreal headerPos = 0;
+ if (header)
+ headerPos = isRightToLeftTopToBottom() ? header->rowPos() + cellWidth - headerSize() : header->rowPos();
+ if (topItem->index == 0 && header && tempPosition+highlightStart < headerPos+headerSize()/2) {
+ pos = isRightToLeftTopToBottom() ? - headerPos + highlightStart - size() : headerPos - highlightStart;
+ } else {
+ if (isRightToLeftTopToBottom())
+ pos = qMax(qMin(-topItem->rowPos() + highlightStart - size(), -maxExtent), -minExtent);
+ else
+ pos = qMax(qMin(topItem->rowPos() - highlightStart, -maxExtent), -minExtent);
+ }
} else if (bottomItem) {
- pos = qMax(qMin(bottomItem->rowPos() - highlightRangeStart, -maxExtent), -minExtent);
+ if (isRightToLeftTopToBottom())
+ pos = qMax(qMin(-bottomItem->rowPos() + highlightStart - size(), -maxExtent), -minExtent);
+ else
+ pos = qMax(qMin(bottomItem->rowPos() - highlightStart, -maxExtent), -minExtent);
} else {
QDeclarativeFlickablePrivate::fixup(data, minExtent, maxExtent);
- fixupDuration = oldDuration;
return;
}
if (currentItem && haveHighlightRange && highlightRange == QDeclarativeGridView::StrictlyEnforceRange) {
updateHighlight();
qreal currPos = currentItem->rowPos();
- if (pos < currPos + rowSize() - highlightRangeEnd)
- pos = currPos + rowSize() - highlightRangeEnd;
- if (pos > currPos - highlightRangeStart)
- pos = currPos - highlightRangeStart;
+ if (isRightToLeftTopToBottom())
+ pos = -pos-size(); // Transform Pos if required
+ if (pos < currPos + rowSize() - highlightEnd)
+ pos = currPos + rowSize() - highlightEnd;
+ if (pos > currPos - highlightStart)
+ pos = currPos - highlightStart;
+ if (isRightToLeftTopToBottom())
+ pos = -pos-size(); // Untransform
}
-
qreal dist = qAbs(data.move + pos);
if (dist > 0) {
timeline.reset(data.move);
- if (fixupDuration)
+ if (fixupMode != Immediate) {
timeline.move(data.move, -pos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);
- else
+ data.fixingUp = true;
+ } else {
timeline.set(data.move, -pos);
+ }
vTime = timeline.time();
}
} else if (haveHighlightRange && highlightRange == QDeclarativeGridView::StrictlyEnforceRange) {
if (currentItem) {
updateHighlight();
qreal pos = currentItem->rowPos();
- qreal viewPos = position();
- if (viewPos < pos + rowSize() - highlightRangeEnd)
- viewPos = pos + rowSize() - highlightRangeEnd;
- if (viewPos > pos - highlightRangeStart)
- viewPos = pos - highlightRangeStart;
-
+ if (viewPos < pos + rowSize() - highlightEnd)
+ viewPos = pos + rowSize() - highlightEnd;
+ if (viewPos > pos - highlightStart)
+ viewPos = pos - highlightStart;
+ if (isRightToLeftTopToBottom())
+ viewPos = -viewPos-size();
timeline.reset(data.move);
if (viewPos != position()) {
- if (fixupDuration)
+ if (fixupMode != Immediate) {
timeline.move(data.move, -viewPos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);
- else
+ data.fixingUp = true;
+ } else {
timeline.set(data.move, -viewPos);
+ }
}
vTime = timeline.time();
}
} else {
QDeclarativeFlickablePrivate::fixup(data, minExtent, maxExtent);
}
- fixupDuration = oldDuration;
+ fixupMode = Normal;
}
void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize,
QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity)
{
Q_Q(QDeclarativeGridView);
+ data.fixingUp = false;
moveReason = Mouse;
if ((!haveHighlightRange || highlightRange != QDeclarativeGridView::StrictlyEnforceRange)
&& snapMode == QDeclarativeGridView::NoSnap) {
@@ -989,12 +1130,14 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
return;
}
qreal maxDistance = 0;
- // -ve velocity means list is moving up
+ qreal dataValue = isRightToLeftTopToBottom() ? -data.move.value()+size() : data.move.value();
+ // -ve velocity means list is moving up/left
if (velocity > 0) {
if (data.move.value() < minExtent) {
if (snapMode == QDeclarativeGridView::SnapOneRow) {
- if (FxGridItem *item = firstVisibleItem())
- maxDistance = qAbs(item->rowPos() + data.move.value());
+ if (FxGridItem *item = firstVisibleItem()) {
+ maxDistance = qAbs(item->rowPos() + dataValue);
+ }
} else {
maxDistance = qAbs(minExtent - data.move.value());
}
@@ -1004,8 +1147,8 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
} else {
if (data.move.value() > maxExtent) {
if (snapMode == QDeclarativeGridView::SnapOneRow) {
- qreal pos = snapPosAt(-data.move.value()) + rowSize();
- maxDistance = qAbs(pos + data.move.value());
+ qreal pos = snapPosAt(-dataValue) + (isRightToLeftTopToBottom() ? 0 : rowSize());
+ maxDistance = qAbs(pos + dataValue);
} else {
maxDistance = qAbs(maxExtent - data.move.value());
}
@@ -1013,7 +1156,10 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
if (snapMode == QDeclarativeGridView::NoSnap && highlightRange != QDeclarativeGridView::StrictlyEnforceRange)
data.flickTarget = maxExtent;
}
+
bool overShoot = boundsBehavior == QDeclarativeFlickable::DragAndOvershootBounds;
+ qreal highlightStart = isRightToLeftTopToBottom() && highlightRangeStartValid ? size()-highlightRangeEnd : highlightRangeStart;
+
if (maxDistance > 0 || overShoot) {
// This mode requires the grid to stop exactly on a row boundary.
qreal v = velocity;
@@ -1032,7 +1178,9 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
dist = qMin(dist, maxDistance);
if (v > 0)
dist = -dist;
- data.flickTarget = -snapPosAt(-(data.move.value() - highlightRangeStart) + dist) + highlightRangeStart;
+ qreal distTemp = isRightToLeftTopToBottom() ? -dist : dist;
+ data.flickTarget = -snapPosAt(-(dataValue - highlightStart) + distTemp) + highlightStart;
+ data.flickTarget = isRightToLeftTopToBottom() ? -data.flickTarget+size() : data.flickTarget;
qreal adjDist = -data.flickTarget + data.move.value();
if (qAbs(adjDist) > qAbs(dist)) {
// Prevent painfully slow flicking - adjust velocity to suit flickDeceleration
@@ -1224,6 +1372,13 @@ QVariant QDeclarativeGridView::model() const
return d->modelVariant;
}
+// For internal use
+int QDeclarativeGridView::modelCount() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->model->count();
+}
+
void QDeclarativeGridView::setModel(const QVariant &model)
{
Q_D(QDeclarativeGridView);
@@ -1549,6 +1704,7 @@ qreal QDeclarativeGridView::preferredHighlightBegin() const
void QDeclarativeGridView::setPreferredHighlightBegin(qreal start)
{
Q_D(QDeclarativeGridView);
+ d->highlightRangeStartValid = true;
if (d->highlightRangeStart == start)
return;
d->highlightRangeStart = start;
@@ -1556,6 +1712,16 @@ void QDeclarativeGridView::setPreferredHighlightBegin(qreal start)
emit preferredHighlightBeginChanged();
}
+void QDeclarativeGridView::resetPreferredHighlightBegin()
+{
+ Q_D(QDeclarativeGridView);
+ d->highlightRangeStartValid = false;
+ if (d->highlightRangeStart == 0)
+ return;
+ d->highlightRangeStart = 0;
+ emit preferredHighlightBeginChanged();
+}
+
qreal QDeclarativeGridView::preferredHighlightEnd() const
{
Q_D(const QDeclarativeGridView);
@@ -1565,6 +1731,7 @@ qreal QDeclarativeGridView::preferredHighlightEnd() const
void QDeclarativeGridView::setPreferredHighlightEnd(qreal end)
{
Q_D(QDeclarativeGridView);
+ d->highlightRangeEndValid = true;
if (d->highlightRangeEnd == end)
return;
d->highlightRangeEnd = end;
@@ -1572,6 +1739,16 @@ void QDeclarativeGridView::setPreferredHighlightEnd(qreal end)
emit preferredHighlightEndChanged();
}
+void QDeclarativeGridView::resetPreferredHighlightEnd()
+{
+ Q_D(QDeclarativeGridView);
+ d->highlightRangeEndValid = false;
+ if (d->highlightRangeEnd == 0)
+ return;
+ d->highlightRangeEnd = 0;
+ emit preferredHighlightEndChanged();
+}
+
QDeclarativeGridView::HighlightRangeMode QDeclarativeGridView::highlightRangeMode() const
{
Q_D(const QDeclarativeGridView);
@@ -1588,6 +1765,60 @@ void QDeclarativeGridView::setHighlightRangeMode(HighlightRangeMode mode)
emit highlightRangeModeChanged();
}
+/*!
+ \qmlproperty enumeration GridView::layoutDirection
+ This property holds the layout direction of the grid.
+
+ Possible values:
+
+ \list
+ \o Qt.LeftToRight (default) - Items will be laid out starting in the top, left corner. The flow is
+ dependent on the \l GridView::flow property.
+ \o Qt.RightToLeft - Items will be laid out starting in the top, right corner. The flow is dependent
+ on the \l GridView:flow property.
+ \endlist
+
+ \bold Note: If GridView::flow is set to GridView.LeftToRight, this is not to be confused if
+ GridView::layoutDirection is set to Qt.RightToLeft. The GridView.LeftToRight flow value simply
+ indicates that the flow is horizontal.
+*/
+
+Qt::LayoutDirection QDeclarativeGridView::layoutDirection() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->layoutDirection;
+}
+
+void QDeclarativeGridView::setLayoutDirection(Qt::LayoutDirection layoutDirection)
+{
+ Q_D(QDeclarativeGridView);
+ if (d->layoutDirection != layoutDirection) {
+ d->layoutDirection = layoutDirection;
+ d->regenerate();
+ emit layoutDirectionChanged();
+ emit effectiveLayoutDirectionChanged();
+ }
+}
+
+/*!
+ \qmlproperty enumeration GridView::effectiveLayoutDirection
+ This property holds the effective layout direction of the grid.
+
+ When using the attached property \l {LayoutMirroring::enabled}{LayoutMirroring::enabled} for locale layouts,
+ the visual layout direction of the grid will be mirrored. However, the
+ property \l {GridView::layoutDirection}{layoutDirection} will remain unchanged.
+
+ \sa GridView::layoutDirection, {LayoutMirroring}{LayoutMirroring}
+*/
+
+Qt::LayoutDirection QDeclarativeGridView::effectiveLayoutDirection() const
+{
+ Q_D(const QDeclarativeGridView);
+ if (d->effectiveLayoutMirror)
+ return d->layoutDirection == Qt::RightToLeft ? Qt::LeftToRight : Qt::RightToLeft;
+ else
+ return d->layoutDirection;
+}
/*!
\qmlproperty enumeration GridView::flow
@@ -1620,10 +1851,7 @@ void QDeclarativeGridView::setFlow(Flow flow)
}
setContentX(0);
setContentY(0);
- d->clear();
- d->updateGrid();
- refill();
- d->updateCurrent(d->currentIndex);
+ d->regenerate();
emit flowChanged();
}
}
@@ -1890,11 +2118,23 @@ void QDeclarativeGridView::viewportMoved()
if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange && d->highlight) {
// reposition highlight
qreal pos = d->highlight->rowPos();
- qreal viewPos = d->position();
- if (pos > viewPos + d->highlightRangeEnd - d->rowSize())
- pos = viewPos + d->highlightRangeEnd - d->rowSize();
- if (pos < viewPos + d->highlightRangeStart)
- pos = viewPos + d->highlightRangeStart;
+ qreal viewPos;
+ qreal highlightStart;
+ qreal highlightEnd;
+ if (d->isRightToLeftTopToBottom()) {
+ highlightStart = d->highlightRangeStartValid ? d->size()-d->highlightRangeEnd : d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEndValid ? d->size()-d->highlightRangeStart : d->highlightRangeEnd;
+ viewPos = -d->position()-d->size();
+ } else {
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ viewPos = d->position();
+ }
+ if (pos > viewPos + highlightEnd - d->rowSize())
+ pos = viewPos + highlightEnd - d->rowSize();
+ if (pos < viewPos + highlightStart)
+ pos = viewPos + highlightStart;
+
d->highlight->setPosition(d->highlight->colPos(), qRound(pos));
// update current index
@@ -1956,11 +2196,27 @@ qreal QDeclarativeGridView::minXExtent() const
if (d->flow == QDeclarativeGridView::LeftToRight)
return QDeclarativeFlickable::minXExtent();
qreal extent = -d->startPosition();
- if (d->header && d->visibleItems.count())
- extent += d->header->item->width();
+ qreal highlightStart;
+ qreal highlightEnd;
+ qreal endPositionFirstItem;
+ if (d->isRightToLeftTopToBottom()) {
+ endPositionFirstItem = d->rowPosAt(d->model->count()-1);
+ highlightStart = d->highlightRangeStartValid
+ ? d->highlightRangeStart - (d->lastPosition()-endPositionFirstItem)
+ : d->size() - (d->lastPosition()-endPositionFirstItem);
+ highlightEnd = d->highlightRangeEndValid ? d->highlightRangeEnd : d->size();
+ if (d->footer && d->visibleItems.count())
+ extent += d->footer->item->width();
+ } else {
+ endPositionFirstItem = d->rowPosAt(0)+d->rowSize();
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ if (d->header && d->visibleItems.count())
+ extent += d->header->item->width();
+ }
if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
- extent += d->highlightRangeStart;
- extent = qMax(extent, -(d->rowPosAt(0) + d->rowSize() - d->highlightRangeEnd));
+ extent += highlightStart;
+ extent = qMax(extent, -(endPositionFirstItem - highlightEnd));
}
return extent;
}
@@ -1971,17 +2227,38 @@ qreal QDeclarativeGridView::maxXExtent() const
if (d->flow == QDeclarativeGridView::LeftToRight)
return QDeclarativeFlickable::maxXExtent();
qreal extent;
+ qreal highlightStart;
+ qreal highlightEnd;
+ qreal lastItemPosition;
+ if (d->isRightToLeftTopToBottom()){
+ highlightStart = d->highlightRangeStartValid ? d->highlightRangeEnd : d->size();
+ highlightEnd = d->highlightRangeEndValid ? d->highlightRangeStart : d->size();
+ lastItemPosition = d->endPosition();
+ } else {
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ if (d->model && d->model->count())
+ lastItemPosition = d->rowPosAt(d->model->count()-1);
+ }
if (!d->model || !d->model->count()) {
extent = 0;
- } if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
- extent = -(d->rowPosAt(d->model->count()-1) - d->highlightRangeStart);
- if (d->highlightRangeEnd != d->highlightRangeStart)
- extent = qMin(extent, -(d->endPosition() - d->highlightRangeEnd + 1));
+ } else if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
+ extent = -(lastItemPosition - highlightStart);
+ if (highlightEnd != highlightStart)
+ extent = d->isRightToLeftTopToBottom()
+ ? qMax(extent, -(d->endPosition() - highlightEnd + 1))
+ : qMin(extent, -(d->endPosition() - highlightEnd + 1));
} else {
extent = -(d->endPosition() - width());
}
- if (d->footer)
- extent -= d->footer->item->width();
+ if (d->isRightToLeftTopToBottom()) {
+ if (d->header)
+ extent -= d->header->item->width();
+ } else {
+ if (d->footer)
+ extent -= d->footer->item->width();
+ }
+
const qreal minX = minXExtent();
if (extent > minX)
extent = minX;
@@ -2094,15 +2371,30 @@ void QDeclarativeGridView::moveCurrentIndexLeft()
const int count = d->model ? d->model->count() : 0;
if (!count)
return;
- if (d->flow == QDeclarativeGridView::LeftToRight) {
- if (currentIndex() > 0 || d->wrap) {
- int index = currentIndex() - 1;
- setCurrentIndex((index >= 0 && index < count) ? index : count-1);
+
+ if (effectiveLayoutDirection() == Qt::LeftToRight) {
+ if (d->flow == QDeclarativeGridView::LeftToRight) {
+ if (currentIndex() > 0 || d->wrap) {
+ int index = currentIndex() - 1;
+ setCurrentIndex((index >= 0 && index < count) ? index : count-1);
+ }
+ } else {
+ if (currentIndex() >= d->columns || d->wrap) {
+ int index = currentIndex() - d->columns;
+ setCurrentIndex((index >= 0 && index < count) ? index : count-1);
+ }
}
} else {
- if (currentIndex() >= d->columns || d->wrap) {
- int index = currentIndex() - d->columns;
- setCurrentIndex((index >= 0 && index < count) ? index : count-1);
+ if (d->flow == QDeclarativeGridView::LeftToRight) {
+ if (currentIndex() < count - 1 || d->wrap) {
+ int index = currentIndex() + 1;
+ setCurrentIndex((index >= 0 && index < count) ? index : 0);
+ }
+ } else {
+ if (currentIndex() < count - d->columns || d->wrap) {
+ int index = currentIndex() + d->columns;
+ setCurrentIndex((index >= 0 && index < count) ? index : 0);
+ }
}
}
}
@@ -2122,15 +2414,30 @@ void QDeclarativeGridView::moveCurrentIndexRight()
const int count = d->model ? d->model->count() : 0;
if (!count)
return;
- if (d->flow == QDeclarativeGridView::LeftToRight) {
- if (currentIndex() < count - 1 || d->wrap) {
- int index = currentIndex() + 1;
- setCurrentIndex((index >= 0 && index < count) ? index : 0);
+
+ if (effectiveLayoutDirection() == Qt::LeftToRight) {
+ if (d->flow == QDeclarativeGridView::LeftToRight) {
+ if (currentIndex() < count - 1 || d->wrap) {
+ int index = currentIndex() + 1;
+ setCurrentIndex((index >= 0 && index < count) ? index : 0);
+ }
+ } else {
+ if (currentIndex() < count - d->columns || d->wrap) {
+ int index = currentIndex()+d->columns;
+ setCurrentIndex((index >= 0 && index < count) ? index : 0);
+ }
}
} else {
- if (currentIndex() < count - d->columns || d->wrap) {
- int index = currentIndex()+d->columns;
- setCurrentIndex((index >= 0 && index < count) ? index : 0);
+ if (d->flow == QDeclarativeGridView::LeftToRight) {
+ if (currentIndex() > 0 || d->wrap) {
+ int index = currentIndex() - 1;
+ setCurrentIndex((index >= 0 && index < count) ? index : count-1);
+ }
+ } else {
+ if (currentIndex() >= d->columns || d->wrap) {
+ int index = currentIndex() - d->columns;
+ setCurrentIndex((index >= 0 && index < count) ? index : count-1);
+ }
}
}
}
@@ -2147,16 +2454,24 @@ void QDeclarativeGridViewPrivate::positionViewAtIndex(int index, int mode)
if (layoutScheduled)
layout();
- qreal pos = position();
+ qreal pos = isRightToLeftTopToBottom() ? -position() - size() : position();
FxGridItem *item = visibleItem(idx);
- qreal maxExtent = flow == QDeclarativeGridView::LeftToRight ? -q->maxYExtent() : -q->maxXExtent();
+ qreal maxExtent;
+ if (flow == QDeclarativeGridView::LeftToRight)
+ maxExtent = -q->maxYExtent();
+ else
+ maxExtent = isRightToLeftTopToBottom() ? q->minXExtent()-size() : -q->maxXExtent();
+
if (!item) {
int itemPos = rowPosAt(idx);
// save the currently visible items in case any of them end up visible again
QList<FxGridItem*> oldVisible = visibleItems;
visibleItems.clear();
visibleIndex = idx - idx % columns;
- maxExtent = flow == QDeclarativeGridView::LeftToRight ? -q->maxYExtent() : -q->maxXExtent();
+ if (flow == QDeclarativeGridView::LeftToRight)
+ maxExtent = -q->maxYExtent();
+ else
+ maxExtent = isRightToLeftTopToBottom() ? q->minXExtent()-size() : -q->maxXExtent();
setPosition(qMin(qreal(itemPos), maxExtent));
// now release the reference to all the old visible items.
for (int i = 0; i < oldVisible.count(); ++i)
@@ -2197,8 +2512,13 @@ void QDeclarativeGridViewPrivate::positionViewAtIndex(int index, int mode)
if (itemPos < pos)
pos = itemPos;
}
+
pos = qMin(pos, maxExtent);
- qreal minExtent = flow == QDeclarativeGridView::LeftToRight ? -q->minYExtent() : -q->minXExtent();
+ qreal minExtent;
+ if (flow == QDeclarativeGridView::LeftToRight)
+ minExtent = -q->minYExtent();
+ else
+ minExtent = isRightToLeftTopToBottom() ? q->maxXExtent()-size() : -q->minXExtent();
pos = qMax(pos, minExtent);
moveReason = QDeclarativeGridViewPrivate::Other;
q->cancelFlick();
@@ -2250,6 +2570,7 @@ void QDeclarativeGridView::positionViewAtIndex(int index, int mode)
/*!
\qmlmethod GridView::positionViewAtBeginning()
\qmlmethod GridView::positionViewAtEnd()
+ \since Quick 1.1
Positions the view at the beginning or end, taking into account any header or footer.
@@ -2337,32 +2658,43 @@ void QDeclarativeGridView::trackedPositionChanged()
return;
if (d->moveReason == QDeclarativeGridViewPrivate::SetIndex) {
const qreal trackedPos = d->trackedItem->rowPos();
- const qreal viewPos = d->position();
+ qreal viewPos;
+ qreal highlightStart;
+ qreal highlightEnd;
+ if (d->isRightToLeftTopToBottom()) {
+ viewPos = -d->position()-d->size();
+ highlightStart = d->highlightRangeStartValid ? d->size()-d->highlightRangeEnd : d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEndValid ? d->size()-d->highlightRangeStart : d->highlightRangeEnd;
+ } else {
+ viewPos = d->position();
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ }
qreal pos = viewPos;
if (d->haveHighlightRange) {
if (d->highlightRange == StrictlyEnforceRange) {
- if (trackedPos > pos + d->highlightRangeEnd - d->rowSize())
- pos = trackedPos - d->highlightRangeEnd + d->rowSize();
- if (trackedPos < pos + d->highlightRangeStart)
- pos = trackedPos - d->highlightRangeStart;
+ if (trackedPos > pos + highlightEnd - d->rowSize())
+ pos = trackedPos - highlightEnd + d->rowSize();
+ if (trackedPos < pos + highlightStart)
+ pos = trackedPos - highlightStart;
} else {
- if (trackedPos < d->startPosition() + d->highlightRangeStart) {
+ if (trackedPos < d->startPosition() + highlightStart) {
pos = d->startPosition();
- } else if (d->trackedItem->endRowPos() > d->endPosition() - d->size() + d->highlightRangeEnd) {
+ } else if (d->trackedItem->endRowPos() > d->endPosition() - d->size() + highlightEnd) {
pos = d->endPosition() - d->size() + 1;
if (pos < d->startPosition())
pos = d->startPosition();
} else {
- if (trackedPos < viewPos + d->highlightRangeStart) {
- pos = trackedPos - d->highlightRangeStart;
- } else if (trackedPos > viewPos + d->highlightRangeEnd - d->rowSize()) {
- pos = trackedPos - d->highlightRangeEnd + d->rowSize();
+ if (trackedPos < viewPos + highlightStart) {
+ pos = trackedPos - highlightStart;
+ } else if (trackedPos > viewPos + highlightEnd - d->rowSize()) {
+ pos = trackedPos - highlightEnd + d->rowSize();
}
}
}
} else {
if (trackedPos < viewPos && d->currentItem->rowPos() < viewPos) {
- pos = d->currentItem->rowPos() < trackedPos ? trackedPos : d->currentItem->rowPos();
+ pos = qMax(trackedPos, d->currentItem->rowPos());
} else if (d->trackedItem->endRowPos() >= viewPos + d->size()
&& d->currentItem->endRowPos() >= viewPos + d->size()) {
if (d->trackedItem->endRowPos() <= d->currentItem->endRowPos()) {
@@ -2430,7 +2762,8 @@ void QDeclarativeGridView::itemsInserted(int modelIndex, int count)
modelIndex = d->visibleIndex;
}
- int to = d->buffer+d->position()+d->size()-1;
+ qreal tempPos = d->isRightToLeftTopToBottom() ? -d->position()-d->size()+d->width()+1 : d->position();
+ int to = d->buffer+tempPos+d->size()-1;
int colPos = 0;
int rowPos = 0;
if (d->visibleItems.count()) {
@@ -2448,10 +2781,7 @@ void QDeclarativeGridView::itemsInserted(int modelIndex, int count)
}
}
} else if (d->itemCount == 0 && d->header) {
- if (d->flow == QDeclarativeGridView::LeftToRight)
- rowPos = d->headerSize();
- else
- colPos = d->headerSize();
+ rowPos = d->headerSize();
}
// Update the indexes of the following visible items.
@@ -2504,10 +2834,10 @@ void QDeclarativeGridView::itemsInserted(int modelIndex, int count)
if (d->currentItem) {
d->currentItem->index = d->currentIndex;
d->currentItem->setPosition(d->colPosAt(d->currentIndex), d->rowPosAt(d->currentIndex));
- } else if (!d->currentIndex || (d->currentIndex < 0 && !d->currentIndexCleared)) {
- d->updateCurrent(0);
}
emit currentIndexChanged();
+ } else if (d->itemCount == 0 && (!d->currentIndex || (d->currentIndex < 0 && !d->currentIndexCleared))) {
+ setCurrentIndex(0);
}
// everything is in order now - emit add() signal
@@ -2574,6 +2904,8 @@ void QDeclarativeGridView::itemsRemoved(int modelIndex, int count)
d->currentIndex = -1;
if (d->itemCount)
d->updateCurrent(qMin(modelIndex, d->itemCount-1));
+ else
+ emit currentIndexChanged();
}
// update visibleIndex
@@ -2756,7 +3088,10 @@ void QDeclarativeGridView::animStopped()
void QDeclarativeGridView::refill()
{
Q_D(QDeclarativeGridView);
- d->refill(d->position(), d->position()+d->size()-1);
+ if (d->isRightToLeftTopToBottom())
+ d->refill(-d->position()-d->size()+1, -d->position());
+ else
+ d->refill(d->position(), d->position()+d->size()-1);
}
diff --git a/src/declarative/graphicsitems/qdeclarativegridview_p.h b/src/declarative/graphicsitems/qdeclarativegridview_p.h
index e68a9ba..4d99a14 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview_p.h
+++ b/src/declarative/graphicsitems/qdeclarativegridview_p.h
@@ -69,11 +69,13 @@ class Q_AUTOTEST_EXPORT QDeclarativeGridView : public QDeclarativeFlickable
Q_PROPERTY(bool highlightFollowsCurrentItem READ highlightFollowsCurrentItem WRITE setHighlightFollowsCurrentItem)
Q_PROPERTY(int highlightMoveDuration READ highlightMoveDuration WRITE setHighlightMoveDuration NOTIFY highlightMoveDurationChanged)
- Q_PROPERTY(qreal preferredHighlightBegin READ preferredHighlightBegin WRITE setPreferredHighlightBegin NOTIFY preferredHighlightBeginChanged)
- Q_PROPERTY(qreal preferredHighlightEnd READ preferredHighlightEnd WRITE setPreferredHighlightEnd NOTIFY preferredHighlightEndChanged)
+ Q_PROPERTY(qreal preferredHighlightBegin READ preferredHighlightBegin WRITE setPreferredHighlightBegin NOTIFY preferredHighlightBeginChanged RESET resetPreferredHighlightBegin)
+ Q_PROPERTY(qreal preferredHighlightEnd READ preferredHighlightEnd WRITE setPreferredHighlightEnd NOTIFY preferredHighlightEndChanged RESET resetPreferredHighlightEnd)
Q_PROPERTY(HighlightRangeMode highlightRangeMode READ highlightRangeMode WRITE setHighlightRangeMode NOTIFY highlightRangeModeChanged)
Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged)
+ Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1)
+ Q_PROPERTY(Qt::LayoutDirection effectiveLayoutDirection READ effectiveLayoutDirection NOTIFY effectiveLayoutDirectionChanged REVISION 1)
Q_PROPERTY(bool keyNavigationWraps READ isWrapEnabled WRITE setWrapEnabled NOTIFY keyNavigationWrapsChanged)
Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer NOTIFY cacheBufferChanged)
Q_PROPERTY(int cellWidth READ cellWidth WRITE setCellWidth NOTIFY cellWidthChanged)
@@ -95,6 +97,7 @@ public:
~QDeclarativeGridView();
QVariant model() const;
+ int modelCount() const;
void setModel(const QVariant &);
QDeclarativeComponent *delegate() const;
@@ -122,9 +125,15 @@ public:
qreal preferredHighlightBegin() const;
void setPreferredHighlightBegin(qreal);
+ void resetPreferredHighlightBegin();
qreal preferredHighlightEnd() const;
void setPreferredHighlightEnd(qreal);
+ void resetPreferredHighlightEnd();
+
+ Qt::LayoutDirection layoutDirection() const;
+ void setLayoutDirection(Qt::LayoutDirection);
+ Qt::LayoutDirection effectiveLayoutDirection() const;
enum Flow { LeftToRight, TopToBottom };
Flow flow() const;
@@ -184,6 +193,8 @@ Q_SIGNALS:
void modelChanged();
void delegateChanged();
void flowChanged();
+ Q_REVISION(1) void layoutDirectionChanged();
+ Q_REVISION(1) void effectiveLayoutDirectionChanged();
void keyNavigationWrapsChanged();
void cacheBufferChanged();
void snapModeChanged();
diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp
index 2c9bde5..ed5d5fc 100644
--- a/src/declarative/graphicsitems/qdeclarativeimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp
@@ -147,8 +147,8 @@ void QDeclarativeImagePrivate::setPixmap(const QPixmap &pixmap)
/*!
\qmlproperty enumeration Image::fillMode
- Set this property to define what happens when the image set for the item is smaller
- than the size of the item.
+ Set this property to define what happens when the source image has a different size
+ than the item.
\list
\o Image.Stretch - the image is scaled to fit
@@ -234,6 +234,9 @@ void QDeclarativeImagePrivate::setPixmap(const QPixmap &pixmap)
\endtable
+ Note that \c clip is \c false by default which means that the element might
+ paint outside its bounding rectangle even if the fillMode is set to \c PreserveAspectCrop.
+
\sa {declarative/imageelements/image}{Image example}
*/
QDeclarativeImage::FillMode QDeclarativeImage::fillMode() const
@@ -386,14 +389,16 @@ void QDeclarativeImage::updatePaintedGeometry()
if (d->fillMode == PreserveAspectFit) {
if (!d->pix.width() || !d->pix.height())
return;
- qreal widthScale = width() / qreal(d->pix.width());
- qreal heightScale = height() / qreal(d->pix.height());
+ qreal w = widthValid() ? width() : d->pix.width();
+ qreal widthScale = w / qreal(d->pix.width());
+ qreal h = heightValid() ? height() : d->pix.height();
+ qreal heightScale = h / qreal(d->pix.height());
if (widthScale <= heightScale) {
- d->paintedWidth = width();
+ d->paintedWidth = w;
d->paintedHeight = widthScale * qreal(d->pix.height());
} else if(heightScale < widthScale) {
d->paintedWidth = heightScale * qreal(d->pix.width());
- d->paintedHeight = height();
+ d->paintedHeight = h;
}
if (widthValid() && !heightValid()) {
setImplicitHeight(d->paintedHeight);
diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
index 471c87f..2de3ba0 100644
--- a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
@@ -130,7 +130,7 @@ QSize QDeclarativeImageBase::sourceSize() const
int width = d->sourcesize.width();
int height = d->sourcesize.height();
- return QSize(width != -1 ? width : implicitWidth(), height != -1 ? height : implicitHeight());
+ return QSize(width != -1 ? width : d->pix.width(), height != -1 ? height : d->pix.height());
}
bool QDeclarativeImageBase::cache() const
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 468b5cb..6602dda 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -39,12 +39,12 @@
**
****************************************************************************/
-#include "private/qdeclarativeitem_p.h"
#include "qdeclarativeitem.h"
#include "private/qdeclarativeevents_p_p.h"
#include <private/qdeclarativeengine_p.h>
#include <private/qgraphicsitem_p.h>
+#include <QtDeclarative/private/qdeclarativeitem_p.h>
#include <qdeclarativeengine.h>
#include <qdeclarativeopenmetaobject_p.h>
@@ -615,19 +615,28 @@ void QDeclarativeKeyNavigationAttached::keyPressed(QKeyEvent *event, bool post)
return;
}
+ bool mirror = false;
switch(event->key()) {
- case Qt::Key_Left:
- if (d->left) {
- setFocusNavigation(d->left, "left");
+ case Qt::Key_Left: {
+ if (QDeclarativeItem *parentItem = qobject_cast<QDeclarativeItem*>(parent()))
+ mirror = QDeclarativeItemPrivate::get(parentItem)->effectiveLayoutMirror;
+ QDeclarativeItem* leftItem = mirror ? d->right : d->left;
+ if (leftItem) {
+ setFocusNavigation(leftItem, mirror ? "right" : "left");
event->accept();
}
break;
- case Qt::Key_Right:
- if (d->right) {
- setFocusNavigation(d->right, "right");
+ }
+ case Qt::Key_Right: {
+ if (QDeclarativeItem *parentItem = qobject_cast<QDeclarativeItem*>(parent()))
+ mirror = QDeclarativeItemPrivate::get(parentItem)->effectiveLayoutMirror;
+ QDeclarativeItem* rightItem = mirror ? d->left : d->right;
+ if (rightItem) {
+ setFocusNavigation(rightItem, mirror ? "left" : "right");
event->accept();
}
break;
+ }
case Qt::Key_Up:
if (d->up) {
setFocusNavigation(d->up, "up");
@@ -669,16 +678,19 @@ void QDeclarativeKeyNavigationAttached::keyReleased(QKeyEvent *event, bool post)
return;
}
+ bool mirror = false;
switch(event->key()) {
case Qt::Key_Left:
- if (d->left) {
+ if (QDeclarativeItem *parentItem = qobject_cast<QDeclarativeItem*>(parent()))
+ mirror = QDeclarativeItemPrivate::get(parentItem)->effectiveLayoutMirror;
+ if (mirror ? d->right : d->left)
event->accept();
- }
break;
case Qt::Key_Right:
- if (d->right) {
+ if (QDeclarativeItem *parentItem = qobject_cast<QDeclarativeItem*>(parent()))
+ mirror = QDeclarativeItemPrivate::get(parentItem)->effectiveLayoutMirror;
+ if (mirror ? d->left : d->right)
event->accept();
- }
break;
case Qt::Key_Up:
if (d->up) {
@@ -731,6 +743,171 @@ void QDeclarativeKeyNavigationAttached::setFocusNavigation(QDeclarativeItem *cur
}
/*!
+ \qmlclass LayoutMirroring QDeclarativeLayoutMirroringAttached
+ \since QtQuick 1.1
+ \ingroup qml-utility-elements
+ \brief The LayoutMirroring attached property is used to mirror layout behavior.
+
+ The LayoutMirroring attached property is used to horizontally mirror \l {anchor-layout}{Item anchors},
+ \l{Using QML Positioner and Repeater Items}{positioner} elements (such as \l Row and \l Grid)
+ and views (such as \l GridView and horizontal \l ListView). Mirroring is a visual change: left
+ anchors become right anchors, and positioner elements like \l Grid and \l Row reverse the
+ horizontal layout of child items.
+
+ Mirroring is enabled for an item by setting the \l enabled property to true. By default, this
+ only affects the item itself; setting the \l childrenInherit property to true propagates the mirroring
+ behavior to all child elements as well. If the \c LayoutMirroring attached property has not been defined
+ for an item, mirroring is not enabled.
+
+ The following example shows mirroring in action. The \l Row below is specified as being anchored
+ to the left of its parent. However, since mirroring has been enabled, the anchor is horizontally
+ reversed and it is now anchored to the right. Also, since items in a \l Row are positioned
+ from left to right by default, they are now positioned from right to left instead, as demonstrated
+ by the numbering and opacity of the items:
+
+ \snippet doc/src/snippets/declarative/layoutmirroring.qml 0
+
+ \image layoutmirroring.png
+
+ Layout mirroring is useful when it is necessary to support both left-to-right and right-to-left
+ layout versions of an application to target different language areas. The \l childrenInherit
+ property allows layout mirroring to be applied without manually setting layout configurations
+ for every item in an application. Keep in mind, however, that mirroring does not affect any
+ positioning that is defined by the \l Item \l {Item::}{x} coordinate value, so even with
+ mirroring enabled, it will often be necessary to apply some layout fixes to support the
+ desired layout direction. Also, it may be necessary to disable the mirroring of individual
+ child items (by setting \l {enabled}{LayoutMirroring.enabled} to false for such items) if
+ mirroring is not the desired behavior, or if the child item already implements mirroring in
+ some custom way.
+
+ See \l {QML Right-to-left User Interfaces} for further details on using \c LayoutMirroring and
+ other related features to implement right-to-left support for an application.
+*/
+
+/*!
+ \qmlproperty bool LayoutMirroring::enabled
+
+ This property holds whether the item's layout is mirrored horizontally. Setting this to true
+ horizontally reverses \l {anchor-layout}{anchor} settings such that left anchors become right,
+ and right anchors become left. For \l{Using QML Positioner and Repeater Items}{positioner} elements
+ (such as \l Row and \l Grid) and view elements (such as \l {GridView}{GridView} and \l {ListView}{ListView})
+ this also mirrors the horizontal layout direction of the item.
+
+ The default value is false.
+*/
+
+/*!
+ \qmlproperty bool LayoutMirroring::childrenInherit
+
+ This property holds whether the \l {enabled}{LayoutMirroring.enabled} value for this item
+ is inherited by its children.
+
+ The default value is false.
+*/
+
+QDeclarativeLayoutMirroringAttached::QDeclarativeLayoutMirroringAttached(QObject *parent) : QObject(parent), itemPrivate(0)
+{
+ if (QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(parent)) {
+ itemPrivate = QDeclarativeItemPrivate::get(item);
+ itemPrivate->attachedLayoutDirection = this;
+ } else
+ qmlInfo(parent) << tr("LayoutDirection attached property only works with Items");
+}
+
+QDeclarativeLayoutMirroringAttached * QDeclarativeLayoutMirroringAttached::qmlAttachedProperties(QObject *object)
+{
+ return new QDeclarativeLayoutMirroringAttached(object);
+}
+
+bool QDeclarativeLayoutMirroringAttached::enabled() const
+{
+ return itemPrivate ? itemPrivate->effectiveLayoutMirror : false;
+}
+
+void QDeclarativeLayoutMirroringAttached::setEnabled(bool enabled)
+{
+ if (!itemPrivate)
+ return;
+
+ itemPrivate->isMirrorImplicit = false;
+ if (enabled != itemPrivate->effectiveLayoutMirror) {
+ itemPrivate->setLayoutMirror(enabled);
+ if (itemPrivate->inheritMirrorFromItem)
+ itemPrivate->resolveLayoutMirror();
+ }
+}
+
+void QDeclarativeLayoutMirroringAttached::resetEnabled()
+{
+ if (itemPrivate && !itemPrivate->isMirrorImplicit) {
+ itemPrivate->isMirrorImplicit = true;
+ itemPrivate->resolveLayoutMirror();
+ }
+}
+
+bool QDeclarativeLayoutMirroringAttached::childrenInherit() const
+{
+ return itemPrivate ? itemPrivate->inheritMirrorFromItem : false;
+}
+
+void QDeclarativeLayoutMirroringAttached::setChildrenInherit(bool childrenInherit) {
+ if (itemPrivate && childrenInherit != itemPrivate->inheritMirrorFromItem) {
+ itemPrivate->inheritMirrorFromItem = childrenInherit;
+ itemPrivate->resolveLayoutMirror();
+ childrenInheritChanged();
+ }
+}
+
+void QDeclarativeItemPrivate::resolveLayoutMirror()
+{
+ Q_Q(QDeclarativeItem);
+ if (QDeclarativeItem *parentItem = q->parentItem()) {
+ QDeclarativeItemPrivate *parentPrivate = QDeclarativeItemPrivate::get(parentItem);
+ setImplicitLayoutMirror(parentPrivate->inheritedLayoutMirror, parentPrivate->inheritMirrorFromParent);
+ } else {
+ setImplicitLayoutMirror(isMirrorImplicit ? false : effectiveLayoutMirror, inheritMirrorFromItem);
+ }
+}
+
+void QDeclarativeItemPrivate::setImplicitLayoutMirror(bool mirror, bool inherit)
+{
+ inherit = inherit || inheritMirrorFromItem;
+ if (!isMirrorImplicit && inheritMirrorFromItem)
+ mirror = effectiveLayoutMirror;
+ if (mirror == inheritedLayoutMirror && inherit == inheritMirrorFromParent)
+ return;
+
+ inheritMirrorFromParent = inherit;
+ inheritedLayoutMirror = inheritMirrorFromParent ? mirror : false;
+
+ if (isMirrorImplicit)
+ setLayoutMirror(inherit ? inheritedLayoutMirror : false);
+ for (int i = 0; i < children.count(); ++i) {
+ if (QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(i))) {
+ QDeclarativeItemPrivate *childPrivate = QDeclarativeItemPrivate::get(child);
+ childPrivate->setImplicitLayoutMirror(inheritedLayoutMirror, inheritMirrorFromParent);
+ }
+ }
+}
+
+void QDeclarativeItemPrivate::setLayoutMirror(bool mirror)
+{
+ if (mirror != effectiveLayoutMirror) {
+ effectiveLayoutMirror = mirror;
+ if (_anchors) {
+ _anchors->d_func()->fillChanged();
+ _anchors->d_func()->centerInChanged();
+ _anchors->d_func()->updateHorizontalAnchors();
+ emit _anchors->mirroredChanged();
+ }
+ mirrorChange();
+ if (attachedLayoutDirection) {
+ emit attachedLayoutDirection->enabledChanged();
+ }
+ }
+}
+
+/*!
\qmlclass Keys QDeclarativeKeysAttached
\ingroup qml-basic-interaction-elements
\since 4.7
@@ -1397,6 +1574,11 @@ QDeclarativeKeysAttached *QDeclarativeKeysAttached::qmlAttachedProperties(QObjec
\endqml
See the \l {Keys}{Keys} attached property for detailed documentation.
+
+ \section1 Layout Mirroring
+
+ Item layouts can be mirrored using the \l {LayoutMirroring}{LayoutMirroring} attached property.
+
*/
/*!
@@ -2154,6 +2336,8 @@ QDeclarativeAnchorLine QDeclarativeItemPrivate::baseline() const
\qmlproperty real Item::anchors.verticalCenterOffset
\qmlproperty real Item::anchors.baselineOffset
+ \qmlproperty bool Item::anchors.mirrored
+
Anchors provide a way to position an item by specifying its
relationship with other items.
@@ -2211,6 +2395,8 @@ QDeclarativeAnchorLine QDeclarativeItemPrivate::baseline() const
To clear an anchor value, set it to \c undefined.
+ \c anchors.mirrored returns true it the layout has been \l {LayoutMirroring}{mirrored}.
+
\note You can only anchor an item to siblings or a parent.
For more information see \l {anchor-layout}{Anchor Layouts}.
@@ -2812,6 +2998,7 @@ QVariant QDeclarativeItem::itemChange(GraphicsItemChange change,
Q_D(QDeclarativeItem);
switch (change) {
case ItemParentHasChanged:
+ d->resolveLayoutMirror();
emit parentChanged(parentItem());
d->parentNotifier.notify();
break;
diff --git a/src/declarative/graphicsitems/qdeclarativeitem_p.h b/src/declarative/graphicsitems/qdeclarativeitem_p.h
index 4303c0a..dae581c 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeitem_p.h
@@ -77,6 +77,7 @@ QT_BEGIN_NAMESPACE
class QNetworkReply;
class QDeclarativeItemKeyFilter;
+class QDeclarativeLayoutMirroringAttached;
//### merge into private?
class QDeclarativeContents : public QObject, public QDeclarativeItemChangeListener
@@ -125,8 +126,10 @@ public:
_stateGroup(0), origin(QDeclarativeItem::Center),
widthValid(false), heightValid(false),
componentComplete(true), keepMouse(false),
- smooth(false), transformOriginDirty(true), doneEventPreHandler(false), keyHandler(0),
- mWidth(0), mHeight(0), mImplicitWidth(0), mImplicitHeight(0), hadSubFocusItem(false)
+ smooth(false), transformOriginDirty(true), doneEventPreHandler(false),
+ inheritedLayoutMirror(false), effectiveLayoutMirror(false), isMirrorImplicit(true),
+ inheritMirrorFromParent(false), inheritMirrorFromItem(false), keyHandler(0),
+ mWidth(0), mHeight(0), mImplicitWidth(0), mImplicitHeight(0), attachedLayoutDirection(0), hadSubFocusItem(false)
{
QGraphicsItemPrivate::acceptedMouseButtons = 0;
isDeclarativeItem = 1;
@@ -134,7 +137,6 @@ public:
QGraphicsItem::ItemHasNoContents
| QGraphicsItem::ItemIsFocusable
| QGraphicsItem::ItemNegativeZStacksBehindParent);
-
}
void init(QDeclarativeItem *parent)
@@ -143,11 +145,17 @@ public:
if (parent) {
QDeclarative_setParent_noEvent(q, parent);
q->setParentItem(parent);
+ QDeclarativeItemPrivate *parentPrivate = QDeclarativeItemPrivate::get(parent);
+ setImplicitLayoutMirror(parentPrivate->inheritedLayoutMirror, parentPrivate->inheritMirrorFromParent);
}
baselineOffset.invalidate();
mouseSetsFocus = false;
}
+ bool isMirrored() const {
+ return effectiveLayoutMirror;
+ }
+
// Private Properties
qreal width() const;
void setWidth(qreal);
@@ -162,6 +170,10 @@ public:
virtual void implicitWidthChanged();
virtual void implicitHeightChanged();
+ void resolveLayoutMirror();
+ void setImplicitLayoutMirror(bool mirror, bool inherit);
+ void setLayoutMirror(bool mirror);
+
QDeclarativeListProperty<QObject> data();
QDeclarativeListProperty<QObject> resources();
@@ -272,6 +284,11 @@ public:
bool smooth:1;
bool transformOriginDirty : 1;
bool doneEventPreHandler : 1;
+ bool inheritedLayoutMirror:1;
+ bool effectiveLayoutMirror:1;
+ bool isMirrorImplicit:1;
+ bool inheritMirrorFromParent:1;
+ bool inheritMirrorFromItem:1;
QDeclarativeItemKeyFilter *keyHandler;
@@ -280,6 +297,8 @@ public:
qreal mImplicitWidth;
qreal mImplicitHeight;
+ QDeclarativeLayoutMirroringAttached* attachedLayoutDirection;
+
bool hadSubFocusItem;
QPointF computeTransformOrigin() const;
@@ -326,6 +345,8 @@ public:
virtual void focusChanged(bool);
+ virtual void mirrorChange() {};
+
static qint64 consistentTime;
static void setConsistentTime(qint64 t);
static void start(QElapsedTimer &);
@@ -423,6 +444,31 @@ private:
void setFocusNavigation(QDeclarativeItem *currentItem, const char *dir);
};
+class QDeclarativeLayoutMirroringAttached : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(bool enabled READ enabled WRITE setEnabled RESET resetEnabled NOTIFY enabledChanged)
+ Q_PROPERTY(bool childrenInherit READ childrenInherit WRITE setChildrenInherit NOTIFY childrenInheritChanged)
+
+public:
+ explicit QDeclarativeLayoutMirroringAttached(QObject *parent = 0);
+
+ bool enabled() const;
+ void setEnabled(bool);
+ void resetEnabled();
+
+ bool childrenInherit() const;
+ void setChildrenInherit(bool);
+
+ static QDeclarativeLayoutMirroringAttached *qmlAttachedProperties(QObject *);
+Q_SIGNALS:
+ void enabledChanged();
+ void childrenInheritChanged();
+private:
+ friend class QDeclarativeItemPrivate;
+ QDeclarativeItemPrivate *itemPrivate;
+};
+
class QDeclarativeKeysAttachedPrivate : public QObjectPrivate
{
public:
@@ -572,5 +618,7 @@ QML_DECLARE_TYPE(QDeclarativeKeysAttached)
QML_DECLARE_TYPEINFO(QDeclarativeKeysAttached, QML_HAS_ATTACHED_PROPERTIES)
QML_DECLARE_TYPE(QDeclarativeKeyNavigationAttached)
QML_DECLARE_TYPEINFO(QDeclarativeKeyNavigationAttached, QML_HAS_ATTACHED_PROPERTIES)
+QML_DECLARE_TYPE(QDeclarativeLayoutMirroringAttached)
+QML_DECLARE_TYPEINFO(QDeclarativeLayoutMirroringAttached, QML_HAS_ATTACHED_PROPERTIES)
#endif // QDECLARATIVEITEM_P_H
diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
index 3c8f64e..c4a9030 100644
--- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
@@ -198,6 +198,7 @@ void QDeclarativeItemModule::defineModule()
qmlRegisterRevision<QDeclarativeImplicitSizeItem,1>("QtQuick",1,1);
qmlRegisterRevision<QDeclarativeImplicitSizePaintedItem,0>("QtQuick",1,0);
qmlRegisterRevision<QDeclarativeImplicitSizePaintedItem,1>("QtQuick",1,1);
+ qmlRegisterUncreatableType<QDeclarativeLayoutMirroringAttached>("QtQuick",1,1,"LayoutMirroring", QDeclarativeLayoutMirroringAttached::tr("LayoutMirroring is only available via attached properties"));
#ifndef QT_NO_IMPORT_QT47_QML
#ifdef QT_NO_MOVIE
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 338cb58..6ae1ddc 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -100,13 +100,21 @@ public:
}
~FxListItem() {}
qreal position() const {
- if (section)
- return (view->orientation() == QDeclarativeListView::Vertical ? section->y() : section->x());
- else
- return (view->orientation() == QDeclarativeListView::Vertical ? item->y() : item->x());
+ if (section) {
+ if (view->orientation() == QDeclarativeListView::Vertical)
+ return section->y();
+ else
+ return (view->effectiveLayoutDirection() == Qt::RightToLeft ? -section->width()-section->x() : section->x());
+ } else {
+ return itemPosition();
+ }
}
+
qreal itemPosition() const {
- return (view->orientation() == QDeclarativeListView::Vertical ? item->y() : item->x());
+ if (view->orientation() == QDeclarativeListView::Vertical)
+ return item->y();
+ else
+ return (view->effectiveLayoutDirection() == Qt::RightToLeft ? -item->width()-item->x() : item->x());
}
qreal size() const {
if (section)
@@ -123,9 +131,13 @@ public:
return 0.0;
}
qreal endPosition() const {
- return (view->orientation() == QDeclarativeListView::Vertical
- ? item->y() + (item->height() >= 1.0 ? item->height() : 1)
- : item->x() + (item->width() >= 1.0 ? item->width() : 1)) - 1;
+ if (view->orientation() == QDeclarativeListView::Vertical) {
+ return item->y() + (item->height() >= 1.0 ? item->height() : 1) - 1;
+ } else {
+ return (view->effectiveLayoutDirection() == Qt::RightToLeft
+ ? -item->width()-item->x() + (item->width() >= 1.0 ? item->width() : 1)
+ : item->x() + (item->width() >= 1.0 ? item->width() : 1)) - 1;
+ }
}
void setPosition(qreal pos) {
if (view->orientation() == QDeclarativeListView::Vertical) {
@@ -135,11 +147,19 @@ public:
}
item->setY(pos);
} else {
- if (section) {
- section->setX(pos);
- pos += section->width();
+ if (view->effectiveLayoutDirection() == Qt::RightToLeft) {
+ if (section) {
+ section->setX(-section->width()-pos);
+ pos += section->width();
+ }
+ item->setX(-item->width()-pos);
+ } else {
+ if (section) {
+ section->setX(pos);
+ pos += section->width();
+ }
+ item->setX(pos);
}
- item->setX(pos);
}
}
void setSize(qreal size) {
@@ -168,10 +188,11 @@ class QDeclarativeListViewPrivate : public QDeclarativeFlickablePrivate
public:
QDeclarativeListViewPrivate()
- : currentItem(0), orient(QDeclarativeListView::Vertical)
+ : currentItem(0), orient(QDeclarativeListView::Vertical), layoutDirection(Qt::LeftToRight)
, visiblePos(0), visibleIndex(0)
, averageSize(100.0), currentIndex(-1), requestedIndex(-1)
, itemCount(0), highlightRangeStart(0), highlightRangeEnd(0)
+ , highlightRangeStartValid(false), highlightRangeEndValid(false)
, highlightComponent(0), highlight(0), trackedItem(0)
, moveReason(Other), buffer(0), highlightPosAnimator(0), highlightSizeAnimator(0)
, sectionCriteria(0), spacing(0.0)
@@ -204,7 +225,7 @@ public:
}
FxListItem *firstVisibleItem() const {
- const qreal pos = position();
+ const qreal pos = isRightToLeft() ? -position()-size() : position();
for (int i = 0; i < visibleItems.count(); ++i) {
FxListItem *item = visibleItems.at(i);
if (item->index != -1 && item->endPosition() > pos)
@@ -214,7 +235,7 @@ public:
}
FxListItem *nextVisibleItem() const {
- const qreal pos = position();
+ const qreal pos = isRightToLeft() ? -position()-size() : position();
bool foundFirst = false;
for (int i = 0; i < visibleItems.count(); ++i) {
FxListItem *item = visibleItems.at(i);
@@ -248,23 +269,65 @@ public:
return 0;
}
+ void regenerate() {
+ Q_Q(QDeclarativeListView);
+ if (q->isComponentComplete()) {
+ if (header) {
+ if (q->scene())
+ q->scene()->removeItem(header->item);
+ header->item->deleteLater();
+ delete header;
+ header = 0;
+ }
+ if (footer) {
+ if (q->scene())
+ q->scene()->removeItem(footer->item);
+ footer->item->deleteLater();
+ delete footer;
+ footer = 0;
+ }
+ updateHeader();
+ updateFooter();
+ clear();
+ setPosition(0);
+ q->refill();
+ updateCurrent(currentIndex);
+ }
+ }
+
+ void mirrorChange() {
+ Q_Q(QDeclarativeListView);
+ regenerate();
+ emit q->effectiveLayoutDirectionChanged();
+ }
+
+ bool isRightToLeft() const {
+ Q_Q(const QDeclarativeListView);
+ return orient == QDeclarativeListView::Horizontal && q->effectiveLayoutDirection() == Qt::RightToLeft;
+ }
+
qreal position() const {
Q_Q(const QDeclarativeListView);
return orient == QDeclarativeListView::Vertical ? q->contentY() : q->contentX();
}
+
void setPosition(qreal pos) {
Q_Q(QDeclarativeListView);
- if (orient == QDeclarativeListView::Vertical)
+ if (orient == QDeclarativeListView::Vertical) {
q->QDeclarativeFlickable::setContentY(pos);
- else
- q->QDeclarativeFlickable::setContentX(pos);
+ } else {
+ if (isRightToLeft())
+ q->QDeclarativeFlickable::setContentX(-pos-size());
+ else
+ q->QDeclarativeFlickable::setContentX(pos);
+ }
}
qreal size() const {
Q_Q(const QDeclarativeListView);
return orient == QDeclarativeListView::Vertical ? q->height() : q->width();
}
- qreal startPosition() const {
+ qreal originPosition() const {
qreal pos = 0;
if (!visibleItems.isEmpty()) {
pos = (*visibleItems.constBegin())->position();
@@ -274,7 +337,7 @@ public:
return pos;
}
- qreal endPosition() const {
+ qreal lastPosition() const {
qreal pos = 0;
if (!visibleItems.isEmpty()) {
int invisibleCount = visibleItems.count() - visibleIndex;
@@ -291,6 +354,14 @@ public:
return pos;
}
+ qreal startPosition() const {
+ return isRightToLeft() ? -lastPosition()-1 : originPosition();
+ }
+
+ qreal endPosition() const {
+ return isRightToLeft() ? -originPosition()-1 : lastPosition();
+ }
+
qreal positionAt(int modelIndex) const {
if (FxListItem *item = visibleItem(modelIndex))
return item->position();
@@ -312,6 +383,7 @@ public:
else
idx = visibleItems.at(idx)->index;
int count = modelIndex - idx - 1;
+
return (*(--visibleItems.constEnd()))->endPosition() + spacing + count * (averageSize + spacing) + 1;
}
}
@@ -368,7 +440,7 @@ public:
} else if (pos > endPos)
return endPos + qRound((pos - endPos) / averageSize) * averageSize;
}
- return qRound((pos - startPosition()) / averageSize) * averageSize + startPosition();
+ return qRound((pos - originPosition()) / averageSize) * averageSize + originPosition();
}
FxListItem *snapItemAt(qreal pos) {
@@ -484,6 +556,7 @@ public:
QHash<QDeclarativeItem*,int> unrequestedItems;
FxListItem *currentItem;
QDeclarativeListView::Orientation orient;
+ Qt::LayoutDirection layoutDirection;
qreal visiblePos;
int visibleIndex;
qreal averageSize;
@@ -492,6 +565,8 @@ public:
int itemCount;
qreal highlightRangeStart;
qreal highlightRangeEnd;
+ bool highlightRangeStartValid;
+ bool highlightRangeEndValid;
QDeclarativeComponent *highlightComponent;
FxListItem *highlight;
FxListItem *trackedItem;
@@ -669,7 +744,6 @@ void QDeclarativeListViewPrivate::refill(qreal from, qreal to, bool doBuffer)
if (visibleItems.at(i)->index != -1)
modelIndex = visibleItems.at(i)->index + 1;
}
-
bool changed = false;
FxListItem *item = 0;
qreal pos = itemEnd + 1;
@@ -815,8 +889,12 @@ void QDeclarativeListViewPrivate::updateUnrequestedPositions()
if (item->y() + item->height() > pos && item->y() < pos + q->height())
item->setY(positionAt(*it));
} else {
- if (item->x() + item->width() > pos && item->x() < pos + q->width())
- item->setX(positionAt(*it));
+ if (item->x() + item->width() > pos && item->x() < pos + q->width()) {
+ if (isRightToLeft())
+ item->setX(-positionAt(*it)-item->width());
+ else
+ item->setX(positionAt(*it));
+ }
}
}
}
@@ -907,7 +985,9 @@ void QDeclarativeListViewPrivate::updateHighlight()
createHighlight();
if (currentItem && autoHighlight && highlight && !movingHorizontally && !movingVertically) {
// auto-update highlight
- highlightPosAnimator->to = currentItem->itemPosition();
+ highlightPosAnimator->to = isRightToLeft()
+ ? -currentItem->itemPosition()-currentItem->itemSize()
+ : currentItem->itemPosition();
highlightSizeAnimator->to = currentItem->itemSize();
if (orient == QDeclarativeListView::Vertical) {
if (highlight->item->width() == 0)
@@ -942,7 +1022,7 @@ void QDeclarativeListViewPrivate::createSection(FxListItem *listItem)
} else {
QDeclarativeContext *context = new QDeclarativeContext(qmlContext(q));
context->setContextProperty(QLatin1String("section"), listItem->attached->m_section);
- QObject *nobj = sectionCriteria->delegate()->create(context);
+ QObject *nobj = sectionCriteria->delegate()->beginCreate(context);
if (nobj) {
QDeclarative_setParent_noEvent(context, nobj);
listItem->section = qobject_cast<QDeclarativeItem *>(nobj);
@@ -956,6 +1036,7 @@ void QDeclarativeListViewPrivate::createSection(FxListItem *listItem)
} else {
delete context;
}
+ sectionCriteria->delegate()->completeCreate();
}
listItem->setPosition(pos);
} else {
@@ -1124,7 +1205,7 @@ void QDeclarativeListViewPrivate::updateFooter()
}
if (footer) {
if (visibleItems.count()) {
- qreal endPos = endPosition() + 1;
+ qreal endPos = lastPosition() + 1;
if (lastVisibleIndex() == model->count()-1) {
footer->setPosition(endPos);
} else {
@@ -1164,7 +1245,7 @@ void QDeclarativeListViewPrivate::updateHeader()
}
if (header) {
if (visibleItems.count()) {
- qreal startPos = startPosition();
+ qreal startPos = originPosition();
if (visibleIndex == 0) {
header->setPosition(startPos - header->size());
} else {
@@ -1197,56 +1278,83 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
return;
correctFlick = false;
- int oldDuration = fixupDuration;
- fixupDuration = moveReason == Mouse ? fixupDuration : 0;
+ fixupMode = moveReason == Mouse ? fixupMode : Immediate;
+
+ qreal highlightStart;
+ qreal highlightEnd;
+ qreal viewPos;
+ if (isRightToLeft()) {
+ // Handle Right-To-Left exceptions
+ viewPos = -position()-size();
+ highlightStart = highlightRangeStartValid ? size() - highlightRangeEnd : highlightRangeStart;
+ highlightEnd = highlightRangeEndValid ? size() - highlightRangeStart : highlightRangeEnd;
+ } else {
+ viewPos = position();
+ highlightStart = highlightRangeStart;
+ highlightEnd = highlightRangeEnd;
+ }
- if (currentItem && haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange) {
+ if (currentItem && haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange
+ && moveReason != QDeclarativeListViewPrivate::SetIndex) {
updateHighlight();
qreal pos = currentItem->itemPosition();
- qreal viewPos = position();
- if (viewPos < pos + currentItem->itemSize() - highlightRangeEnd)
- viewPos = pos + currentItem->itemSize() - highlightRangeEnd;
- if (viewPos > pos - highlightRangeStart)
- viewPos = pos - highlightRangeStart;
+ if (viewPos < pos + currentItem->itemSize() - highlightEnd)
+ viewPos = pos + currentItem->itemSize() - highlightEnd;
+ if (viewPos > pos - highlightStart)
+ viewPos = pos - highlightStart;
+ if (isRightToLeft())
+ viewPos = -viewPos-size();
timeline.reset(data.move);
if (viewPos != position()) {
- if (fixupDuration)
+ if (fixupMode != Immediate) {
timeline.move(data.move, -viewPos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);
- else
+ data.fixingUp = true;
+ } else {
timeline.set(data.move, -viewPos);
+ }
}
vTime = timeline.time();
- } else if (snapMode != QDeclarativeListView::NoSnap) {
- FxListItem *topItem = snapItemAt(position()+highlightRangeStart);
- FxListItem *bottomItem = snapItemAt(position()+highlightRangeEnd);
+ } else if (snapMode != QDeclarativeListView::NoSnap && moveReason != QDeclarativeListViewPrivate::SetIndex) {
+ qreal tempPosition = isRightToLeft() ? -position()-size() : position();
+ FxListItem *topItem = snapItemAt(tempPosition+highlightStart);
+ FxListItem *bottomItem = snapItemAt(tempPosition+highlightEnd);
qreal pos;
- if (topItem) {
- if (topItem->index == 0 && header && position()+highlightRangeStart < header->position()+header->size()/2)
- pos = header->position() - highlightRangeStart;
+ bool isInBounds = -position() > maxExtent && -position() < minExtent;
+ if (topItem && isInBounds) {
+ if (topItem->index == 0 && header && tempPosition+highlightStart < header->position()+header->size()/2) {
+ pos = isRightToLeft() ? - header->position() + highlightStart - size() : header->position() - highlightStart;
+ } else {
+ if (isRightToLeft())
+ pos = qMax(qMin(-topItem->position() + highlightStart - size(), -maxExtent), -minExtent);
+ else
+ pos = qMax(qMin(topItem->position() - highlightStart, -maxExtent), -minExtent);
+ }
+ } else if (bottomItem && isInBounds) {
+ if (isRightToLeft())
+ pos = qMax(qMin(-bottomItem->position() + highlightStart - size(), -maxExtent), -minExtent);
else
- pos = qMax(qMin(topItem->position() - highlightRangeStart, -maxExtent), -minExtent);
- } else if (bottomItem) {
- pos = qMax(qMin(bottomItem->position() - highlightRangeStart, -maxExtent), -minExtent);
+ pos = qMax(qMin(bottomItem->position() - highlightStart, -maxExtent), -minExtent);
} else {
QDeclarativeFlickablePrivate::fixup(data, minExtent, maxExtent);
- fixupDuration = oldDuration;
return;
}
qreal dist = qAbs(data.move + pos);
if (dist > 0) {
timeline.reset(data.move);
- if (fixupDuration)
+ if (fixupMode != Immediate) {
timeline.move(data.move, -pos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);
- else
+ data.fixingUp = true;
+ } else {
timeline.set(data.move, -pos);
+ }
vTime = timeline.time();
}
} else {
QDeclarativeFlickablePrivate::fixup(data, minExtent, maxExtent);
}
- fixupDuration = oldDuration;
+ fixupMode = Normal;
}
void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize,
@@ -1254,6 +1362,7 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
{
Q_Q(QDeclarativeListView);
+ data.fixingUp = false;
moveReason = Mouse;
if ((!haveHighlightRange || highlightRange != QDeclarativeListView::StrictlyEnforceRange) && snapMode == QDeclarativeListView::NoSnap) {
correctFlick = true;
@@ -1261,12 +1370,13 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
return;
}
qreal maxDistance = 0;
+ qreal dataValue = isRightToLeft() ? -data.move.value()+size() : data.move.value();
// -ve velocity means list is moving up/left
if (velocity > 0) {
if (data.move.value() < minExtent) {
if (snapMode == QDeclarativeListView::SnapOneItem) {
- if (FxListItem *item = firstVisibleItem())
- maxDistance = qAbs(item->position() + data.move.value());
+ if (FxListItem *item = isRightToLeft() ? nextVisibleItem() : firstVisibleItem())
+ maxDistance = qAbs(item->position() + dataValue);
} else {
maxDistance = qAbs(minExtent - data.move.value());
}
@@ -1276,8 +1386,8 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
} else {
if (data.move.value() > maxExtent) {
if (snapMode == QDeclarativeListView::SnapOneItem) {
- if (FxListItem *item = nextVisibleItem())
- maxDistance = qAbs(item->position() + data.move.value());
+ if (FxListItem *item = isRightToLeft() ? firstVisibleItem() : nextVisibleItem())
+ maxDistance = qAbs(item->position() + dataValue);
} else {
maxDistance = qAbs(maxExtent - data.move.value());
}
@@ -1285,7 +1395,10 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
if (snapMode == QDeclarativeListView::NoSnap && highlightRange != QDeclarativeListView::StrictlyEnforceRange)
data.flickTarget = maxExtent;
}
+
bool overShoot = boundsBehavior == QDeclarativeFlickable::DragAndOvershootBounds;
+ qreal highlightStart = isRightToLeft() && highlightRangeStartValid ? size()-highlightRangeEnd : highlightRangeStart;
+
if (maxDistance > 0 || overShoot) {
// These modes require the list to stop exactly on an item boundary.
// The initial flick will estimate the boundary to stop on.
@@ -1310,7 +1423,9 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
if (v > 0)
dist = -dist;
if ((maxDistance > 0.0 && v2 / (2.0f * maxDistance) < accel) || snapMode == QDeclarativeListView::SnapOneItem) {
- data.flickTarget = -snapPosAt(-(data.move.value() - highlightRangeStart) + dist) + highlightRangeStart;
+ qreal distTemp = isRightToLeft() ? -dist : dist;
+ data.flickTarget = -snapPosAt(-(dataValue - highlightStart) + distTemp) + highlightStart;
+ data.flickTarget = isRightToLeft() ? -data.flickTarget+size() : data.flickTarget;
if (overShoot) {
if (data.flickTarget >= minExtent) {
overshootDist = overShootDistance(v, vSize);
@@ -1343,6 +1458,7 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
data.flickTarget -= overshootDist;
}
}
+
timeline.reset(data.move);
timeline.accel(data.move, v, accel, maxDistance + overshootDist);
timeline.callback(QDeclarativeTimeLineCallback(&data.move, fixupCallback, this));
@@ -1362,8 +1478,11 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
} else {
// reevaluate the target boundary.
qreal newtarget = data.flickTarget;
- if (snapMode != QDeclarativeListView::NoSnap || highlightRange == QDeclarativeListView::StrictlyEnforceRange)
- newtarget = -snapPosAt(-(data.flickTarget - highlightRangeStart)) + highlightRangeStart;
+ if (snapMode != QDeclarativeListView::NoSnap || highlightRange == QDeclarativeListView::StrictlyEnforceRange) {
+ qreal tempFlickTarget = isRightToLeft() ? -data.flickTarget+size() : data.flickTarget;
+ newtarget = -snapPosAt(-(tempFlickTarget - highlightStart)) + highlightStart;
+ newtarget = isRightToLeft() ? -newtarget+size() : newtarget;
+ }
if (velocity < 0 && newtarget <= maxExtent)
newtarget = maxExtent - overshootDist;
else if (velocity > 0 && newtarget >= minExtent)
@@ -1381,6 +1500,7 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
fixup(data, minExtent, maxExtent);
return;
}
+
timeline.reset(data.move);
timeline.accelDistance(data.move, v, -dist);
timeline.callback(QDeclarativeTimeLineCallback(&data.move, fixupCallback, this));
@@ -1879,6 +1999,7 @@ qreal QDeclarativeListView::preferredHighlightBegin() const
void QDeclarativeListView::setPreferredHighlightBegin(qreal start)
{
Q_D(QDeclarativeListView);
+ d->highlightRangeStartValid = true;
if (d->highlightRangeStart == start)
return;
d->highlightRangeStart = start;
@@ -1886,6 +2007,16 @@ void QDeclarativeListView::setPreferredHighlightBegin(qreal start)
emit preferredHighlightBeginChanged();
}
+void QDeclarativeListView::resetPreferredHighlightBegin()
+{
+ Q_D(QDeclarativeListView);
+ d->highlightRangeStartValid = false;
+ if (d->highlightRangeStart == 0)
+ return;
+ d->highlightRangeStart = 0;
+ emit preferredHighlightBeginChanged();
+}
+
qreal QDeclarativeListView::preferredHighlightEnd() const
{
Q_D(const QDeclarativeListView);
@@ -1895,6 +2026,7 @@ qreal QDeclarativeListView::preferredHighlightEnd() const
void QDeclarativeListView::setPreferredHighlightEnd(qreal end)
{
Q_D(QDeclarativeListView);
+ d->highlightRangeEndValid = true;
if (d->highlightRangeEnd == end)
return;
d->highlightRangeEnd = end;
@@ -1902,6 +2034,16 @@ void QDeclarativeListView::setPreferredHighlightEnd(qreal end)
emit preferredHighlightEndChanged();
}
+void QDeclarativeListView::resetPreferredHighlightEnd()
+{
+ Q_D(QDeclarativeListView);
+ d->highlightRangeEndValid = false;
+ if (d->highlightRangeEnd == 0)
+ return;
+ d->highlightRangeEnd = 0;
+ emit preferredHighlightEndChanged();
+}
+
QDeclarativeListView::HighlightRangeMode QDeclarativeListView::highlightRangeMode() const
{
Q_D(const QDeclarativeListView);
@@ -1980,15 +2122,63 @@ void QDeclarativeListView::setOrientation(QDeclarativeListView::Orientation orie
setContentHeight(-1);
setFlickableDirection(HorizontalFlick);
}
- d->clear();
- d->setPosition(0);
- refill();
+ d->regenerate();
emit orientationChanged();
- d->updateCurrent(d->currentIndex);
}
}
/*!
+ \qmlproperty enumeration ListView::layoutDirection
+ This property holds the layout direction of the horizontal list.
+
+ Possible values:
+
+ \list
+ \o Qt.LeftToRight (default) - Items will be laid out from left to right.
+ \o Qt.RightToLeft - Items will be laid out from right to let.
+ \endlist
+
+ \sa ListView::effectiveLayoutDirection
+*/
+
+Qt::LayoutDirection QDeclarativeListView::layoutDirection() const
+{
+ Q_D(const QDeclarativeListView);
+ return d->layoutDirection;
+}
+
+void QDeclarativeListView::setLayoutDirection(Qt::LayoutDirection layoutDirection)
+{
+ Q_D(QDeclarativeListView);
+ if (d->layoutDirection != layoutDirection) {
+ d->layoutDirection = layoutDirection;
+ d->regenerate();
+ emit layoutDirectionChanged();
+ emit effectiveLayoutDirectionChanged();
+ }
+}
+
+/*!
+ \qmlproperty enumeration ListView::effectiveLayoutDirection
+ This property holds the effective layout direction of the horizontal list.
+
+ When using the attached property \l {LayoutMirroring::enabled}{LayoutMirroring::enabled} for locale layouts,
+ the visual layout direction of the horizontal list will be mirrored. However, the
+ property \l {ListView::layoutDirection}{layoutDirection} will remain unchanged.
+
+ \sa ListView::layoutDirection, {LayoutMirroring}{LayoutMirroring}
+*/
+
+Qt::LayoutDirection QDeclarativeListView::effectiveLayoutDirection() const
+{
+ Q_D(const QDeclarativeListView);
+ if (d->effectiveLayoutMirror)
+ return d->layoutDirection == Qt::RightToLeft ? Qt::LeftToRight : Qt::RightToLeft;
+ else
+ return d->layoutDirection;
+}
+
+/*!
\qmlproperty bool ListView::keyNavigationWraps
This property holds whether the list wraps key navigation.
@@ -2359,11 +2549,23 @@ void QDeclarativeListView::viewportMoved()
if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange && d->highlight) {
// reposition highlight
qreal pos = d->highlight->position();
- qreal viewPos = d->position();
- if (pos > viewPos + d->highlightRangeEnd - d->highlight->size())
- pos = viewPos + d->highlightRangeEnd - d->highlight->size();
- if (pos < viewPos + d->highlightRangeStart)
- pos = viewPos + d->highlightRangeStart;
+ qreal viewPos;
+ qreal highlightStart;
+ qreal highlightEnd;
+ if (d->isRightToLeft()) {
+ // Handle Right-To-Left exceptions
+ viewPos = -d->position()-d->size();
+ highlightStart = d->highlightRangeStartValid ? d->size()-d->highlightRangeEnd : d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEndValid ? d->size()-d->highlightRangeStart : d->highlightRangeEnd;
+ } else {
+ viewPos = d->position();
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ }
+ if (pos > viewPos + highlightEnd - d->highlight->size())
+ pos = viewPos + highlightEnd - d->highlight->size();
+ if (pos < viewPos + highlightStart)
+ pos = viewPos + highlightStart;
d->highlightPosAnimator->stop();
d->highlight->setPosition(qRound(pos));
@@ -2401,13 +2603,15 @@ void QDeclarativeListView::viewportMoved()
if ((minX - d->hData.move.value() < width()/2 || d->hData.flickTarget - d->hData.move.value() < width()/2)
&& minX != d->hData.flickTarget)
d->flickX(-d->hData.smoothVelocity.value());
- d->bufferMode = QDeclarativeListViewPrivate::BufferBefore;
+ d->bufferMode = d->isRightToLeft()
+ ? QDeclarativeListViewPrivate::BufferAfter : QDeclarativeListViewPrivate::BufferBefore;
} else if (d->hData.velocity < 0) {
const qreal maxX = maxXExtent();
if ((d->hData.move.value() - maxX < width()/2 || d->hData.move.value() - d->hData.flickTarget < width()/2)
&& maxX != d->hData.flickTarget)
d->flickX(-d->hData.smoothVelocity.value());
- d->bufferMode = QDeclarativeListViewPrivate::BufferAfter;
+ d->bufferMode = d->isRightToLeft()
+ ? QDeclarativeListViewPrivate::BufferBefore : QDeclarativeListViewPrivate::BufferAfter;
}
}
d->inFlickCorrection = false;
@@ -2445,7 +2649,8 @@ qreal QDeclarativeListView::maxYExtent() const
return height();
if (d->maxExtentDirty) {
if (!d->model || !d->model->count()) {
- d->maxExtent = 0;
+ d->maxExtent = d->header ? -d->header->size() : 0;
+ d->maxExtent += height();
} else if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
d->maxExtent = -(d->positionAt(d->model->count()-1) - d->highlightRangeStart);
if (d->highlightRangeEnd != d->highlightRangeStart)
@@ -2470,11 +2675,34 @@ qreal QDeclarativeListView::minXExtent() const
return QDeclarativeFlickable::minXExtent();
if (d->minExtentDirty) {
d->minExtent = -d->startPosition();
- if (d->header)
- d->minExtent += d->header->size();
+
+ qreal highlightStart;
+ qreal highlightEnd;
+ qreal endPositionFirstItem = 0;
+ if (d->isRightToLeft()) {
+ if (d->model && d->model->count())
+ endPositionFirstItem = d->positionAt(d->model->count()-1);
+ else if (d->header)
+ d->minExtent += d->header->size();
+ highlightStart = d->highlightRangeStartValid
+ ? d->highlightRangeStart - (d->lastPosition()-endPositionFirstItem)
+ : d->size() - (d->lastPosition()-endPositionFirstItem);
+ highlightEnd = d->highlightRangeEndValid ? d->highlightRangeEnd : d->size();
+ if (d->footer)
+ d->minExtent += d->footer->size();
+ qreal maxX = maxXExtent();
+ if (d->minExtent < maxX)
+ d->minExtent = maxX;
+ } else {
+ endPositionFirstItem = d->endPositionAt(0);
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ if (d->header && d->visibleItems.count())
+ d->minExtent += d->header->size();
+ }
if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
- d->minExtent += d->highlightRangeStart;
- d->minExtent = qMax(d->minExtent, -(d->endPositionAt(0) - d->highlightRangeEnd + 1));
+ d->minExtent += highlightStart;
+ d->minExtent = qMax(d->minExtent, -(endPositionFirstItem - highlightEnd + 1));
}
d->minExtentDirty = false;
}
@@ -2488,23 +2716,46 @@ qreal QDeclarativeListView::maxXExtent() const
if (d->orient == QDeclarativeListView::Vertical)
return width();
if (d->maxExtentDirty) {
+ qreal highlightStart;
+ qreal highlightEnd;
+ qreal lastItemPosition = 0;
+ d->maxExtent = 0;
+ if (d->isRightToLeft()) {
+ highlightStart = d->highlightRangeStartValid ? d->highlightRangeEnd : d->size();
+ highlightEnd = d->highlightRangeEndValid ? d->highlightRangeStart : d->size();
+ lastItemPosition = d->endPosition();
+ } else {
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ if (d->model && d->model->count())
+ lastItemPosition = d->positionAt(d->model->count()-1);
+ }
if (!d->model || !d->model->count()) {
- d->maxExtent = 0;
+ if (!d->isRightToLeft())
+ d->maxExtent = d->header ? -d->header->size() : 0;
+ d->maxExtent += width();
} else if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
- d->maxExtent = -(d->positionAt(d->model->count()-1) - d->highlightRangeStart);
- if (d->highlightRangeEnd != d->highlightRangeStart)
- d->maxExtent = qMin(d->maxExtent, -(d->endPosition() - d->highlightRangeEnd + 1));
+ d->maxExtent = -(lastItemPosition - highlightStart);
+ if (highlightEnd != highlightStart) {
+ d->maxExtent = d->isRightToLeft()
+ ? qMax(d->maxExtent, -(d->endPosition() - highlightEnd + 1))
+ : qMin(d->maxExtent, -(d->endPosition() - highlightEnd + 1));
+ }
} else {
d->maxExtent = -(d->endPosition() - width() + 1);
}
- if (d->footer)
- d->maxExtent -= d->footer->size();
- qreal minX = minXExtent();
- if (d->maxExtent > minX)
- d->maxExtent = minX;
+ if (d->isRightToLeft()) {
+ if (d->header && d->visibleItems.count())
+ d->maxExtent -= d->header->size();
+ } else {
+ if (d->footer)
+ d->maxExtent -= d->footer->size();
+ qreal minX = minXExtent();
+ if (d->maxExtent > minX)
+ d->maxExtent = minX;
+ }
d->maxExtentDirty = false;
}
-
return d->maxExtent;
}
@@ -2516,7 +2767,8 @@ void QDeclarativeListView::keyPressEvent(QKeyEvent *event)
return;
if (d->model && d->model->count() && d->interactive) {
- if ((d->orient == QDeclarativeListView::Horizontal && event->key() == Qt::Key_Left)
+ if ((!d->isRightToLeft() && event->key() == Qt::Key_Left)
+ || (d->orient == QDeclarativeListView::Horizontal && d->isRightToLeft() && event->key() == Qt::Key_Right)
|| (d->orient == QDeclarativeListView::Vertical && event->key() == Qt::Key_Up)) {
if (currentIndex() > 0 || (d->wrap && !event->isAutoRepeat())) {
decrementCurrentIndex();
@@ -2526,7 +2778,8 @@ void QDeclarativeListView::keyPressEvent(QKeyEvent *event)
event->accept();
return;
}
- } else if ((d->orient == QDeclarativeListView::Horizontal && event->key() == Qt::Key_Right)
+ } else if ((!d->isRightToLeft() && event->key() == Qt::Key_Right)
+ || (d->orient == QDeclarativeListView::Horizontal && d->isRightToLeft() && event->key() == Qt::Key_Left)
|| (d->orient == QDeclarativeListView::Vertical && event->key() == Qt::Key_Down)) {
if (currentIndex() < d->model->count() - 1 || (d->wrap && !event->isAutoRepeat())) {
incrementCurrentIndex();
@@ -2548,6 +2801,11 @@ void QDeclarativeListView::geometryChanged(const QRectF &newGeometry,
Q_D(QDeclarativeListView);
d->maxExtentDirty = true;
d->minExtentDirty = true;
+ if (d->isRightToLeft() && d->orient == Qt::Horizontal) {
+ // maintain position relative to the right edge
+ int dx = newGeometry.width() - oldGeometry.width();
+ setContentX(contentX() - dx);
+ }
QDeclarativeFlickable::geometryChanged(newGeometry, oldGeometry);
}
@@ -2603,9 +2861,14 @@ void QDeclarativeListViewPrivate::positionViewAtIndex(int index, int mode)
if (layoutScheduled)
layout();
- qreal pos = position();
+ qreal pos = isRightToLeft() ? -position() - size() : position();
FxListItem *item = visibleItem(idx);
- qreal maxExtent = orient == QDeclarativeListView::Vertical ? -q->maxYExtent() : -q->maxXExtent();
+ qreal maxExtent;
+ if (orient == QDeclarativeListView::Vertical)
+ maxExtent = -q->maxYExtent();
+ else
+ maxExtent = isRightToLeft() ? q->minXExtent()-size(): -q->maxXExtent();
+
if (!item) {
int itemPos = positionAt(idx);
// save the currently visible items in case any of them end up visible again
@@ -2648,7 +2911,12 @@ void QDeclarativeListViewPrivate::positionViewAtIndex(int index, int mode)
pos = itemPos;
}
pos = qMin(pos, maxExtent);
- qreal minExtent = orient == QDeclarativeListView::Vertical ? -q->minYExtent() : -q->minXExtent();
+ qreal minExtent;
+ if (orient == QDeclarativeListView::Vertical) {
+ minExtent = -q->minYExtent();
+ } else {
+ minExtent = isRightToLeft() ? q->maxXExtent()-size(): -q->minXExtent();
+ }
pos = qMax(pos, minExtent);
moveReason = QDeclarativeListViewPrivate::Other;
q->cancelFlick();
@@ -2708,6 +2976,7 @@ void QDeclarativeListView::positionViewAtIndex(int index, int mode)
/*!
\qmlmethod ListView::positionViewAtBeginning()
\qmlmethod ListView::positionViewAtEnd()
+ \since Quick 1.1
Positions the view at the beginning or end, taking into account any header or footer.
@@ -2797,13 +3066,18 @@ void QDeclarativeListView::updateSections()
roles << d->sectionCriteria->property().toUtf8();
d->model->setWatchedRoles(roles);
d->updateSections();
+ if (d->itemCount)
+ d->layout();
}
}
void QDeclarativeListView::refill()
{
Q_D(QDeclarativeListView);
- d->refill(d->position(), d->position()+d->size()-1);
+ if (d->isRightToLeft())
+ d->refill(-d->position()-d->size()+1, -d->position());
+ else
+ d->refill(d->position(), d->position()+d->size()-1);
}
void QDeclarativeListView::trackedPositionChanged()
@@ -2818,26 +3092,37 @@ void QDeclarativeListView::trackedPositionChanged()
trackedPos -= d->currentItem->sectionSize();
trackedSize += d->currentItem->sectionSize();
}
- const qreal viewPos = d->position();
+ qreal viewPos;
+ qreal highlightStart;
+ qreal highlightEnd;
+ if (d->isRightToLeft()) {
+ viewPos = -d->position()-d->size();
+ highlightStart = d->highlightRangeStartValid ? d->size()-d->highlightRangeEnd : d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEndValid ? d->size()-d->highlightRangeStart : d->highlightRangeEnd;
+ } else {
+ viewPos = d->position();
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ }
qreal pos = viewPos;
if (d->haveHighlightRange) {
if (d->highlightRange == StrictlyEnforceRange) {
- if (trackedPos > pos + d->highlightRangeEnd - d->trackedItem->size())
- pos = trackedPos - d->highlightRangeEnd + d->trackedItem->size();
- if (trackedPos < pos + d->highlightRangeStart)
- pos = trackedPos - d->highlightRangeStart;
+ if (trackedPos > pos + highlightEnd - d->trackedItem->size())
+ pos = trackedPos - highlightEnd + d->trackedItem->size();
+ if (trackedPos < pos + highlightStart)
+ pos = trackedPos - highlightStart;
} else {
- if (trackedPos < d->startPosition() + d->highlightRangeStart) {
+ if (trackedPos < d->startPosition() + highlightStart) {
pos = d->startPosition();
- } else if (d->trackedItem->endPosition() > d->endPosition() - d->size() + d->highlightRangeEnd) {
+ } else if (d->trackedItem->endPosition() > d->endPosition() - d->size() + highlightEnd) {
pos = d->endPosition() - d->size() + 1;
if (pos < d->startPosition())
pos = d->startPosition();
} else {
- if (trackedPos < viewPos + d->highlightRangeStart) {
- pos = trackedPos - d->highlightRangeStart;
- } else if (trackedPos > viewPos + d->highlightRangeEnd - trackedSize) {
- pos = trackedPos - d->highlightRangeEnd + trackedSize;
+ if (trackedPos < viewPos + highlightStart) {
+ pos = trackedPos - highlightStart;
+ } else if (trackedPos > viewPos + highlightEnd - trackedSize) {
+ pos = trackedPos - highlightEnd + trackedSize;
}
}
}
@@ -2874,7 +3159,9 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
d->updateUnrequestedIndexes();
d->moveReason = QDeclarativeListViewPrivate::Other;
+ qreal tempPos = d->isRightToLeft() ? -d->position()-d->size() : d->position();
int index = d->visibleItems.count() ? d->mapFromModel(modelIndex) : 0;
+
if (index < 0) {
int i = d->visibleItems.count() - 1;
while (i > 0 && d->visibleItems.at(i)->index == -1)
@@ -2883,7 +3170,7 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
// there are no visible items except items marked for removal
index = d->visibleItems.count();
} else if (d->visibleItems.at(i)->index + 1 == modelIndex
- && d->visibleItems.at(i)->endPosition() < d->buffer+d->position()+d->size()-1) {
+ && d->visibleItems.at(i)->endPosition() < d->buffer+tempPos+d->size()-1) {
// Special case of appending an item to the model.
index = d->visibleItems.count();
} else {
@@ -2928,7 +3215,7 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
// Insert items before the visible item.
int insertionIdx = index;
int i = 0;
- int from = d->position() - d->buffer;
+ int from = tempPos - d->buffer;
for (i = count-1; i >= 0 && pos > from; --i) {
if (!addedVisible) {
d->scheduleLayout();
@@ -2958,7 +3245,7 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
}
} else {
int i = 0;
- int to = d->buffer+d->position()+d->size()-1;
+ int to = d->buffer+tempPos+d->size()-1;
for (i = 0; i < count && pos <= to; ++i) {
if (!addedVisible) {
d->scheduleLayout();
@@ -2985,10 +3272,10 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
if (d->currentItem) {
d->currentItem->index = d->currentIndex;
d->currentItem->setPosition(d->currentItem->position() + diff);
- } else if (!d->currentIndex || (d->currentIndex < 0 && !d->currentIndexCleared)) {
- d->updateCurrent(0);
}
emit currentIndexChanged();
+ } else if (!d->itemCount && (!d->currentIndex || (d->currentIndex < 0 && !d->currentIndexCleared))) {
+ d->updateCurrent(0);
}
// Update the indexes of the following visible items.
for (; index < d->visibleItems.count(); ++index) {
@@ -3069,6 +3356,8 @@ void QDeclarativeListView::itemsRemoved(int modelIndex, int count)
d->currentIndex = -1;
if (d->itemCount)
d->updateCurrent(qMin(modelIndex, d->itemCount-1));
+ else
+ emit currentIndexChanged();
}
// update visibleIndex
@@ -3234,11 +3523,8 @@ void QDeclarativeListView::itemsChanged(int, int)
void QDeclarativeListView::modelReset()
{
Q_D(QDeclarativeListView);
- d->clear();
- d->setPosition(0);
- refill();
d->moveReason = QDeclarativeListViewPrivate::SetIndex;
- d->updateCurrent(d->currentIndex);
+ d->regenerate();
if (d->highlight && d->currentItem) {
if (d->autoHighlight)
d->highlight->setPosition(d->currentItem->position());
@@ -3254,10 +3540,14 @@ void QDeclarativeListView::createdItem(int index, QDeclarativeItem *item)
if (d->requestedIndex != index) {
item->setParentItem(contentItem());
d->unrequestedItems.insert(item, index);
- if (d->orient == QDeclarativeListView::Vertical)
+ if (d->orient == QDeclarativeListView::Vertical) {
item->setY(d->positionAt(index));
- else
- item->setX(d->positionAt(index));
+ } else {
+ if (d->isRightToLeft())
+ item->setX(-d->positionAt(index)-item->width());
+ else
+ item->setX(d->positionAt(index));
+ }
}
}
diff --git a/src/declarative/graphicsitems/qdeclarativelistview_p.h b/src/declarative/graphicsitems/qdeclarativelistview_p.h
index 265f4bd..3b12225 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview_p.h
+++ b/src/declarative/graphicsitems/qdeclarativelistview_p.h
@@ -107,12 +107,14 @@ class Q_AUTOTEST_EXPORT QDeclarativeListView : public QDeclarativeFlickable
Q_PROPERTY(qreal highlightResizeSpeed READ highlightResizeSpeed WRITE setHighlightResizeSpeed NOTIFY highlightResizeSpeedChanged)
Q_PROPERTY(int highlightResizeDuration READ highlightResizeDuration WRITE setHighlightResizeDuration NOTIFY highlightResizeDurationChanged)
- Q_PROPERTY(qreal preferredHighlightBegin READ preferredHighlightBegin WRITE setPreferredHighlightBegin NOTIFY preferredHighlightBeginChanged)
- Q_PROPERTY(qreal preferredHighlightEnd READ preferredHighlightEnd WRITE setPreferredHighlightEnd NOTIFY preferredHighlightEndChanged)
+ Q_PROPERTY(qreal preferredHighlightBegin READ preferredHighlightBegin WRITE setPreferredHighlightBegin NOTIFY preferredHighlightBeginChanged RESET resetPreferredHighlightBegin)
+ Q_PROPERTY(qreal preferredHighlightEnd READ preferredHighlightEnd WRITE setPreferredHighlightEnd NOTIFY preferredHighlightEndChanged RESET resetPreferredHighlightEnd)
Q_PROPERTY(HighlightRangeMode highlightRangeMode READ highlightRangeMode WRITE setHighlightRangeMode NOTIFY highlightRangeModeChanged)
Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing NOTIFY spacingChanged)
Q_PROPERTY(Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged)
+ Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1)
+ Q_PROPERTY(Qt::LayoutDirection effectiveLayoutDirection READ effectiveLayoutDirection NOTIFY effectiveLayoutDirectionChanged REVISION 1)
Q_PROPERTY(bool keyNavigationWraps READ isWrapEnabled WRITE setWrapEnabled NOTIFY keyNavigationWrapsChanged)
Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer NOTIFY cacheBufferChanged)
Q_PROPERTY(QDeclarativeViewSection *section READ sectionCriteria CONSTANT)
@@ -158,9 +160,11 @@ public:
qreal preferredHighlightBegin() const;
void setPreferredHighlightBegin(qreal);
+ void resetPreferredHighlightBegin();
qreal preferredHighlightEnd() const;
void setPreferredHighlightEnd(qreal);
+ void resetPreferredHighlightEnd();
qreal spacing() const;
void setSpacing(qreal spacing);
@@ -169,6 +173,10 @@ public:
Orientation orientation() const;
void setOrientation(Orientation);
+ Qt::LayoutDirection layoutDirection() const;
+ void setLayoutDirection(Qt::LayoutDirection);
+ Qt::LayoutDirection effectiveLayoutDirection() const;
+
bool isWrapEnabled() const;
void setWrapEnabled(bool);
@@ -220,6 +228,8 @@ Q_SIGNALS:
void countChanged();
void spacingChanged();
void orientationChanged();
+ Q_REVISION(1) void layoutDirectionChanged();
+ Q_REVISION(1) void effectiveLayoutDirectionChanged();
void currentIndexChanged();
void currentSectionChanged();
void highlightMoveSpeedChanged();
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp
index 4e401e9..778b8b9 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp
@@ -796,6 +796,7 @@ void QDeclarativePathView::setPreferredHighlightBegin(qreal start)
return;
d->highlightRangeStart = start;
d->haveHighlightRange = d->highlightRangeMode != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd;
+ refill();
emit preferredHighlightBeginChanged();
}
@@ -812,6 +813,7 @@ void QDeclarativePathView::setPreferredHighlightEnd(qreal end)
return;
d->highlightRangeEnd = end;
d->haveHighlightRange = d->highlightRangeMode != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd;
+ refill();
emit preferredHighlightEndChanged();
}
diff --git a/src/declarative/graphicsitems/qdeclarativepincharea.cpp b/src/declarative/graphicsitems/qdeclarativepincharea.cpp
index eae83f6..9bc3d8d 100644
--- a/src/declarative/graphicsitems/qdeclarativepincharea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepincharea.cpp
@@ -300,9 +300,8 @@ void QDeclarativePinchArea::updatePinch()
d->stealMouse = false;
setKeepMouseGrab(false);
d->inPinch = false;
- const qreal rotationAngle = d->pinchStartAngle - d->pinchLastAngle;
QPointF pinchCenter = mapFromScene(d->sceneLastCenter);
- QDeclarativePinchEvent pe(pinchCenter, d->pinchLastScale, d->pinchLastAngle, rotationAngle);
+ QDeclarativePinchEvent pe(pinchCenter, d->pinchLastScale, d->pinchLastAngle, d->pinchRotation);
pe.setStartCenter(d->pinchStartCenter);
pe.setPreviousCenter(pinchCenter);
pe.setPreviousAngle(d->pinchLastAngle);
@@ -349,6 +348,7 @@ void QDeclarativePinchArea::updatePinch()
d->pinchStartAngle = angle;
d->pinchLastScale = 1.0;
d->pinchLastAngle = angle;
+ d->pinchRotation = 0.0;
d->lastPoint1 = d->touchPoints.at(0).pos();
d->lastPoint2 = d->touchPoints.at(1).pos();
QDeclarativePinchEvent pe(d->pinchStartCenter, 1.0, angle, 0.0);
@@ -380,11 +380,14 @@ void QDeclarativePinchArea::updatePinch()
}
} else if (d->pinchStartDist > 0) {
qreal scale = dist / d->pinchStartDist;
- qreal rotationAngle = d->pinchStartAngle - angle;
- if (rotationAngle > 180)
- rotationAngle -= 360;
+ qreal da = d->pinchLastAngle - angle;
+ if (da > 180)
+ da -= 360;
+ else if (da < -180)
+ da += 360;
+ d->pinchRotation += da;
QPointF pinchCenter = mapFromScene(sceneCenter);
- QDeclarativePinchEvent pe(pinchCenter, scale, angle, rotationAngle);
+ QDeclarativePinchEvent pe(pinchCenter, scale, angle, d->pinchRotation);
pe.setStartCenter(d->pinchStartCenter);
pe.setPreviousCenter(mapFromScene(d->sceneLastCenter));
pe.setPreviousAngle(d->pinchLastAngle);
@@ -422,7 +425,7 @@ void QDeclarativePinchArea::updatePinch()
}
if (d->pinchStartRotation >= pinch()->minimumRotation()
&& d->pinchStartRotation <= pinch()->maximumRotation()) {
- qreal r = rotationAngle + d->pinchStartRotation;
+ qreal r = d->pinchRotation + d->pinchStartRotation;
r = qMin(qMax(pinch()->minimumRotation(),r), pinch()->maximumRotation());
pinch()->target()->setRotation(r);
}
diff --git a/src/declarative/graphicsitems/qdeclarativepincharea_p_p.h b/src/declarative/graphicsitems/qdeclarativepincharea_p_p.h
index 5641e35..cd5cf2a 100644
--- a/src/declarative/graphicsitems/qdeclarativepincharea_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepincharea_p_p.h
@@ -68,7 +68,9 @@ class QDeclarativePinchAreaPrivate : public QDeclarativeItemPrivate
public:
QDeclarativePinchAreaPrivate()
: absorb(true), stealMouse(false), inPinch(false)
- , pinchRejected(false), pinch(0), pinchStartDist(0)
+ , pinchRejected(false), pinch(0), pinchStartDist(0), pinchStartScale(1.0)
+ , pinchLastScale(1.0), pinchStartRotation(0.0), pinchStartAngle(0.0)
+ , pinchLastAngle(0.0), pinchRotation(0.0)
{
}
@@ -97,6 +99,7 @@ public:
qreal pinchStartRotation;
qreal pinchStartAngle;
qreal pinchLastAngle;
+ qreal pinchRotation;
QPointF sceneStartCenter;
QPointF pinchStartCenter;
QPointF sceneLastCenter;
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
index 27a1301..8a9bdb3 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
@@ -385,7 +385,7 @@ void QDeclarativeBasePositioner::finishApplyTransitions()
Items with a width or height of 0 will not be positioned.
- \sa Row, Grid, Flow, {declarative/positioners/addandremove}{Positioners example}
+ \sa Row, Grid, Flow, {declarative/positioners}{Positioners example}
*/
/*!
\qmlproperty Transition Column::add
@@ -425,7 +425,7 @@ void QDeclarativeBasePositioner::finishApplyTransitions()
}
\endqml
- \sa add, {declarative/positioners/addandremove}{Positioners example}
+ \sa add, {declarative/positioners}{Positioners example}
*/
/*!
\qmlproperty int Column::spacing
@@ -528,7 +528,7 @@ void QDeclarativeColumn::reportConflictingAnchors()
Items with a width or height of 0 will not be positioned.
- \sa Column, Grid, Flow, {declarative/positioners/addandremove}{Positioners example}
+ \sa Column, Grid, Flow, {declarative/positioners}{Positioners example}
*/
/*!
\qmlproperty Transition Row::add
@@ -567,7 +567,7 @@ void QDeclarativeColumn::reportConflictingAnchors()
}
\endqml
- \sa add, {declarative/positioners/addandremove}{Positioners example}
+ \sa add, {declarative/positioners}{Positioners example}
*/
/*!
\qmlproperty int Row::spacing
@@ -578,12 +578,14 @@ void QDeclarativeColumn::reportConflictingAnchors()
\sa Grid::spacing
*/
QDeclarativeRow::QDeclarativeRow(QDeclarativeItem *parent)
-: QDeclarativeBasePositioner(Horizontal, parent), m_layoutDirection(Qt::LeftToRight)
+: QDeclarativeBasePositioner(Horizontal, parent)
{
}
/*!
\qmlproperty enumeration Row::layoutDirection
+ \since Quick 1.1
+
This property holds the layoutDirection of the row.
Possible values:
@@ -595,24 +597,43 @@ QDeclarativeRow::QDeclarativeRow(QDeclarativeItem *parent)
the right anchor remains to the right of the row.
\endlist
- \sa Grid::layoutDirection, Flow::layoutDirection, {declarative/positioners/layoutdirection}{Layout directions example}
+ \sa Grid::layoutDirection, Flow::layoutDirection, {declarative/righttoleft/layoutdirection}{Layout directions example}
*/
Qt::LayoutDirection QDeclarativeRow::layoutDirection() const
{
- return m_layoutDirection;
+ return QDeclarativeBasePositionerPrivate::getLayoutDirection(this);
}
void QDeclarativeRow::setLayoutDirection(Qt::LayoutDirection layoutDirection)
{
- if (m_layoutDirection != layoutDirection) {
- m_layoutDirection = layoutDirection;
+ QDeclarativeBasePositionerPrivate *d = static_cast<QDeclarativeBasePositionerPrivate* >(QDeclarativeBasePositionerPrivate::get(this));
+ if (d->layoutDirection != layoutDirection) {
+ d->layoutDirection = layoutDirection;
prePositioning();
emit layoutDirectionChanged();
+ emit effectiveLayoutDirectionChanged();
}
}
+/*!
+ \qmlproperty enumeration Row::effectiveLayoutDirection
+ This property holds the effective layout direction of the row positioner.
+
+ When using the attached property \l {LayoutMirroring::enabled}{LayoutMirroring::enabled} for locale layouts,
+ the visual layout direction of the row positioner will be mirrored. However, the
+ property \l {Row::layoutDirection}{layoutDirection} will remain unchanged.
+
+ \sa Row::layoutDirection, {LayoutMirroring}{LayoutMirroring}
+*/
+
+Qt::LayoutDirection QDeclarativeRow::effectiveLayoutDirection() const
+{
+ return QDeclarativeBasePositionerPrivate::getEffectiveLayoutDirection(this);
+}
+
void QDeclarativeRow::doPositioning(QSizeF *contentSize)
{
+ QDeclarativeBasePositionerPrivate *d = static_cast<QDeclarativeBasePositionerPrivate*>(QDeclarativeBasePositionerPrivate::get(this));
int hoffset = 0;
QList<int> hoffsets;
@@ -621,7 +642,7 @@ void QDeclarativeRow::doPositioning(QSizeF *contentSize)
if (!child.item || !child.isVisible)
continue;
- if(m_layoutDirection == Qt::LeftToRight){
+ if(d->isLeftToRight()){
if(child.item->x() != hoffset)
positionX(hoffset, child);
}else{
@@ -636,7 +657,7 @@ void QDeclarativeRow::doPositioning(QSizeF *contentSize)
contentSize->setWidth(hoffset - spacing());
- if(m_layoutDirection == Qt::LeftToRight)
+ if(d->isLeftToRight())
return;
//Right to Left layout
@@ -732,7 +753,7 @@ void QDeclarativeRow::reportConflictingAnchors()
Items with a width or height of 0 will not be positioned.
- \sa Flow, Row, Column, {declarative/positioners/addandremove}{Positioners example}
+ \sa Flow, Row, Column, {declarative/positioners}{Positioners example}
*/
/*!
\qmlproperty Transition Grid::add
@@ -770,7 +791,7 @@ void QDeclarativeRow::reportConflictingAnchors()
}
\endqml
- \sa add, {declarative/positioners/addandremove}{Positioners example}
+ \sa add, {declarative/positioners}{Positioners example}
*/
/*!
\qmlproperty int Grid::spacing
@@ -790,7 +811,7 @@ void QDeclarativeRow::reportConflictingAnchors()
\sa rows, columns
*/
QDeclarativeGrid::QDeclarativeGrid(QDeclarativeItem *parent) :
- QDeclarativeBasePositioner(Both, parent), m_rows(-1), m_columns(-1), m_flow(LeftToRight), m_layoutDirection(Qt::LeftToRight)
+ QDeclarativeBasePositioner(Both, parent), m_rows(-1), m_columns(-1), m_flow(LeftToRight)
{
}
@@ -859,38 +880,58 @@ void QDeclarativeGrid::setFlow(Flow flow)
/*!
\qmlproperty enumeration Grid::layoutDirection
+ \since Quick 1.1
+
This property holds the layout direction of the layout.
Possible values are:
\list
- \o Qt.LeftToRight (default) - Items are positioned beginning
- from the top, left anchor. The flow direction is dependent
- on the \l Grid::flow property.
- \o Qt.RightToLeft - Items are positioned beginning from the
- top, right anchor. The flow direction is dependent on the
+ \o Qt.LeftToRight (default) - Items are positioned from the top to bottom,
+ and left to right. The flow direction is dependent on the
+ \l Grid::flow property.
+ \o Qt.RightToLeft - Items are positioned from the top to bottom,
+ and right to left. The flow direction is dependent on the
\l Grid::flow property.
\endlist
- \sa Flow::layoutDirection, Row::layoutDirection, {declarative/positioners/layoutdirection}{Layout directions example}
+ \sa Flow::layoutDirection, Row::layoutDirection, {declarative/righttoleft/layoutdirection}{Layout directions example}
*/
Qt::LayoutDirection QDeclarativeGrid::layoutDirection() const
{
- return m_layoutDirection;
+ return QDeclarativeBasePositionerPrivate::getLayoutDirection(this);
}
void QDeclarativeGrid::setLayoutDirection(Qt::LayoutDirection layoutDirection)
{
- if (m_layoutDirection != layoutDirection) {
- m_layoutDirection = layoutDirection;
+ QDeclarativeBasePositionerPrivate *d = static_cast<QDeclarativeBasePositionerPrivate*>(QDeclarativeBasePositionerPrivate::get(this));
+ if (d->layoutDirection != layoutDirection) {
+ d->layoutDirection = layoutDirection;
prePositioning();
emit layoutDirectionChanged();
+ emit effectiveLayoutDirectionChanged();
}
}
-void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
+/*!
+ \qmlproperty enumeration Grid::effectiveLayoutDirection
+ This property holds the effective layout direction of the grid positioner.
+
+ When using the attached property \l {LayoutMirroring::enabled}{LayoutMirroring::enabled} for locale layouts,
+ the visual layout direction of the grid positioner will be mirrored. However, the
+ property \l {Grid::layoutDirection}{layoutDirection} will remain unchanged.
+
+ \sa Grid::layoutDirection, {LayoutMirroring}{LayoutMirroring}
+*/
+
+Qt::LayoutDirection QDeclarativeGrid::effectiveLayoutDirection() const
{
+ return QDeclarativeBasePositionerPrivate::getEffectiveLayoutDirection(this);
+}
+void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
+{
+ QDeclarativeBasePositionerPrivate *d = static_cast<QDeclarativeBasePositionerPrivate*>(QDeclarativeBasePositionerPrivate::get(this));
int c = m_columns;
int r = m_rows;
//Is allocating the extra QPODVector too much overhead?
@@ -980,7 +1021,7 @@ void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
end = widthSum;
int xoffset=0;
- if(m_layoutDirection == Qt::RightToLeft)
+ if(!d->isLeftToRight())
xoffset=end;
int yoffset=0;
int curRow =0;
@@ -988,7 +1029,7 @@ void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
for (int i = 0; i < visibleItems.count(); ++i) {
const PositionedItem &child = visibleItems.at(i);
int childXOffset = xoffset;
- if(m_layoutDirection == Qt::RightToLeft)
+ if(!d->isLeftToRight())
childXOffset -= QGraphicsItemPrivate::get(child.item)->width();
if((child.item->x()!=childXOffset)||(child.item->y()!=yoffset)){
positionX(childXOffset, child);
@@ -996,7 +1037,7 @@ void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
}
if (m_flow == LeftToRight) {
- if(m_layoutDirection == Qt::LeftToRight)
+ if(d->isLeftToRight())
xoffset+=maxColWidth[curCol]+spacing();
else
xoffset-=maxColWidth[curCol]+spacing();
@@ -1004,7 +1045,7 @@ void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
curCol%=c;
if (!curCol){
yoffset+=maxRowHeight[curRow]+spacing();
- if(m_layoutDirection == Qt::LeftToRight)
+ if(d->isLeftToRight())
xoffset=0;
else
xoffset=end;
@@ -1017,7 +1058,7 @@ void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
curRow++;
curRow%=r;
if (!curRow){
- if(m_layoutDirection == Qt::LeftToRight)
+ if(d->isLeftToRight())
xoffset+=maxColWidth[curCol]+spacing();
else
xoffset-=maxColWidth[curCol]+spacing();
@@ -1096,7 +1137,7 @@ void QDeclarativeGrid::reportConflictingAnchors()
Items with a width or height of 0 will not be positioned.
- \sa Column, Row, Grid, {declarative/positioners/addandremove}{Positioners example}
+ \sa Column, Row, Grid, {declarative/positioners}{Positioners example}
*/
/*!
\qmlproperty Transition Flow::add
@@ -1135,7 +1176,7 @@ void QDeclarativeGrid::reportConflictingAnchors()
}
\endqml
- \sa add, {declarative/positioners/addandremove}{Positioners example}
+ \sa add, {declarative/positioners}{Positioners example}
*/
/*!
\qmlproperty int Flow::spacing
@@ -1152,12 +1193,10 @@ class QDeclarativeFlowPrivate : public QDeclarativeBasePositionerPrivate
public:
QDeclarativeFlowPrivate()
- : QDeclarativeBasePositionerPrivate(), flow(QDeclarativeFlow::LeftToRight),
- layoutDirection(Qt::LeftToRight)
+ : QDeclarativeBasePositionerPrivate(), flow(QDeclarativeFlow::LeftToRight)
{}
QDeclarativeFlow::Flow flow;
- Qt::LayoutDirection layoutDirection;
};
QDeclarativeFlow::QDeclarativeFlow(QDeclarativeItem *parent)
@@ -1201,20 +1240,22 @@ void QDeclarativeFlow::setFlow(Flow flow)
/*!
\qmlproperty enumeration Flow::layoutDirection
+ \since Quick 1.1
+
This property holds the layout direction of the layout.
Possible values are:
\list
- \o Qt.LeftToRight (default) - Items are positioned beginning
- from the top, left anchor. The flow direction is dependent
- on the \l Flow::flow property.
- \o Qt.RightToLeft - Items are positioned beginning from the
- top, right anchor. The flow direction is dependent on the
+ \o Qt.LeftToRight (default) - Items are positioned from the top to bottom,
+ and left to right. The flow direction is dependent on the
+ \l Flow::flow property.
+ \o Qt.RightToLeft - Items are positioned from the top to bottom,
+ and right to left. The flow direction is dependent on the
\l Flow::flow property.
\endlist
- \sa Grid::layoutDirection, Row::layoutDirection, {declarative/positioners/layoutdirection}{Layout directions example}
+ \sa Grid::layoutDirection, Row::layoutDirection, {declarative/righttoleft/layoutdirection}{Layout directions example}
*/
Qt::LayoutDirection QDeclarativeFlow::layoutDirection() const
@@ -1230,9 +1271,26 @@ void QDeclarativeFlow::setLayoutDirection(Qt::LayoutDirection layoutDirection)
d->layoutDirection = layoutDirection;
prePositioning();
emit layoutDirectionChanged();
+ emit effectiveLayoutDirectionChanged();
}
}
+/*!
+ \qmlproperty enumeration Flow::effectiveLayoutDirection
+ This property holds the effective layout direction of the flow positioner.
+
+ When using the attached property \l {LayoutMirroring::enabled}{LayoutMirroring::enabled} for locale layouts,
+ the visual layout direction of the grid positioner will be mirrored. However, the
+ property \l {Flow::layoutDirection}{layoutDirection} will remain unchanged.
+
+ \sa Flow::layoutDirection, {LayoutMirroring}{LayoutMirroring}
+*/
+
+Qt::LayoutDirection QDeclarativeFlow::effectiveLayoutDirection() const
+{
+ return QDeclarativeBasePositionerPrivate::getEffectiveLayoutDirection(this);
+}
+
void QDeclarativeFlow::doPositioning(QSizeF *contentSize)
{
Q_D(QDeclarativeFlow);
@@ -1262,7 +1320,7 @@ void QDeclarativeFlow::doPositioning(QSizeF *contentSize)
}
}
- if(d->layoutDirection == Qt::LeftToRight){
+ if(d->isLeftToRight()){
if(child.item->x() != hoffset)
positionX(hoffset, child);
}else{
@@ -1285,7 +1343,7 @@ void QDeclarativeFlow::doPositioning(QSizeF *contentSize)
}
}
- if(d->layoutDirection == Qt::LeftToRight)
+ if(d->isLeftToRight())
return;
int end;
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners_p.h b/src/declarative/graphicsitems/qdeclarativepositioners_p.h
index 55d8fa1..214c04f 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepositioners_p.h
@@ -130,20 +130,22 @@ class Q_AUTOTEST_EXPORT QDeclarativeRow: public QDeclarativeBasePositioner
{
Q_OBJECT
Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1)
+ Q_PROPERTY(Qt::LayoutDirection effectiveLayoutDirection READ effectiveLayoutDirection NOTIFY effectiveLayoutDirectionChanged REVISION 1)
public:
QDeclarativeRow(QDeclarativeItem *parent=0);
Qt::LayoutDirection layoutDirection() const;
void setLayoutDirection (Qt::LayoutDirection);
+ Qt::LayoutDirection effectiveLayoutDirection() const;
Q_SIGNALS:
Q_REVISION(1) void layoutDirectionChanged();
+ Q_REVISION(1) void effectiveLayoutDirectionChanged();
protected:
virtual void doPositioning(QSizeF *contentSize);
virtual void reportConflictingAnchors();
private:
- Qt::LayoutDirection m_layoutDirection;
Q_DISABLE_COPY(QDeclarativeRow)
};
@@ -154,7 +156,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeGrid : public QDeclarativeBasePositioner
Q_PROPERTY(int columns READ columns WRITE setColumns NOTIFY columnsChanged)
Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged)
Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1)
-
+ Q_PROPERTY(Qt::LayoutDirection effectiveLayoutDirection READ effectiveLayoutDirection NOTIFY effectiveLayoutDirectionChanged REVISION 1)
public:
QDeclarativeGrid(QDeclarativeItem *parent=0);
@@ -171,12 +173,14 @@ public:
Qt::LayoutDirection layoutDirection() const;
void setLayoutDirection (Qt::LayoutDirection);
+ Qt::LayoutDirection effectiveLayoutDirection() const;
Q_SIGNALS:
void rowsChanged();
void columnsChanged();
void flowChanged();
Q_REVISION(1) void layoutDirectionChanged();
+ Q_REVISION(1) void effectiveLayoutDirectionChanged();
protected:
virtual void doPositioning(QSizeF *contentSize);
@@ -186,7 +190,6 @@ private:
int m_rows;
int m_columns;
Flow m_flow;
- Qt::LayoutDirection m_layoutDirection;
Q_DISABLE_COPY(QDeclarativeGrid)
};
@@ -194,8 +197,9 @@ class QDeclarativeFlowPrivate;
class Q_AUTOTEST_EXPORT QDeclarativeFlow: public QDeclarativeBasePositioner
{
Q_OBJECT
- Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1)
Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged)
+ Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1)
+ Q_PROPERTY(Qt::LayoutDirection effectiveLayoutDirection READ effectiveLayoutDirection NOTIFY effectiveLayoutDirectionChanged REVISION 1)
public:
QDeclarativeFlow(QDeclarativeItem *parent=0);
@@ -206,10 +210,11 @@ public:
Qt::LayoutDirection layoutDirection() const;
void setLayoutDirection (Qt::LayoutDirection);
-
+ Qt::LayoutDirection effectiveLayoutDirection() const;
Q_SIGNALS:
void flowChanged();
Q_REVISION(1) void layoutDirectionChanged();
+ Q_REVISION(1) void effectiveLayoutDirectionChanged();
protected:
virtual void doPositioning(QSizeF *contentSize);
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h b/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h
index df105c6..e80129d 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h
@@ -75,7 +75,7 @@ public:
QDeclarativeBasePositionerPrivate()
: spacing(0), type(QDeclarativeBasePositioner::None)
, moveTransition(0), addTransition(0), queuedPositioning(false)
- , doingPositioning(false), anchorConflict(false)
+ , doingPositioning(false), anchorConflict(false), layoutDirection(Qt::LeftToRight)
{
}
@@ -100,6 +100,9 @@ public:
bool doingPositioning : 1;
bool anchorConflict : 1;
+ Qt::LayoutDirection layoutDirection;
+
+
void schedulePositioning()
{
Q_Q(QDeclarativeBasePositioner);
@@ -109,6 +112,18 @@ public:
}
}
+ void mirrorChange() {
+ Q_Q(QDeclarativeBasePositioner);
+ if (type != QDeclarativeBasePositioner::Vertical)
+ q->prePositioning();
+ }
+ bool isLeftToRight() const {
+ if (type == QDeclarativeBasePositioner::Vertical)
+ return true;
+ else
+ return effectiveLayoutMirror ? layoutDirection == Qt::RightToLeft : layoutDirection == Qt::LeftToRight;
+ }
+
virtual void itemSiblingOrderChanged(QDeclarativeItem* other)
{
Q_UNUSED(other);
@@ -139,6 +154,19 @@ public:
Q_Q(QDeclarativeBasePositioner);
q->positionedItems.removeOne(QDeclarativeBasePositioner::PositionedItem(item));
}
+
+ static Qt::LayoutDirection getLayoutDirection(const QDeclarativeBasePositioner *positioner)
+ {
+ return positioner->d_func()->layoutDirection;
+ }
+
+ static Qt::LayoutDirection getEffectiveLayoutDirection(const QDeclarativeBasePositioner *positioner)
+ {
+ if (positioner->d_func()->effectiveLayoutMirror)
+ return positioner->d_func()->layoutDirection == Qt::RightToLeft ? Qt::LeftToRight : Qt::RightToLeft;
+ else
+ return positioner->d_func()->layoutDirection;
+ }
};
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
index 7d36524..b3235ef 100644
--- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
@@ -70,7 +70,7 @@ QT_BEGIN_NAMESPACE
void QDeclarativePen::setColor(const QColor &c)
{
_color = c;
- _valid = _color.alpha() ? true : false;
+ _valid = (_color.alpha() && _width >= 1) ? true : false;
emit penChanged();
}
@@ -80,7 +80,7 @@ void QDeclarativePen::setWidth(int w)
return;
_width = w;
- _valid = (_width < 1) ? false : true;
+ _valid = (_color.alpha() && _width >= 1) ? true : false;
emit penChanged();
}
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index 049169e..fdc1a71 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -50,7 +50,6 @@
#include <QTextLayout>
#include <QTextLine>
#include <QTextDocument>
-#include <QTextCursor>
#include <QGraphicsSceneMouseEvent>
#include <QPainter>
#include <QAbstractTextDocumentLayout>
@@ -97,13 +96,12 @@ DEFINE_BOOL_CONFIG_OPTION(enableImageCache, QML_ENABLE_TEXT_IMAGE_CACHE);
QString QDeclarativeTextPrivate::elideChar = QString(0x2026);
QDeclarativeTextPrivate::QDeclarativeTextPrivate()
-: color((QRgb)0), style(QDeclarativeText::Normal), hAlign(QDeclarativeText::AlignLeft),
+: color((QRgb)0), style(QDeclarativeText::Normal), hAlign(QDeclarativeText::AlignLeft),
vAlign(QDeclarativeText::AlignTop), elideMode(QDeclarativeText::ElideNone),
format(QDeclarativeText::AutoText), wrapMode(QDeclarativeText::NoWrap), lineHeight(1),
- lineHeightMode(QDeclarativeText::ProportionalHeight),
- lineCount(1), truncated(false), maximumLineCount(INT_MAX),
+ lineHeightMode(QDeclarativeText::ProportionalHeight), lineCount(1), truncated(false), maximumLineCount(INT_MAX),
maximumLineCountValid(false), imageCacheDirty(true), updateOnComponentComplete(true), richText(false), singleline(false),
- cacheAllTextAsImage(true), internalWidthUpdate(false), requireImplicitWidth(false), naturalWidth(0), doc(0)
+ cacheAllTextAsImage(true), internalWidthUpdate(false), requireImplicitWidth(false), hAlignImplicit(true), rightToLeftText(false), naturalWidth(0), doc(0)
{
cacheAllTextAsImage = enableImageCache();
QGraphicsItemPrivate::acceptedMouseButtons = Qt::LeftButton;
@@ -283,18 +281,26 @@ void QDeclarativeTextPrivate::updateSize()
//setup instance of QTextLayout for all cases other than richtext
if (!richText) {
- size = setupTextLayout();
- if (layedOutTextSize != size) {
+ QRect textRect = setupTextLayout();
+ if (layedOutTextRect.size() != textRect.size())
q->prepareGeometryChange();
- layedOutTextSize = size;
- }
+ layedOutTextRect = textRect;
+ size = textRect.size();
dy -= size.height();
} else {
singleline = false; // richtext can't elide or be optimized for single-line case
ensureDoc();
doc->setDefaultFont(font);
+
+ QDeclarativeText::HAlignment horizontalAlignment = q->effectiveHAlign();
+ if (rightToLeftText) {
+ if (horizontalAlignment == QDeclarativeText::AlignLeft)
+ horizontalAlignment = QDeclarativeText::AlignRight;
+ else if (horizontalAlignment == QDeclarativeText::AlignRight)
+ horizontalAlignment = QDeclarativeText::AlignLeft;
+ }
QTextOption option;
- option.setAlignment((Qt::Alignment)int(hAlign | vAlign));
+ option.setAlignment((Qt::Alignment)int(horizontalAlignment | vAlign));
option.setWrapMode(QTextOption::WrapMode(wrapMode));
doc->setDefaultTextOption(option);
if (requireImplicitWidth && q->widthValid()) {
@@ -307,9 +313,9 @@ void QDeclarativeTextPrivate::updateSize()
doc->setTextWidth(doc->idealWidth()); // ### Text does not align if width is not set (QTextDoc bug)
dy -= (int)doc->size().height();
QSize dsize = doc->size().toSize();
- if (dsize != layedOutTextSize) {
+ if (dsize != layedOutTextRect.size()) {
q->prepareGeometryChange();
- layedOutTextSize = dsize;
+ layedOutTextRect = QRect(QPoint(0,0), dsize);
}
size = QSize(int(doc->idealWidth()),dsize.height());
}
@@ -344,45 +350,29 @@ void QDeclarativeTextPrivate::updateSize()
Returns the size of the final text. This can be used to position the text vertically (the text is
already absolutely positioned horizontally).
*/
-QSize QDeclarativeTextPrivate::setupTextLayout()
+QRect QDeclarativeTextPrivate::setupTextLayout()
{
// ### text layout handling should be profiled and optimized as needed
// what about QStackTextEngine engine(tmp, d->font.font()); QTextLayout textLayout(&engine);
Q_Q(QDeclarativeText);
layout.setCacheEnabled(true);
- qreal height = 0;
- qreal widthUsed = 0;
qreal lineWidth = 0;
- int visibleTextLength = 0;
int visibleCount = 0;
//set manual width
- if ((wrapMode != QDeclarativeText::NoWrap || elideMode != QDeclarativeText::ElideNone) && q->widthValid())
+ if (q->widthValid())
lineWidth = q->width();
QTextOption textOption = layout.textOption();
- if (hAlign == QDeclarativeText::AlignJustify)
- textOption.setAlignment(Qt::Alignment(hAlign));
+ textOption.setAlignment(Qt::Alignment(q->effectiveHAlign()));
textOption.setWrapMode(QTextOption::WrapMode(wrapMode));
layout.setTextOption(textOption);
- QDeclarativeText::HAlignment hAlignment = hAlign;
- if(text.isRightToLeft()) {
- if ((hAlign == QDeclarativeText::AlignLeft) || (hAlign == QDeclarativeText::AlignJustify)) {
- hAlignment = QDeclarativeText::AlignRight;
- } else if (hAlign == QDeclarativeText::AlignRight) {
- hAlignment = QDeclarativeText::AlignLeft;
- } else {
- hAlignment = hAlign;
- }
- }
-
bool elideText = false;
bool truncate = false;
QFontMetrics fm(layout.font());
- qreal elideWidth = fm.width(elideChar);
elidePos = QPointF();
if (requireImplicitWidth && q->widthValid()) {
@@ -394,47 +384,47 @@ QSize QDeclarativeTextPrivate::setupTextLayout()
break;
}
layout.endLayout();
- naturalWidth = 0;
+ QRectF br;
for (int i = 0; i < layout.lineCount(); ++i) {
QTextLine line = layout.lineAt(i);
- naturalWidth = qMax(naturalWidth, line.naturalTextWidth());
+ br = br.united(line.naturalTextRect());
}
+ naturalWidth = br.width();
}
if (maximumLineCountValid) {
layout.beginLayout();
if (!lineWidth)
lineWidth = INT_MAX;
- int y = 0;
int linesLeft = maximumLineCount;
+ int visibleTextLength = 0;
while (linesLeft > 0) {
QTextLine line = layout.createLine();
if (!line.isValid())
break;
visibleCount++;
- line.setLineWidth(lineWidth);
+ if (lineWidth)
+ line.setLineWidth(lineWidth);
visibleTextLength += line.textLength();
if (--linesLeft == 0) {
if (visibleTextLength < text.length()) {
truncate = true;
if (elideMode==QDeclarativeText::ElideRight && q->widthValid()) {
+ qreal elideWidth = fm.width(elideChar);
// Need to correct for alignment
line.setLineWidth(lineWidth-elideWidth);
- int x = line.naturalTextWidth();
- if (hAlignment == QDeclarativeText::AlignRight) {
- x = q->width()-elideWidth;
- } else if (hAlignment == QDeclarativeText::AlignHCenter) {
- x = (q->width()+line.naturalTextWidth()-elideWidth)/2;
+ if (layout.text().mid(line.textStart(), line.textLength()).isRightToLeft()) {
+ line.setPosition(QPointF(line.position().x() + elideWidth, line.position().y()));
+ elidePos.setX(line.naturalTextRect().left() - elideWidth);
+ } else {
+ elidePos.setX(line.naturalTextRect().right());
}
- elidePos = QPointF(x, y + fm.ascent());
elideText = true;
}
}
}
-
- y += line.height();
}
layout.endLayout();
@@ -456,36 +446,23 @@ QSize QDeclarativeTextPrivate::setupTextLayout()
layout.endLayout();
}
+ qreal height = 0;
+ QRectF br;
for (int i = 0; i < layout.lineCount(); ++i) {
QTextLine line = layout.lineAt(i);
- widthUsed = qMax(widthUsed, line.naturalTextWidth());
+ // set line spacing
+ line.setPosition(QPointF(line.position().x(), height));
+ if (elideText && i == layout.lineCount()-1) {
+ elidePos.setY(height + fm.ascent());
+ br = br.united(QRectF(elidePos, QSizeF(fm.width(elideChar), fm.ascent())));
+ }
+ br = br.united(line.naturalTextRect());
+ height += (lineHeightMode == QDeclarativeText::FixedHeight) ? lineHeight : line.height() * lineHeight;
}
+ br.setHeight(height);
- qreal layoutWidth = q->widthValid() ? q->width() : widthUsed;
if (!q->widthValid())
- naturalWidth = layoutWidth;
-
- qreal x = 0;
- for (int i = 0; i < layout.lineCount(); ++i) {
- QTextLine line = layout.lineAt(i);
- line.setPosition(QPointF(0, height));
- height += (lineHeightMode == QDeclarativeText::FixedHeight) ? lineHeight : line.height() * lineHeight;
-
- if (!cacheAllTextAsImage) {
- if ((hAlignment == QDeclarativeText::AlignLeft) || (hAlignment == QDeclarativeText::AlignJustify)) {
- x = 0;
- } else if (hAlignment == QDeclarativeText::AlignRight) {
- x = layoutWidth - line.naturalTextWidth();
- if (elideText && i == layout.lineCount()-1)
- x -= elideWidth; // Correct for when eliding multilines
- } else if (hAlignment == QDeclarativeText::AlignHCenter) {
- x = (layoutWidth - line.naturalTextWidth()) / 2;
- if (elideText && i == layout.lineCount()-1)
- x -= elideWidth/2; // Correct for when eliding multilines
- }
- line.setPosition(QPointF(x, line.y()));
- }
- }
+ naturalWidth = br.width();
//Update the number of visible lines
if (lineCount != visibleCount) {
@@ -493,7 +470,7 @@ QSize QDeclarativeTextPrivate::setupTextLayout()
emit q->lineCountChanged();
}
- return QSize(qCeil(widthUsed), qCeil(height));
+ return QRect(qRound(br.x()), qRound(br.y()), qCeil(br.width()), qCeil(br.height()));
}
/*!
@@ -503,21 +480,7 @@ QSize QDeclarativeTextPrivate::setupTextLayout()
QPixmap QDeclarativeTextPrivate::textLayoutImage(bool drawStyle)
{
//do layout
- QSize size = layedOutTextSize;
-
- qreal x = 0;
- for (int i = 0; i < layout.lineCount(); ++i) {
- QTextLine line = layout.lineAt(i);
- if ((hAlign == QDeclarativeText::AlignLeft) || (hAlign == QDeclarativeText::AlignJustify)) {
- x = 0;
- } else if (hAlign == QDeclarativeText::AlignRight) {
- x = size.width() - line.naturalTextWidth();
- } else if (hAlign == QDeclarativeText::AlignHCenter) {
- x = (size.width() - line.naturalTextWidth()) / 2;
- }
- line.setPosition(QPointF(x, line.y()));
- }
-
+ QSize size = layedOutTextRect.size();
//paint text
QPixmap img(size);
if (!size.isEmpty()) {
@@ -530,7 +493,7 @@ QPixmap QDeclarativeTextPrivate::textLayoutImage(bool drawStyle)
#ifdef Q_WS_MAC
qt_applefontsmoothing_enabled = oldSmooth;
#endif
- drawTextLayout(&p, QPointF(0,0), drawStyle);
+ drawTextLayout(&p, QPointF(-layedOutTextRect.x(),0), drawStyle);
}
return img;
}
@@ -548,7 +511,7 @@ void QDeclarativeTextPrivate::drawTextLayout(QPainter *painter, const QPointF &p
painter->setFont(font);
layout.draw(painter, pos);
if (!elidePos.isNull())
- painter->drawText(elidePos, elideChar);
+ painter->drawText(pos + elidePos, elideChar);
}
/*!
@@ -953,14 +916,18 @@ void QDeclarativeText::setText(const QString &n)
return;
d->richText = d->format == RichText || (d->format == AutoText && Qt::mightBeRichText(n));
- if (d->richText && isComponentComplete()) {
- d->ensureDoc();
- d->doc->setText(n);
- }
-
d->text = n;
+ if (isComponentComplete()) {
+ if (d->richText) {
+ d->ensureDoc();
+ d->doc->setText(n);
+ d->rightToLeftText = d->doc->toPlainText().isRightToLeft();
+ } else {
+ d->rightToLeftText = d->text.isRightToLeft();
+ }
+ d->determineHorizontalAlignment();
+ }
d->updateLayout();
-
emit textChanged(d->text);
}
@@ -1083,9 +1050,12 @@ void QDeclarativeText::setStyleColor(const QColor &color)
/*!
\qmlproperty enumeration Text::horizontalAlignment
\qmlproperty enumeration Text::verticalAlignment
+ \qmlproperty enumeration Text::effectiveHorizontalAlignment
Sets the horizontal and vertical alignment of the text within the Text items
- width and height. By default, the text is top-left aligned.
+ width and height. By default, the text is vertically aligned to the top. Horizontal
+ alignment follows the natural alignment of the text, for example text that is read
+ from left to right will be aligned to the left.
The valid values for \c horizontalAlignment are \c Text.AlignLeft, \c Text.AlignRight, \c Text.AlignHCenter and
\c Text.AlignJustify. The valid values for \c verticalAlignment are \c Text.AlignTop, \c Text.AlignBottom
@@ -1095,6 +1065,11 @@ void QDeclarativeText::setStyleColor(const QColor &color)
all alignments are equivalent. If you want the text to be, say, centered in its parent, then you will
need to either modify the Item::anchors, or set horizontalAlignment to Text.AlignHCenter and bind the width to
that of the parent.
+
+ When using the attached property LayoutMirroring::enabled to mirror application
+ layouts, the horizontal alignment of text will also be mirrored. However, the property
+ \c horizontalAlignment will remain unchanged. To query the effective horizontal alignment
+ of Text, use the read-only property \c effectiveHorizontalAlignment.
*/
QDeclarativeText::HAlignment QDeclarativeText::hAlign() const
{
@@ -1105,16 +1080,78 @@ QDeclarativeText::HAlignment QDeclarativeText::hAlign() const
void QDeclarativeText::setHAlign(HAlignment align)
{
Q_D(QDeclarativeText);
- if (d->hAlign == align)
- return;
+ bool forceAlign = d->hAlignImplicit && d->effectiveLayoutMirror;
+ d->hAlignImplicit = false;
+ if (d->setHAlign(align, forceAlign) && isComponentComplete())
+ d->updateLayout();
+}
- if (isComponentComplete())
- prepareGeometryChange();
+void QDeclarativeText::resetHAlign()
+{
+ Q_D(QDeclarativeText);
+ d->hAlignImplicit = true;
+ if (d->determineHorizontalAlignment() && isComponentComplete())
+ d->updateLayout();
+}
- d->hAlign = align;
- d->updateLayout();
+QDeclarativeText::HAlignment QDeclarativeText::effectiveHAlign() const
+{
+ Q_D(const QDeclarativeText);
+ QDeclarativeText::HAlignment effectiveAlignment = d->hAlign;
+ if (!d->hAlignImplicit && d->effectiveLayoutMirror) {
+ switch (d->hAlign) {
+ case QDeclarativeText::AlignLeft:
+ effectiveAlignment = QDeclarativeText::AlignRight;
+ break;
+ case QDeclarativeText::AlignRight:
+ effectiveAlignment = QDeclarativeText::AlignLeft;
+ break;
+ default:
+ break;
+ }
+ }
+ return effectiveAlignment;
+}
+
+bool QDeclarativeTextPrivate::setHAlign(QDeclarativeText::HAlignment alignment, bool forceAlign)
+{
+ Q_Q(QDeclarativeText);
+ if (hAlign != alignment || forceAlign) {
+ QDeclarativeText::HAlignment oldEffectiveHAlign = q->effectiveHAlign();
+ hAlign = alignment;
+
+ emit q->horizontalAlignmentChanged(hAlign);
+ if (oldEffectiveHAlign != q->effectiveHAlign())
+ emit q->effectiveHorizontalAlignmentChanged();
+ return true;
+ }
+ return false;
+}
+
+bool QDeclarativeTextPrivate::determineHorizontalAlignment()
+{
+ Q_Q(QDeclarativeText);
+ if (hAlignImplicit && q->isComponentComplete()) {
+ bool alignToRight = text.isEmpty() ? QApplication::keyboardInputDirection() == Qt::RightToLeft : rightToLeftText;
+ return setHAlign(alignToRight ? QDeclarativeText::AlignRight : QDeclarativeText::AlignLeft);
+ }
+ return false;
+}
- emit horizontalAlignmentChanged(align);
+void QDeclarativeTextPrivate::mirrorChange()
+{
+ Q_Q(QDeclarativeText);
+ if (q->isComponentComplete()) {
+ if (!hAlignImplicit && (hAlign == QDeclarativeText::AlignRight || hAlign == QDeclarativeText::AlignLeft)) {
+ updateLayout();
+ emit q->effectiveHorizontalAlignmentChanged();
+ }
+ }
+}
+
+QTextDocument *QDeclarativeTextPrivate::textDocument()
+{
+ return doc;
}
QDeclarativeText::VAlignment QDeclarativeText::vAlign() const
@@ -1168,6 +1205,7 @@ void QDeclarativeText::setWrapMode(WrapMode mode)
/*!
\qmlproperty int Text::lineCount
+ \since Quick 1.1
Returns the number of lines visible in the text item.
@@ -1183,6 +1221,7 @@ int QDeclarativeText::lineCount() const
/*!
\qmlproperty bool Text::truncated
+ \since Quick 1.1
Returns true if the text has been truncated due to \l maximumLineCount
or \l elide.
@@ -1199,6 +1238,7 @@ bool QDeclarativeText::truncated() const
/*!
\qmlproperty int Text::maximumLineCount
+ \since Quick 1.1
Set this property to limit the number of lines that the text item will show.
If elide is set to Text.ElideRight, the text will be elided appropriately.
@@ -1365,44 +1405,25 @@ QRectF QDeclarativeText::boundingRect() const
{
Q_D(const QDeclarativeText);
- int w = width();
- int h = height();
-
- int x = 0;
- int y = 0;
-
- QSize size = d->layedOutTextSize;
+ QRect rect = d->layedOutTextRect;
if (d->style != Normal)
- size += QSize(2,2);
+ rect.adjust(-1, 0, 1, 2);
// Could include font max left/right bearings to either side of rectangle.
- switch (d->hAlign) {
- case AlignLeft:
- case AlignJustify:
- x = 0;
- break;
- case AlignRight:
- x = w - size.width();
- break;
- case AlignHCenter:
- x = (w - size.width()) / 2;
- break;
- }
-
+ int h = height();
switch (d->vAlign) {
case AlignTop:
- y = 0;
break;
case AlignBottom:
- y = h - size.height();
+ rect.setY(h - rect.height());
break;
case AlignVCenter:
- y = (h - size.height()) / 2;
+ rect.setY((h - rect.height()) / 2);
break;
}
- return QRectF(x,y,size.width(),size.height());
+ return QRectF(rect);
}
/*! \internal */
@@ -1451,6 +1472,7 @@ qreal QDeclarativeText::paintedHeight() const
/*!
\qmlproperty real Text::lineHeight
+ \since Quick 1.1
Sets the line height for the text.
The value can be in pixels or a multiplier depending on lineHeightMode.
@@ -1547,8 +1569,8 @@ void QDeclarativeText::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWid
} else {
QRectF bounds = boundingRect();
- bool needClip = clip() && (d->layedOutTextSize.width() > width() ||
- d->layedOutTextSize.height() > height());
+ bool needClip = clip() && (d->layedOutTextRect.width() > width() ||
+ d->layedOutTextRect.height() > height());
if (needClip) {
p->save();
@@ -1580,7 +1602,11 @@ void QDeclarativeText::componentComplete()
if (d->richText) {
d->ensureDoc();
d->doc->setText(d->text);
+ d->rightToLeftText = d->doc->toPlainText().isRightToLeft();
+ } else {
+ d->rightToLeftText = d->text.isRightToLeft();
}
+ d->determineHorizontalAlignment();
d->updateLayout();
}
}
diff --git a/src/declarative/graphicsitems/qdeclarativetext_p.h b/src/declarative/graphicsitems/qdeclarativetext_p.h
index b8835d1..a1153c2 100644
--- a/src/declarative/graphicsitems/qdeclarativetext_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetext_p.h
@@ -69,7 +69,8 @@ class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeText : public QDeclarativeImplici
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
Q_PROPERTY(TextStyle style READ style WRITE setStyle NOTIFY styleChanged)
Q_PROPERTY(QColor styleColor READ styleColor WRITE setStyleColor NOTIFY styleColorChanged)
- Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign NOTIFY horizontalAlignmentChanged)
+ Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign RESET resetHAlign NOTIFY horizontalAlignmentChanged)
+ Q_PROPERTY(HAlignment effectiveHorizontalAlignment READ effectiveHAlign NOTIFY effectiveHorizontalAlignmentChanged REVISION 1)
Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign NOTIFY verticalAlignmentChanged)
Q_PROPERTY(WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged)
Q_PROPERTY(int lineCount READ lineCount NOTIFY lineCountChanged REVISION 1)
@@ -133,6 +134,8 @@ public:
HAlignment hAlign() const;
void setHAlign(HAlignment align);
+ void resetHAlign();
+ HAlignment effectiveHAlign() const;
VAlignment vAlign() const;
void setVAlign(VAlignment align);
@@ -188,6 +191,7 @@ Q_SIGNALS:
void paintedSizeChanged();
Q_REVISION(1) void lineHeightChanged(qreal lineHeight);
Q_REVISION(1) void lineHeightModeChanged(LineHeightMode mode);
+ Q_REVISION(1) void effectiveHorizontalAlignmentChanged();
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event);
diff --git a/src/declarative/graphicsitems/qdeclarativetext_p_p.h b/src/declarative/graphicsitems/qdeclarativetext_p_p.h
index 36ae123..e3ab62a 100644
--- a/src/declarative/graphicsitems/qdeclarativetext_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetext_p_p.h
@@ -76,6 +76,10 @@ public:
void updateSize();
void updateLayout();
+ bool determineHorizontalAlignment();
+ bool setHAlign(QDeclarativeText::HAlignment, bool forceAlign = false);
+ void mirrorChange();
+ QTextDocument *textDocument();
QString text;
QFont font;
@@ -110,8 +114,10 @@ public:
bool cacheAllTextAsImage:1;
bool internalWidthUpdate:1;
bool requireImplicitWidth:1;
+ bool hAlignImplicit:1;
+ bool rightToLeftText:1;
- QSize layedOutTextSize;
+ QRect layedOutTextRect;
QSize paintedSize;
qreal naturalWidth;
virtual qreal implicitWidth() const;
@@ -119,7 +125,7 @@ public:
QPixmap textDocumentImage(bool drawStyle);
QTextDocumentWithImageResources *doc;
- QSize setupTextLayout();
+ QRect setupTextLayout();
QPixmap textLayoutImage(bool drawStyle);
void drawTextLayout(QPainter *p, const QPointF &pos, bool drawStyle);
QDeclarativeTextLayout layout;
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index 7f383a6..2cb1c94 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -48,6 +48,7 @@
#include <QtCore/qmath.h>
+#include <private/qtextengine_p.h>
#include <QTextLayout>
#include <QTextLine>
#include <QTextDocument>
@@ -249,6 +250,7 @@ void QDeclarativeTextEdit::setText(const QString &text)
Q_D(QDeclarativeTextEdit);
if (QDeclarativeTextEdit::text() == text)
return;
+
d->richText = d->format == RichText || (d->format == AutoText && Qt::mightBeRichText(text));
if (d->richText) {
#ifndef QT_NO_TEXTHTMLPARSER
@@ -457,9 +459,12 @@ void QDeclarativeTextEdit::setSelectedTextColor(const QColor &color)
/*!
\qmlproperty enumeration TextEdit::horizontalAlignment
\qmlproperty enumeration TextEdit::verticalAlignment
+ \qmlproperty enumeration TextEdit::effectiveHorizontalAlignment
Sets the horizontal and vertical alignment of the text within the TextEdit item's
- width and height. By default, the text is top-left aligned.
+ width and height. By default, the text alignment follows the natural alignment
+ of the text, for example text that is read from left to right will be aligned to
+ the left.
Valid values for \c horizontalAlignment are:
\list
@@ -473,8 +478,13 @@ void QDeclarativeTextEdit::setSelectedTextColor(const QColor &color)
\list
\o TextEdit.AlignTop (default)
\o TextEdit.AlignBottom
- \c TextEdit.AlignVCenter
+ \o TextEdit.AlignVCenter
\endlist
+
+ When using the attached property LayoutMirroring::enabled to mirror application
+ layouts, the horizontal alignment of text will also be mirrored. However, the property
+ \c horizontalAlignment will remain unchanged. To query the effective horizontal alignment
+ of TextEdit, use the read-only property \c effectiveHorizontalAlignment.
*/
QDeclarativeTextEdit::HAlignment QDeclarativeTextEdit::hAlign() const
{
@@ -482,15 +492,80 @@ QDeclarativeTextEdit::HAlignment QDeclarativeTextEdit::hAlign() const
return d->hAlign;
}
-void QDeclarativeTextEdit::setHAlign(QDeclarativeTextEdit::HAlignment alignment)
+void QDeclarativeTextEdit::setHAlign(HAlignment align)
{
Q_D(QDeclarativeTextEdit);
- if (alignment == d->hAlign)
- return;
- d->hAlign = alignment;
- d->updateDefaultTextOption();
- updateSize();
- emit horizontalAlignmentChanged(d->hAlign);
+ bool forceAlign = d->hAlignImplicit && d->effectiveLayoutMirror;
+ d->hAlignImplicit = false;
+ if (d->setHAlign(align, forceAlign) && isComponentComplete()) {
+ d->updateDefaultTextOption();
+ updateSize();
+ }
+}
+
+void QDeclarativeTextEdit::resetHAlign()
+{
+ Q_D(QDeclarativeTextEdit);
+ d->hAlignImplicit = true;
+ if (d->determineHorizontalAlignment() && isComponentComplete()) {
+ d->updateDefaultTextOption();
+ updateSize();
+ }
+}
+
+QDeclarativeTextEdit::HAlignment QDeclarativeTextEdit::effectiveHAlign() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ QDeclarativeTextEdit::HAlignment effectiveAlignment = d->hAlign;
+ if (!d->hAlignImplicit && d->effectiveLayoutMirror) {
+ switch (d->hAlign) {
+ case QDeclarativeTextEdit::AlignLeft:
+ effectiveAlignment = QDeclarativeTextEdit::AlignRight;
+ break;
+ case QDeclarativeTextEdit::AlignRight:
+ effectiveAlignment = QDeclarativeTextEdit::AlignLeft;
+ break;
+ default:
+ break;
+ }
+ }
+ return effectiveAlignment;
+}
+
+bool QDeclarativeTextEditPrivate::setHAlign(QDeclarativeTextEdit::HAlignment alignment, bool forceAlign)
+{
+ Q_Q(QDeclarativeTextEdit);
+ if (hAlign != alignment || forceAlign) {
+ QDeclarativeTextEdit::HAlignment oldEffectiveHAlign = q->effectiveHAlign();
+ hAlign = alignment;
+ emit q->horizontalAlignmentChanged(alignment);
+ if (oldEffectiveHAlign != q->effectiveHAlign())
+ emit q->effectiveHorizontalAlignmentChanged();
+ return true;
+ }
+ return false;
+}
+
+bool QDeclarativeTextEditPrivate::determineHorizontalAlignment()
+{
+ Q_Q(QDeclarativeTextEdit);
+ if (hAlignImplicit && q->isComponentComplete()) {
+ bool alignToRight = text.isEmpty() ? QApplication::keyboardInputDirection() == Qt::RightToLeft : rightToLeftText;
+ return setHAlign(alignToRight ? QDeclarativeTextEdit::AlignRight : QDeclarativeTextEdit::AlignLeft);
+ }
+ return false;
+}
+
+void QDeclarativeTextEditPrivate::mirrorChange()
+{
+ Q_Q(QDeclarativeTextEdit);
+ if (q->isComponentComplete()) {
+ if (!hAlignImplicit && (hAlign == QDeclarativeTextEdit::AlignRight || hAlign == QDeclarativeTextEdit::AlignLeft)) {
+ updateDefaultTextOption();
+ q->updateSize();
+ emit q->effectiveHorizontalAlignmentChanged();
+ }
+ }
}
QDeclarativeTextEdit::VAlignment QDeclarativeTextEdit::vAlign() const
@@ -544,6 +619,7 @@ void QDeclarativeTextEdit::setWrapMode(WrapMode mode)
/*!
\qmlproperty int TextEdit::lineCount
+ \since Quick 1.1
Returns the total number of lines in the textEdit item.
*/
@@ -605,6 +681,22 @@ int QDeclarativeTextEdit::positionAt(int x, int y) const
{
Q_D(const QDeclarativeTextEdit);
int r = d->document->documentLayout()->hitTest(QPoint(x,y-d->yoff), Qt::FuzzyHit);
+ QTextCursor cursor = d->control->textCursor();
+ if (r > cursor.position()) {
+ // The cursor position includes positions within the preedit text, but only positions in the
+ // same text block are offset so it is possible to get a position that is either part of the
+ // preedit or the next text block.
+ QTextLayout *layout = cursor.block().layout();
+ const int preeditLength = layout
+ ? layout->preeditAreaText().length()
+ : 0;
+ if (preeditLength > 0
+ && d->document->documentLayout()->blockBoundingRect(cursor.block()).contains(x,y-d->yoff)) {
+ r = r > cursor.position() + preeditLength
+ ? r - preeditLength
+ : cursor.position();
+ }
+ }
return r;
}
@@ -950,6 +1042,8 @@ void QDeclarativeTextEdit::componentComplete()
Q_D(QDeclarativeTextEdit);
QDeclarativePaintedItem::componentComplete();
if (d->dirty) {
+ d->determineHorizontalAlignment();
+ d->updateDefaultTextOption();
updateSize();
d->dirty = false;
}
@@ -1134,6 +1228,7 @@ void QDeclarativeTextEditPrivate::focusChanged(bool hasFocus)
/*!
\qmlmethod void TextEdit::deselect()
+ \since Quick 1.1
Removes active text selection.
*/
@@ -1198,6 +1293,23 @@ void QDeclarativeTextEdit::select(int start, int end)
updateSelectionMarkers();
}
+/*!
+ \qmlmethod void TextEdit::isRightToLeft(int start, int end)
+
+ Returns true if the natural reading direction of the editor text
+ found between positions \a start and \a end is right to left.
+*/
+bool QDeclarativeTextEdit::isRightToLeft(int start, int end)
+{
+ Q_D(QDeclarativeTextEdit);
+ if (start > end) {
+ qmlInfo(this) << "isRightToLeft(start, end) called with the end property being smaller than the start.";
+ return false;
+ } else {
+ return d->text.mid(start, end - start).isRightToLeft();
+ }
+}
+
#ifndef QT_NO_CLIPBOARD
/*!
\qmlmethod TextEdit::cut()
@@ -1316,7 +1428,10 @@ Handles the given input method \a event.
void QDeclarativeTextEdit::inputMethodEvent(QInputMethodEvent *event)
{
Q_D(QDeclarativeTextEdit);
+ const bool wasComposing = isInputMethodComposing();
d->control->processEvent(event, QPointF(0, -d->yoff));
+ if (wasComposing != isInputMethodComposing())
+ emit inputMethodComposingChanged();
}
/*!
@@ -1381,19 +1496,38 @@ void QDeclarativeTextEdit::updateImgCache(const QRectF &rf)
/*!
\qmlproperty bool TextEdit::canPaste
+ \since QtQuick 1.1
Returns true if the TextEdit is writable and the content of the clipboard is
suitable for pasting into the TextEdit.
-
- \since QtQuick 1.1
*/
-
bool QDeclarativeTextEdit::canPaste() const
{
Q_D(const QDeclarativeTextEdit);
return d->canPaste;
}
+/*!
+ \qmlproperty bool TextEdit::inputMethodComposing
+
+ \since QtQuick 1.1
+
+ This property holds whether the TextEdit has partial text input from an
+ input method.
+
+ While it is composing an input method may rely on mouse or key events from
+ the TextEdit to edit or commit the partial text. This property can be used
+ to determine when to disable events handlers that may interfere with the
+ correct operation of an input method.
+*/
+bool QDeclarativeTextEdit::isInputMethodComposing() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ if (QTextLayout *layout = d->control->textCursor().block().layout())
+ return layout->preeditAreaText().length() > 0;
+ return false;
+}
+
void QDeclarativeTextEditPrivate::init()
{
Q_Q(QDeclarativeTextEdit);
@@ -1429,6 +1563,7 @@ void QDeclarativeTextEditPrivate::init()
#ifndef QT_NO_CLIPBOARD
QObject::connect(q, SIGNAL(readOnlyChanged(bool)), q, SLOT(q_canPasteChanged()));
QObject::connect(QApplication::clipboard(), SIGNAL(dataChanged()), q, SLOT(q_canPasteChanged()));
+ canPaste = control->canPaste();
#endif
document = control->document();
@@ -1443,6 +1578,9 @@ void QDeclarativeTextEdit::q_textChanged()
{
Q_D(QDeclarativeTextEdit);
d->text = text();
+ d->rightToLeftText = d->document->begin().layout()->engine()->isRightToLeft();
+ d->determineHorizontalAlignment();
+ d->updateDefaultTextOption();
updateSize();
updateTotalLines();
updateMicroFocus();
@@ -1607,9 +1745,18 @@ void QDeclarativeTextEdit::updateTotalLines()
void QDeclarativeTextEditPrivate::updateDefaultTextOption()
{
+ Q_Q(QDeclarativeTextEdit);
QTextOption opt = document->defaultTextOption();
int oldAlignment = opt.alignment();
- opt.setAlignment((Qt::Alignment)(int)(hAlign | vAlign));
+
+ QDeclarativeTextEdit::HAlignment horizontalAlignment = q->effectiveHAlign();
+ if (rightToLeftText) {
+ if (horizontalAlignment == QDeclarativeTextEdit::AlignLeft)
+ horizontalAlignment = QDeclarativeTextEdit::AlignRight;
+ else if (horizontalAlignment == QDeclarativeTextEdit::AlignRight)
+ horizontalAlignment = QDeclarativeTextEdit::AlignLeft;
+ }
+ opt.setAlignment((Qt::Alignment)(int)(horizontalAlignment | vAlign));
QTextOption::WrapMode oldWrapMode = opt.wrapMode();
opt.setWrapMode(QTextOption::WrapMode(wrapMode));
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
index 7785a7a..25ca1e7 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
@@ -72,7 +72,8 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextEdit : public QDeclarativeImplicitSizePa
Q_PROPERTY(QColor selectionColor READ selectionColor WRITE setSelectionColor NOTIFY selectionColorChanged)
Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor NOTIFY selectedTextColorChanged)
Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
- Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign NOTIFY horizontalAlignmentChanged)
+ Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign RESET resetHAlign NOTIFY horizontalAlignmentChanged)
+ Q_PROPERTY(HAlignment effectiveHorizontalAlignment READ effectiveHAlign NOTIFY effectiveHorizontalAlignmentChanged REVISION 1)
Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign NOTIFY verticalAlignmentChanged)
Q_PROPERTY(WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged)
Q_PROPERTY(int lineCount READ lineCount NOTIFY lineCountChanged REVISION 1)
@@ -94,6 +95,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextEdit : public QDeclarativeImplicitSizePa
Q_PROPERTY(bool selectByMouse READ selectByMouse WRITE setSelectByMouse NOTIFY selectByMouseChanged)
Q_PROPERTY(SelectionMode mouseSelectionMode READ mouseSelectionMode WRITE setMouseSelectionMode NOTIFY mouseSelectionModeChanged REVISION 1)
Q_PROPERTY(bool canPaste READ canPaste NOTIFY canPasteChanged REVISION 1)
+ Q_PROPERTY(bool inputMethodComposing READ isInputMethodComposing NOTIFY inputMethodComposingChanged REVISION 1)
public:
QDeclarativeTextEdit(QDeclarativeItem *parent=0);
@@ -152,6 +154,8 @@ public:
HAlignment hAlign() const;
void setHAlign(HAlignment align);
+ void resetHAlign();
+ HAlignment effectiveHAlign() const;
VAlignment vAlign() const;
void setVAlign(VAlignment align);
@@ -215,6 +219,8 @@ public:
QRectF boundingRect() const;
+ bool isInputMethodComposing() const;
+
Q_SIGNALS:
void textChanged(const QString &);
void paintedSizeChanged();
@@ -242,12 +248,15 @@ Q_SIGNALS:
Q_REVISION(1) void mouseSelectionModeChanged(SelectionMode mode);
Q_REVISION(1) void linkActivated(const QString &link);
Q_REVISION(1) void canPasteChanged();
+ Q_REVISION(1) void inputMethodComposingChanged();
+ Q_REVISION(1) void effectiveHorizontalAlignmentChanged();
public Q_SLOTS:
void selectAll();
void selectWord();
void select(int start, int end);
Q_REVISION(1) void deselect();
+ Q_REVISION(1) bool isRightToLeft(int start, int end);
#ifndef QT_NO_CLIPBOARD
void cut();
void copy();
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
index 111cc02..36e1b51 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
@@ -71,8 +71,8 @@ public:
: color("black"), hAlign(QDeclarativeTextEdit::AlignLeft), vAlign(QDeclarativeTextEdit::AlignTop),
imgDirty(true), dirty(false), richText(false), cursorVisible(false), focusOnPress(true),
showInputPanelOnFocus(true), clickCausedFocus(false), persistentSelection(true), requireImplicitWidth(false),
- textMargin(0.0), lastSelectionStart(0), lastSelectionEnd(0), cursorComponent(0), cursor(0),
- format(QDeclarativeTextEdit::AutoText), document(0), wrapMode(QDeclarativeTextEdit::NoWrap),
+ hAlignImplicit(true), rightToLeftText(false), textMargin(0.0), lastSelectionStart(0), lastSelectionEnd(0),
+ cursorComponent(0), cursor(0), format(QDeclarativeTextEdit::AutoText), document(0), wrapMode(QDeclarativeTextEdit::NoWrap),
mouseSelectionMode(QDeclarativeTextEdit::SelectCharacters), selectByMouse(false), canPaste(false),
yoff(0)
{
@@ -88,6 +88,9 @@ public:
void updateDefaultTextOption();
void relayoutDocument();
void updateSelection();
+ bool determineHorizontalAlignment();
+ bool setHAlign(QDeclarativeTextEdit::HAlignment, bool forceAlign = false);
+ void mirrorChange();
qreal implicitWidth() const;
void focusChanged(bool);
@@ -112,6 +115,8 @@ public:
bool clickCausedFocus : 1;
bool persistentSelection : 1;
bool requireImplicitWidth:1;
+ bool hAlignImplicit:1;
+ bool rightToLeftText:1;
qreal textMargin;
int lastSelectionStart;
int lastSelectionEnd;
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index 78f34db..af18c90 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -326,9 +326,12 @@ void QDeclarativeTextInput::setSelectedTextColor(const QColor &color)
/*!
\qmlproperty enumeration TextInput::horizontalAlignment
+ \qmlproperty enumeration TextInput::effectiveHorizontalAlignment
Sets the horizontal alignment of the text within the TextInput item's
- width and height. By default, the text is left aligned.
+ width and height. By default, the text alignment follows the natural alignment
+ of the text, for example text that is read from left to right will be aligned to
+ the left.
TextInput does not have vertical alignment, as the natural height is
exactly the height of the single line of text. If you set the height
@@ -338,6 +341,11 @@ void QDeclarativeTextInput::setSelectedTextColor(const QColor &color)
The valid values for \c horizontalAlignment are \c TextInput.AlignLeft, \c TextInput.AlignRight and
\c TextInput.AlignHCenter.
+
+ When using the attached property LayoutMirroring::enabled to mirror application
+ layouts, the horizontal alignment of text will also be mirrored. However, the property
+ \c horizontalAlignment will remain unchanged. To query the effective horizontal alignment
+ of TextInput, use the read-only property \c effectiveHorizontalAlignment.
*/
QDeclarativeTextInput::HAlignment QDeclarativeTextInput::hAlign() const
{
@@ -348,12 +356,78 @@ QDeclarativeTextInput::HAlignment QDeclarativeTextInput::hAlign() const
void QDeclarativeTextInput::setHAlign(HAlignment align)
{
Q_D(QDeclarativeTextInput);
- if(align == d->hAlign)
- return;
- d->hAlign = align;
- updateRect();
- d->updateHorizontalScroll();
- emit horizontalAlignmentChanged(d->hAlign);
+ bool forceAlign = d->hAlignImplicit && d->effectiveLayoutMirror;
+ d->hAlignImplicit = false;
+ if (d->setHAlign(align, forceAlign) && isComponentComplete()) {
+ updateRect();
+ d->updateHorizontalScroll();
+ }
+}
+
+void QDeclarativeTextInput::resetHAlign()
+{
+ Q_D(QDeclarativeTextInput);
+ d->hAlignImplicit = true;
+ if (d->determineHorizontalAlignment() && isComponentComplete()) {
+ updateRect();
+ d->updateHorizontalScroll();
+ }
+}
+
+QDeclarativeTextInput::HAlignment QDeclarativeTextInput::effectiveHAlign() const
+{
+ Q_D(const QDeclarativeTextInput);
+ QDeclarativeTextInput::HAlignment effectiveAlignment = d->hAlign;
+ if (!d->hAlignImplicit && d->effectiveLayoutMirror) {
+ switch (d->hAlign) {
+ case QDeclarativeTextInput::AlignLeft:
+ effectiveAlignment = QDeclarativeTextInput::AlignRight;
+ break;
+ case QDeclarativeTextInput::AlignRight:
+ effectiveAlignment = QDeclarativeTextInput::AlignLeft;
+ break;
+ default:
+ break;
+ }
+ }
+ return effectiveAlignment;
+}
+
+bool QDeclarativeTextInputPrivate::setHAlign(QDeclarativeTextInput::HAlignment alignment, bool forceAlign)
+{
+ Q_Q(QDeclarativeTextInput);
+ if ((hAlign != alignment || forceAlign) && alignment <= QDeclarativeTextInput::AlignHCenter) { // justify not supported
+ QDeclarativeTextInput::HAlignment oldEffectiveHAlign = q->effectiveHAlign();
+ hAlign = alignment;
+ emit q->horizontalAlignmentChanged(alignment);
+ if (oldEffectiveHAlign != q->effectiveHAlign())
+ emit q->effectiveHorizontalAlignmentChanged();
+ return true;
+ }
+ return false;
+}
+
+bool QDeclarativeTextInputPrivate::determineHorizontalAlignment()
+{
+ if (hAlignImplicit) {
+ // if no explicit alignment has been set, follow the natural layout direction of the text
+ QString text = control->text();
+ bool isRightToLeft = text.isEmpty() ? QApplication::keyboardInputDirection() == Qt::RightToLeft : text.isRightToLeft();
+ return setHAlign(isRightToLeft ? QDeclarativeTextInput::AlignRight : QDeclarativeTextInput::AlignLeft);
+ }
+ return false;
+}
+
+void QDeclarativeTextInputPrivate::mirrorChange()
+{
+ Q_Q(QDeclarativeTextInput);
+ if (q->isComponentComplete()) {
+ if (!hAlignImplicit && (hAlign == QDeclarativeTextInput::AlignRight || hAlign == QDeclarativeTextInput::AlignLeft)) {
+ q->updateRect();
+ updateHorizontalScroll();
+ emit q->effectiveHorizontalAlignmentChanged();
+ }
+ }
}
/*!
@@ -482,6 +556,7 @@ QRect QDeclarativeTextInput::cursorRectangle() const
Q_D(const QDeclarativeTextInput);
QRect r = d->control->cursorRect();
r.setHeight(r.height()-1); // Make consistent with TextEdit (QLineControl inexplicably adds 1)
+ r.moveLeft(r.x() - d->hscroll);
return r;
}
@@ -921,14 +996,22 @@ void QDeclarativeTextInput::moveCursor()
QRectF QDeclarativeTextInput::positionToRectangle(int pos) const
{
Q_D(const QDeclarativeTextInput);
+ if (pos > d->control->cursorPosition())
+ pos += d->control->preeditAreaText().length();
return QRectF(d->control->cursorToX(pos)-d->hscroll,
0.0,
d->control->cursorWidth(),
cursorRectangle().height());
}
+int QDeclarativeTextInput::positionAt(int x) const
+{
+ return positionAt(x, CursorBetweenCharacters);
+}
+
/*!
- \qmlmethod int TextInput::positionAt(int x)
+ \qmlmethod int TextInput::positionAt(int x, CursorPosition position = CursorBetweenCharacters)
+ \since Quick 1.1
This function returns the character position at
x pixels from the left of the textInput. Position 0 is before the
@@ -937,11 +1020,26 @@ QRectF QDeclarativeTextInput::positionToRectangle(int pos) const
This means that for all x values before the first character this function returns 0,
and for all x values after the last character this function returns text.length.
+
+ The cursor position type specifies how the cursor position should be resolved.
+
+ \list
+ \o TextInput.CursorBetweenCharacters - Returns the position between characters that is nearest x.
+ \o TextInput.CursorOnCharacter - Returns the position before the character that is nearest x.
+ \endlist
*/
-int QDeclarativeTextInput::positionAt(int x) const
+int QDeclarativeTextInput::positionAt(int x, CursorPosition position) const
{
Q_D(const QDeclarativeTextInput);
- return d->control->xToPos(x + d->hscroll);
+ int pos = d->control->xToPos(x + d->hscroll, QTextLine::CursorPosition(position));
+ const int cursor = d->control->cursor();
+ if (pos > cursor) {
+ const int preeditLength = d->control->preeditAreaText().length();
+ pos = pos > cursor + preeditLength
+ ? pos - preeditLength
+ : cursor;
+ }
+ return pos;
}
void QDeclarativeTextInputPrivate::focusChanged(bool hasFocus)
@@ -962,16 +1060,21 @@ void QDeclarativeTextInput::keyPressEvent(QKeyEvent* ev)
keyPressPreHandler(ev);
if (ev->isAccepted())
return;
- if (((ev->key() == Qt::Key_Up || ev->key() == Qt::Key_Down) && ev->modifiers() == Qt::NoModifier) // Don't allow MacOSX up/down support, and we don't allow a completer.
- || (((d->control->cursor() == 0 && ev->key() == Qt::Key_Left)
- || (d->control->cursor() == d->control->text().length()
- && ev->key() == Qt::Key_Right))
- && (d->lastSelectionStart == d->lastSelectionEnd)))
- {
- //ignore when moving off the end
- //unless there is a selection, because then moving will do something (deselect)
+
+ // Don't allow MacOSX up/down support, and we don't allow a completer.
+ bool ignore = (ev->key() == Qt::Key_Up || ev->key() == Qt::Key_Down) && ev->modifiers() == Qt::NoModifier;
+ if (!ignore && (d->lastSelectionStart == d->lastSelectionEnd) && (ev->key() == Qt::Key_Right || ev->key() == Qt::Key_Left)) {
+ // Ignore when moving off the end unless there is a selection,
+ // because then moving will do something (deselect).
+ int cursorPosition = d->control->cursor();
+ if (cursorPosition == 0)
+ ignore = ev->key() == (d->control->layoutDirection() == Qt::LeftToRight ? Qt::Key_Left : Qt::Key_Right);
+ if (cursorPosition == d->control->text().length())
+ ignore = ev->key() == (d->control->layoutDirection() == Qt::LeftToRight ? Qt::Key_Right : Qt::Key_Left);
+ }
+ if (ignore) {
ev->ignore();
- }else{
+ } else {
d->control->processKeyEvent(ev);
}
if (!ev->isAccepted())
@@ -982,18 +1085,22 @@ void QDeclarativeTextInput::inputMethodEvent(QInputMethodEvent *ev)
{
Q_D(QDeclarativeTextInput);
ev->ignore();
+ const bool wasComposing = d->control->preeditAreaText().length() > 0;
inputMethodPreHandler(ev);
- if (ev->isAccepted())
- return;
- if (d->control->isReadOnly()) {
- ev->ignore();
- } else {
- d->control->processInputMethodEvent(ev);
- updateSize();
- d->updateHorizontalScroll();
+ if (!ev->isAccepted()) {
+ if (d->control->isReadOnly()) {
+ ev->ignore();
+ } else {
+ d->control->processInputMethodEvent(ev);
+ updateSize();
+ d->updateHorizontalScroll();
+ }
}
if (!ev->isAccepted())
QDeclarativePaintedItem::inputMethodEvent(ev);
+
+ if (wasComposing != (d->control->preeditAreaText().length() > 0))
+ emit inputMethodComposingChanged();
}
/*!
@@ -1047,7 +1154,7 @@ void QDeclarativeTextInput::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextInput);
if (d->sendMouseEventToInputContext(event, QEvent::MouseMove))
- event->setAccepted(true);
+ return;
if (d->selectByMouse) {
if (qAbs(int(event->pos().x() - d->pressPos.x())) > QApplication::startDragDistance())
setKeepMouseGrab(true);
@@ -1176,11 +1283,12 @@ void QDeclarativeTextInputPrivate::updateHorizontalScroll()
int cix = qRound(control->cursorToX(control->cursor() + preeditLength));
QRect br(q->boundingRect().toRect());
int widthUsed = calculateTextWidth();
- Qt::Alignment va = QStyle::visualAlignment(control->layoutDirection(), QFlag(Qt::Alignment(hAlign)));
+
+ QDeclarativeTextInput::HAlignment effectiveHAlign = q->effectiveHAlign();
if (autoScroll) {
if (widthUsed <= br.width()) {
// text fits in br; use hscroll for alignment
- switch (va & ~(Qt::AlignAbsolute|Qt::AlignVertical_Mask)) {
+ switch (effectiveHAlign & ~(Qt::AlignAbsolute|Qt::AlignVertical_Mask)) {
case Qt::AlignRight:
hscroll = widthUsed - br.width() - 1;
break;
@@ -1212,11 +1320,11 @@ void QDeclarativeTextInputPrivate::updateHorizontalScroll()
hscroll = cix;
}
} else {
- switch (va & ~(Qt::AlignAbsolute|Qt::AlignVertical_Mask)) {
- case Qt::AlignRight:
+ switch (effectiveHAlign) {
+ case QDeclarativeTextInput::AlignRight:
hscroll = q->width() - widthUsed;
break;
- case Qt::AlignHCenter:
+ case QDeclarativeTextInput::AlignHCenter:
hscroll = (q->width() - widthUsed) / 2;
break;
default:
@@ -1260,13 +1368,16 @@ QVariant QDeclarativeTextInput::inputMethodQuery(Qt::InputMethodQuery property)
Q_D(const QDeclarativeTextInput);
switch(property) {
case Qt::ImMicroFocus:
- return d->control->cursorRect();
+ return cursorRectangle();
case Qt::ImFont:
return font();
case Qt::ImCursorPosition:
return QVariant(d->control->cursor());
case Qt::ImSurroundingText:
- return QVariant(text());
+ if (d->control->echoMode() == PasswordEchoOnEdit && !d->control->passwordEchoEditing())
+ return QVariant(displayText());
+ else
+ return QVariant(text());
case Qt::ImCurrentSelection:
return QVariant(selectedText());
case Qt::ImMaximumTextLength:
@@ -1285,6 +1396,7 @@ QVariant QDeclarativeTextInput::inputMethodQuery(Qt::InputMethodQuery property)
/*!
\qmlmethod void TextInput::deselect()
+ \since Quick 1.1
Removes active text selection.
*/
@@ -1305,6 +1417,23 @@ void QDeclarativeTextInput::selectAll()
d->control->setSelection(0, d->control->text().length());
}
+/*!
+ \qmlmethod void TextInput::isRightToLeft(int start, int end)
+
+ Returns true if the natural reading direction of the editor text
+ found between positions \a start and \a end is right to left.
+*/
+bool QDeclarativeTextInput::isRightToLeft(int start, int end)
+{
+ Q_D(QDeclarativeTextInput);
+ if (start > end) {
+ qmlInfo(this) << "isRightToLeft(start, end) called with the end property being smaller than the start.";
+ return false;
+ } else {
+ return d->control->text().mid(start, end - start).isRightToLeft();
+ }
+}
+
#ifndef QT_NO_CLIPBOARD
/*!
\qmlmethod TextInput::cut()
@@ -1466,6 +1595,13 @@ void QDeclarativeTextInput::setMouseSelectionMode(SelectionMode mode)
}
}
+/*!
+ \qmlproperty bool TextInput::canPaste
+ \since QtQuick 1.1
+
+ Returns true if the TextInput is writable and the content of the clipboard is
+ suitable for pasting into the TextEdit.
+*/
bool QDeclarativeTextInput::canPaste() const
{
Q_D(const QDeclarativeTextInput);
@@ -1534,38 +1670,41 @@ void QDeclarativeTextInput::moveCursorSelection(int pos, SelectionMode mode)
anchor = d->control->selectionStart();
if (anchor < pos || (anchor == pos && cursor < pos)) {
- QTextBoundaryFinder finder(QTextBoundaryFinder::Word, d->control->text());
+ const QString text = d->control->text();
+ QTextBoundaryFinder finder(QTextBoundaryFinder::Word, text);
finder.setPosition(anchor);
const QTextBoundaryFinder::BoundaryReasons reasons = finder.boundaryReasons();
- if (!(reasons & QTextBoundaryFinder::StartWord)
- || ((reasons & QTextBoundaryFinder::EndWord) && anchor > cursor)) {
+ if (anchor < text.length() && (!(reasons & QTextBoundaryFinder::StartWord)
+ || ((reasons & QTextBoundaryFinder::EndWord) && anchor > cursor))) {
finder.toPreviousBoundary();
}
- anchor = finder.position();
+ anchor = finder.position() != -1 ? finder.position() : 0;
finder.setPosition(pos);
- if (!finder.isAtBoundary())
+ if (pos > 0 && !finder.boundaryReasons())
finder.toNextBoundary();
+ const int cursor = finder.position() != -1 ? finder.position() : text.length();
- d->control->setSelection(anchor, finder.position() - anchor);
+ d->control->setSelection(anchor, cursor - anchor);
} else if (anchor > pos || (anchor == pos && cursor > pos)) {
- QTextBoundaryFinder finder(QTextBoundaryFinder::Word, d->control->text());
+ const QString text = d->control->text();
+ QTextBoundaryFinder finder(QTextBoundaryFinder::Word, text);
finder.setPosition(anchor);
const QTextBoundaryFinder::BoundaryReasons reasons = finder.boundaryReasons();
- if (!(reasons & QTextBoundaryFinder::EndWord)
- || ((reasons & QTextBoundaryFinder::StartWord) && anchor < cursor)) {
+ if (anchor > 0 && (!(reasons & QTextBoundaryFinder::EndWord)
+ || ((reasons & QTextBoundaryFinder::StartWord) && anchor < cursor))) {
finder.toNextBoundary();
}
-
- anchor = finder.position();
+ anchor = finder.position() != -1 ? finder.position() : text.length();
finder.setPosition(pos);
- if (!finder.isAtBoundary())
+ if (pos < text.length() && !finder.boundaryReasons())
finder.toPreviousBoundary();
+ const int cursor = finder.position() != -1 ? finder.position() : 0;
- d->control->setSelection(anchor, finder.position() - anchor);
+ d->control->setSelection(anchor, cursor - anchor);
}
}
}
@@ -1684,6 +1823,25 @@ void QDeclarativeTextInput::focusInEvent(QFocusEvent *event)
QDeclarativePaintedItem::focusInEvent(event);
}
+/*!
+ \qmlproperty bool TextInput::inputMethodComposing
+
+ \since QtQuick 1.1
+
+ This property holds whether the TextInput has partial text input from an
+ input method.
+
+ While it is composing an input method may rely on mouse or key events from
+ the TextInput to edit or commit the partial text. This property can be
+ used to determine when to disable events handlers that may interfere with
+ the correct operation of an input method.
+*/
+bool QDeclarativeTextInput::isInputMethodComposing() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->control->preeditAreaText().length() > 0;
+}
+
void QDeclarativeTextInputPrivate::init()
{
Q_Q(QDeclarativeTextInput);
@@ -1708,9 +1866,12 @@ void QDeclarativeTextInputPrivate::init()
q, SLOT(q_canPasteChanged()));
q->connect(QApplication::clipboard(), SIGNAL(dataChanged()),
q, SLOT(q_canPasteChanged()));
+ canPaste = !control->isReadOnly() && QApplication::clipboard()->text().length() != 0;
#endif // QT_NO_CLIPBOARD
q->connect(control, SIGNAL(updateMicroFocus()),
q, SLOT(updateMicroFocus()));
+ q->connect(control, SIGNAL(displayTextChanged(QString)),
+ q, SLOT(updateRect()));
q->updateSize();
oldValidity = control->hasAcceptableInput();
lastSelectionStart = 0;
@@ -1718,6 +1879,7 @@ void QDeclarativeTextInputPrivate::init()
QPalette p = control->palette();
selectedTextColor = p.color(QPalette::HighlightedText);
selectionColor = p.color(QPalette::Highlight);
+ determineHorizontalAlignment();
}
void QDeclarativeTextInput::cursorPosChanged()
@@ -1765,6 +1927,7 @@ void QDeclarativeTextInput::q_textChanged()
{
Q_D(QDeclarativeTextInput);
updateSize();
+ d->determineHorizontalAlignment();
d->updateHorizontalScroll();
updateMicroFocus();
emit textChanged();
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
index e1e66a9..8c873b3 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
@@ -70,8 +70,8 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextInput : public QDeclarativeImplicitSizeP
Q_PROPERTY(QColor selectionColor READ selectionColor WRITE setSelectionColor NOTIFY selectionColorChanged)
Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor NOTIFY selectedTextColorChanged)
Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
- Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign NOTIFY horizontalAlignmentChanged)
-
+ Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign RESET resetHAlign NOTIFY horizontalAlignmentChanged)
+ Q_PROPERTY(HAlignment effectiveHorizontalAlignment READ effectiveHAlign NOTIFY effectiveHorizontalAlignmentChanged REVISION 1)
Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly NOTIFY readOnlyChanged)
Q_PROPERTY(bool cursorVisible READ isCursorVisible WRITE setCursorVisible NOTIFY cursorVisibleChanged)
Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition NOTIFY cursorPositionChanged)
@@ -97,6 +97,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextInput : public QDeclarativeImplicitSizeP
Q_PROPERTY(bool selectByMouse READ selectByMouse WRITE setSelectByMouse NOTIFY selectByMouseChanged)
Q_PROPERTY(SelectionMode mouseSelectionMode READ mouseSelectionMode WRITE setMouseSelectionMode NOTIFY mouseSelectionModeChanged REVISION 1)
Q_PROPERTY(bool canPaste READ canPaste NOTIFY canPasteChanged REVISION 1)
+ Q_PROPERTY(bool inputMethodComposing READ isInputMethodComposing NOTIFY inputMethodComposingChanged REVISION 1)
public:
QDeclarativeTextInput(QDeclarativeItem* parent=0);
@@ -120,8 +121,14 @@ public:
SelectWords
};
+ enum CursorPosition {
+ CursorBetweenCharacters,
+ CursorOnCharacter
+ };
+
//Auxilliary functions needed to control the TextInput from QML
Q_INVOKABLE int positionAt(int x) const;
+ Q_INVOKABLE Q_REVISION(1) int positionAt(int x, CursorPosition position) const;
Q_INVOKABLE QRectF positionToRectangle(int pos) const;
Q_INVOKABLE void moveCursorSelection(int pos);
Q_INVOKABLE Q_REVISION(1) void moveCursorSelection(int pos, SelectionMode mode);
@@ -146,6 +153,8 @@ public:
HAlignment hAlign() const;
void setHAlign(HAlignment align);
+ void resetHAlign();
+ HAlignment effectiveHAlign() const;
bool isReadOnly() const;
void setReadOnly(bool);
@@ -204,6 +213,8 @@ public:
QRectF boundingRect() const;
bool canPaste() const;
+ bool isInputMethodComposing() const;
+
Q_SIGNALS:
void textChanged();
void cursorPositionChanged();
@@ -231,6 +242,8 @@ Q_SIGNALS:
void selectByMouseChanged(bool selectByMouse);
Q_REVISION(1) void mouseSelectionModeChanged(SelectionMode mode);
Q_REVISION(1) void canPasteChanged();
+ Q_REVISION(1) void inputMethodComposingChanged();
+ Q_REVISION(1) void effectiveHorizontalAlignmentChanged();
protected:
virtual void geometryChanged(const QRectF &newGeometry,
@@ -251,6 +264,7 @@ public Q_SLOTS:
void selectWord();
void select(int start, int end);
Q_REVISION(1) void deselect();
+ Q_REVISION(1) bool isRightToLeft(int start, int end);
#ifndef QT_NO_CLIPBOARD
void cut();
void copy();
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
index ab2838b..fd4da2e 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
@@ -74,9 +74,9 @@ public:
color((QRgb)0), style(QDeclarativeText::Normal),
styleColor((QRgb)0), hAlign(QDeclarativeTextInput::AlignLeft),
mouseSelectionMode(QDeclarativeTextInput::SelectCharacters),
- hscroll(0), oldScroll(0), focused(false), focusOnPress(true),
+ hscroll(0), oldScroll(0), oldValidity(false), focused(false), focusOnPress(true),
showInputPanelOnFocus(true), clickCausedFocus(false), cursorVisible(false),
- autoScroll(true), selectByMouse(false), canPaste(false)
+ autoScroll(true), selectByMouse(false), canPaste(false), hAlignImplicit(true)
{
#ifdef Q_OS_SYMBIAN
if (QSysInfo::symbianVersion() == QSysInfo::SV_SF_1 || QSysInfo::symbianVersion() == QSysInfo::SV_SF_3) {
@@ -103,6 +103,9 @@ public:
void startCreatingCursor();
void focusChanged(bool hasFocus);
void updateHorizontalScroll();
+ bool determineHorizontalAlignment();
+ bool setHAlign(QDeclarativeTextInput::HAlignment, bool forceAlign = false);
+ void mirrorChange();
int calculateTextWidth();
bool sendMouseEventToInputContext(QGraphicsSceneMouseEvent *event, QEvent::Type eventType);
@@ -125,17 +128,18 @@ public:
int lastSelectionEnd;
int oldHeight;
int oldWidth;
- bool oldValidity;
int hscroll;
int oldScroll;
- bool focused;
- bool focusOnPress;
- bool showInputPanelOnFocus;
- bool clickCausedFocus;
- bool cursorVisible;
- bool autoScroll;
- bool selectByMouse;
- bool canPaste;
+ bool oldValidity:1;
+ bool focused:1;
+ bool focusOnPress:1;
+ bool showInputPanelOnFocus:1;
+ bool clickCausedFocus:1;
+ bool cursorVisible:1;
+ bool autoScroll:1;
+ bool selectByMouse:1;
+ bool canPaste:1;
+ bool hAlignImplicit:1;
static inline QDeclarativeTextInputPrivate *get(QDeclarativeTextInput *t) {
return t->d_func();
diff --git a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp
index b24dd2c..31819f5 100644
--- a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp
@@ -99,7 +99,6 @@ class DrawTextItemRecorder: public QPaintEngine
needFreshCurrentItem = false;
last.numChars += ti.num_chars;
- last.numGlyphs += ti.glyphs.numGlyphs;
}
}
@@ -111,7 +110,7 @@ class DrawTextItemRecorder: public QPaintEngine
currentItem.font = ti.font();
currentItem.charOffset = charOffset;
currentItem.numChars = ti.num_chars;
- currentItem.numGlyphs = ti.glyphs.numGlyphs;
+ currentItem.numGlyphs = 0;
currentItem.glyphOffset = glyphOffset;
currentItem.positionOffset = positionOffset;
currentItem.useBackendOptimizations = m_useBackendOptimizations;
@@ -121,6 +120,8 @@ class DrawTextItemRecorder: public QPaintEngine
m_inertText->items.append(currentItem);
}
+ QStaticTextItem &currentItem = m_inertText->items.last();
+
QTransform matrix = m_untransformedCoordinates ? QTransform() : state->transform();
matrix.translate(position.x(), position.y());
@@ -129,18 +130,18 @@ class DrawTextItemRecorder: public QPaintEngine
ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions);
int size = glyphs.size();
- Q_ASSERT(size == ti.glyphs.numGlyphs);
Q_ASSERT(size == positions.size());
+ currentItem.numGlyphs += size;
m_inertText->glyphs.resize(m_inertText->glyphs.size() + size);
m_inertText->positions.resize(m_inertText->glyphs.size());
m_inertText->chars.resize(m_inertText->chars.size() + ti.num_chars);
glyph_t *glyphsDestination = m_inertText->glyphs.data() + glyphOffset;
- qMemCopy(glyphsDestination, glyphs.constData(), sizeof(glyph_t) * ti.glyphs.numGlyphs);
+ qMemCopy(glyphsDestination, glyphs.constData(), sizeof(glyph_t) * size);
QFixedPoint *positionsDestination = m_inertText->positions.data() + positionOffset;
- qMemCopy(positionsDestination, positions.constData(), sizeof(QFixedPoint) * ti.glyphs.numGlyphs);
+ qMemCopy(positionsDestination, positions.constData(), sizeof(QFixedPoint) * size);
QChar *charsDestination = m_inertText->chars.data() + charOffset;
qMemCopy(charsDestination, ti.chars, sizeof(QChar) * ti.num_chars);
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
index b3aaec7..276f790 100644
--- a/src/declarative/qml/qdeclarativecomponent.cpp
+++ b/src/declarative/qml/qdeclarativecomponent.cpp
@@ -615,10 +615,11 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, Q
}
/*!
- \qmlmethod object Component::createObject(Item parent, Script valuemap = null)
+ \qmlmethod object Component::createObject(Item parent, object properties)
- Creates and returns an object instance of this component that will have the given
- \a parent. Returns null if object creation fails.
+ Creates and returns an object instance of this component that will have
+ the given \a parent and \a properties. The \a properties argument is optional.
+ Returns null if object creation fails.
The object will be created in the same context as the one in which the component
was created. This function will always return null when called on components
@@ -630,14 +631,23 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, Q
property, or else the object will not be visible.
If a \a parent is not provided to createObject(), a reference to the returned object must be held so that
- it is not destroyed by the garbage collector. This is regardless of Item.parent being set afterwards,
+ it is not destroyed by the garbage collector. This is true regardless of whether \l{Item::parent} is set afterwards,
since setting the Item parent does not change object ownership; only the graphical parent is changed.
- Since QtQuick 1.1, a map of property values can be optionally passed to the method that applies values to the object's properties
- before its creation is finalised. This will avoid binding issues that can occur when the object is
- instantiated before property bindings have been set. For example:
+ As of QtQuick 1.1, this method accepts an optional \a properties argument that specifies a
+ map of initial property values for the created object. These values are applied before object
+ creation is finalized. (This is more efficient than setting property values after object creation,
+ particularly where large sets of property values are defined, and also allows property bindings
+ to be set up before the object is created.)
- \code component.createObject(parent, {"x": 100, "y": 100, "specialProperty": someObject}); \endcode
+ The \a properties argument is specified as a map of property-value items. For example, the code
+ below creates an object with initial \c x and \c y values of 100 and 200, respectively:
+
+ \js
+ var component = Qt.createComponent("Button.qml");
+ if (component.status == Component.Ready)
+ component.createObject(parent, {"x": 100, "y": 100});
+ \endjs
Dynamically created instances can be deleted with the \c destroy() method.
See \l {Dynamic Object Management in QML} for more information.
diff --git a/src/declarative/qml/qdeclarativescriptparser.cpp b/src/declarative/qml/qdeclarativescriptparser.cpp
index 996920a..d9e3ebf 100644
--- a/src/declarative/qml/qdeclarativescriptparser.cpp
+++ b/src/declarative/qml/qdeclarativescriptparser.cpp
@@ -776,7 +776,10 @@ bool ProcessAST::visit(AST::UiSourceElement *node)
f = f->finish();
}
- QString body = textAt(funDecl->lbraceToken, funDecl->rbraceToken);
+ AST::SourceLocation loc = funDecl->rparenToken;
+ loc.offset = loc.end();
+ loc.startColumn += 1;
+ QString body = textAt(loc, funDecl->rbraceToken);
slot.name = funDecl->name->asString().toUtf8();
slot.body = body;
obj->dynamicSlots << slot;
@@ -937,7 +940,7 @@ QDeclarativeParser::Object::ScriptBlock::Pragmas QDeclarativeScriptParser::extra
if (l.currentLineNo() == startLine)
return rv;
- if (pragmaValue == QLatin1String("library")) {
+ if (pragmaValue == library) {
rv |= QDeclarativeParser::Object::ScriptBlock::Shared;
replaceWithSpace(script, startOffset, endOffset - startOffset);
} else {
diff --git a/src/declarative/qml/qdeclarativetypenamescriptclass.cpp b/src/declarative/qml/qdeclarativetypenamescriptclass.cpp
index d3e2025..0314a7a 100644
--- a/src/declarative/qml/qdeclarativetypenamescriptclass.cpp
+++ b/src/declarative/qml/qdeclarativetypenamescriptclass.cpp
@@ -158,7 +158,7 @@ void QDeclarativeTypeNameScriptClass::setProperty(Object *o, const Identifier &n
Q_ASSERT(!type);
QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
- ep->objectClass->setProperty(((TypeNameData *)o)->object, n, v, context());
+ ep->objectClass->setProperty(object, n, v, context());
}
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativevme.cpp b/src/declarative/qml/qdeclarativevme.cpp
index 2d551f2..781e1b8 100644
--- a/src/declarative/qml/qdeclarativevme.cpp
+++ b/src/declarative/qml/qdeclarativevme.cpp
@@ -127,6 +127,22 @@ void QDeclarativeVME::runDeferred(QObject *object)
run(stack, ctxt, comp, start, count, QBitField());
}
+inline bool fastHasBinding(QObject *o, int index)
+{
+ QDeclarativeData *ddata = static_cast<QDeclarativeData *>(QObjectPrivate::get(o)->declarativeData);
+
+ return ddata && (ddata->bindingBitsSize > index) &&
+ (ddata->bindingBits[index / 32] & (1 << (index % 32)));
+}
+
+static void removeBindingOnProperty(QObject *o, int index)
+{
+ QDeclarativeAbstractBinding *binding = QDeclarativePropertyPrivate::setBinding(o, index, -1, 0);
+ if (binding) binding->destroy();
+}
+
+#define CLEAN_PROPERTY(o, index) if (fastHasBinding(o, index)) removeBindingOnProperty(o, index)
+
QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
QDeclarativeContextData *ctxt,
QDeclarativeCompiledData *comp,
@@ -336,6 +352,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
case QDeclarativeInstruction::StoreVariant:
{
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeString.propertyIndex);
+
// XXX - can be more efficient
QVariant v = QDeclarativeStringConverters::variantFromString(primitives.at(instr.storeString.value));
void *a[] = { &v, 0, &status, &flags };
@@ -347,6 +365,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
case QDeclarativeInstruction::StoreVariantInteger:
{
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeString.propertyIndex);
+
QVariant v(instr.storeInteger.value);
void *a[] = { &v, 0, &status, &flags };
QMetaObject::metacall(target, QMetaObject::WriteProperty,
@@ -357,6 +377,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
case QDeclarativeInstruction::StoreVariantDouble:
{
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeString.propertyIndex);
+
QVariant v(instr.storeDouble.value);
void *a[] = { &v, 0, &status, &flags };
QMetaObject::metacall(target, QMetaObject::WriteProperty,
@@ -367,6 +389,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
case QDeclarativeInstruction::StoreVariantBool:
{
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeString.propertyIndex);
+
QVariant v(instr.storeBool.value);
void *a[] = { &v, 0, &status, &flags };
QMetaObject::metacall(target, QMetaObject::WriteProperty,
@@ -377,6 +401,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
case QDeclarativeInstruction::StoreString:
{
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeString.propertyIndex);
+
void *a[] = { (void *)&primitives.at(instr.storeString.value), 0, &status, &flags };
QMetaObject::metacall(target, QMetaObject::WriteProperty,
instr.storeString.propertyIndex, a);
@@ -386,6 +412,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
case QDeclarativeInstruction::StoreUrl:
{
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeUrl.propertyIndex);
+
void *a[] = { (void *)&urls.at(instr.storeUrl.value), 0, &status, &flags };
QMetaObject::metacall(target, QMetaObject::WriteProperty,
instr.storeUrl.propertyIndex, a);
@@ -395,6 +423,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
case QDeclarativeInstruction::StoreFloat:
{
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeFloat.propertyIndex);
+
float f = instr.storeFloat.value;
void *a[] = { &f, 0, &status, &flags };
QMetaObject::metacall(target, QMetaObject::WriteProperty,
@@ -405,6 +435,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
case QDeclarativeInstruction::StoreDouble:
{
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeDouble.propertyIndex);
+
double d = instr.storeDouble.value;
void *a[] = { &d, 0, &status, &flags };
QMetaObject::metacall(target, QMetaObject::WriteProperty,
@@ -415,6 +447,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
case QDeclarativeInstruction::StoreBool:
{
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeBool.propertyIndex);
+
void *a[] = { (void *)&instr.storeBool.value, 0, &status, &flags };
QMetaObject::metacall(target, QMetaObject::WriteProperty,
instr.storeBool.propertyIndex, a);
@@ -424,6 +458,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
case QDeclarativeInstruction::StoreInteger:
{
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeInteger.propertyIndex);
+
void *a[] = { (void *)&instr.storeInteger.value, 0, &status, &flags };
QMetaObject::metacall(target, QMetaObject::WriteProperty,
instr.storeInteger.propertyIndex, a);
@@ -433,6 +469,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
case QDeclarativeInstruction::StoreColor:
{
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeColor.propertyIndex);
+
QColor c = QColor::fromRgba(instr.storeColor.value);
void *a[] = { &c, 0, &status, &flags };
QMetaObject::metacall(target, QMetaObject::WriteProperty,
@@ -443,6 +481,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
case QDeclarativeInstruction::StoreDate:
{
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeDate.propertyIndex);
+
QDate d = QDate::fromJulianDay(instr.storeDate.value);
void *a[] = { &d, 0, &status, &flags };
QMetaObject::metacall(target, QMetaObject::WriteProperty,
@@ -453,6 +493,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
case QDeclarativeInstruction::StoreTime:
{
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeTime.propertyIndex);
+
QTime t;
t.setHMS(intData.at(instr.storeTime.valueIndex),
intData.at(instr.storeTime.valueIndex+1),
@@ -467,6 +509,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
case QDeclarativeInstruction::StoreDateTime:
{
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeDateTime.propertyIndex);
+
QTime t;
t.setHMS(intData.at(instr.storeDateTime.valueIndex+1),
intData.at(instr.storeDateTime.valueIndex+2),
@@ -482,6 +526,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
case QDeclarativeInstruction::StorePoint:
{
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeRealPair.propertyIndex);
+
QPoint p = QPointF(floatData.at(instr.storeRealPair.valueIndex),
floatData.at(instr.storeRealPair.valueIndex+1)).toPoint();
void *a[] = { &p, 0, &status, &flags };
@@ -493,6 +539,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
case QDeclarativeInstruction::StorePointF:
{
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeRealPair.propertyIndex);
+
QPointF p(floatData.at(instr.storeRealPair.valueIndex),
floatData.at(instr.storeRealPair.valueIndex+1));
void *a[] = { &p, 0, &status, &flags };
@@ -504,6 +552,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
case QDeclarativeInstruction::StoreSize:
{
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeRealPair.propertyIndex);
+
QSize p = QSizeF(floatData.at(instr.storeRealPair.valueIndex),
floatData.at(instr.storeRealPair.valueIndex+1)).toSize();
void *a[] = { &p, 0, &status, &flags };
@@ -515,6 +565,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
case QDeclarativeInstruction::StoreSizeF:
{
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeRealPair.propertyIndex);
+
QSizeF s(floatData.at(instr.storeRealPair.valueIndex),
floatData.at(instr.storeRealPair.valueIndex+1));
void *a[] = { &s, 0, &status, &flags };
@@ -526,6 +578,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
case QDeclarativeInstruction::StoreRect:
{
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeRect.propertyIndex);
+
QRect r = QRectF(floatData.at(instr.storeRect.valueIndex),
floatData.at(instr.storeRect.valueIndex+1),
floatData.at(instr.storeRect.valueIndex+2),
@@ -539,6 +593,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
case QDeclarativeInstruction::StoreRectF:
{
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeRect.propertyIndex);
+
QRectF r(floatData.at(instr.storeRect.valueIndex),
floatData.at(instr.storeRect.valueIndex+1),
floatData.at(instr.storeRect.valueIndex+2),
@@ -552,6 +608,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
case QDeclarativeInstruction::StoreVector3D:
{
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeVector3D.propertyIndex);
+
QVector3D p(floatData.at(instr.storeVector3D.valueIndex),
floatData.at(instr.storeVector3D.valueIndex+1),
floatData.at(instr.storeVector3D.valueIndex+2));
@@ -565,6 +623,7 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
{
QObject *assignObj = stack.pop();
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeObject.propertyIndex);
void *a[] = { (void *)&assignObj, 0, &status, &flags };
QMetaObject::metacall(target, QMetaObject::WriteProperty,
@@ -576,6 +635,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
case QDeclarativeInstruction::AssignCustomType:
{
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.assignCustomType.propertyIndex);
+
QDeclarativeCompiledData::CustomTypeData data = customTypeData.at(instr.assignCustomType.valueIndex);
const QString &primitive = primitives.at(data.index);
QDeclarativeMetaType::StringConverter converter =
@@ -780,6 +841,7 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
{
QObject *assign = stack.pop();
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeObject.propertyIndex);
QVariant v = QVariant::fromValue(assign);
void *a[] = { &v, 0, &status, &flags };
@@ -792,6 +854,7 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
{
QObject *assign = stack.pop();
QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeObject.propertyIndex);
int coreIdx = instr.storeObject.propertyIndex;
QMetaProperty prop = target->metaObject()->property(coreIdx);
diff --git a/src/declarative/qml/qdeclarativeworkerscript.cpp b/src/declarative/qml/qdeclarativeworkerscript.cpp
index f8d52b5..1ff0caa 100644
--- a/src/declarative/qml/qdeclarativeworkerscript.cpp
+++ b/src/declarative/qml/qdeclarativeworkerscript.cpp
@@ -313,7 +313,7 @@ void QDeclarativeWorkerScriptEnginePrivate::processLoad(int id, const QUrl &url)
QScriptContext *ctxt = QScriptDeclarativeClass::pushCleanContext(workerEngine);
QScriptValue urlContext = workerEngine->newObject();
- urlContext.setData(QScriptValue(workerEngine, fileName));
+ urlContext.setData(QScriptValue(workerEngine, url.toString()));
ctxt->pushScope(urlContext);
ctxt->pushScope(activation);
ctxt->setActivationObject(activation);
diff --git a/src/declarative/util/qdeclarativeopenmetaobject.cpp b/src/declarative/util/qdeclarativeopenmetaobject.cpp
index 0ceda35..8a8d05e 100644
--- a/src/declarative/util/qdeclarativeopenmetaobject.cpp
+++ b/src/declarative/util/qdeclarativeopenmetaobject.cpp
@@ -289,17 +289,19 @@ void QDeclarativeOpenMetaObject::setValue(const QByteArray &name, const QVariant
int id = -1;
if (iter == d->type->d->names.end()) {
- id = d->type->createProperty(name.constData()) - d->type->d->propertyOffset;
+ id = createProperty(name.constData(), "") - d->type->d->propertyOffset;
} else {
id = *iter;
}
- QVariant &dataVal = d->getData(id);
- if (dataVal == val)
- return;
+ if (id >= 0) {
+ QVariant &dataVal = d->getData(id);
+ if (dataVal == val)
+ return;
- dataVal = val;
- activate(d->object, id + d->type->d->signalOffset, 0);
+ dataVal = val;
+ activate(d->object, id + d->type->d->signalOffset, 0);
+ }
}
// returns true if this value has been initialized by a call to either value() or setValue()
diff --git a/src/declarative/util/qdeclarativepropertymap.cpp b/src/declarative/util/qdeclarativepropertymap.cpp
index 1a3e0be..915f027 100644
--- a/src/declarative/util/qdeclarativepropertymap.cpp
+++ b/src/declarative/util/qdeclarativepropertymap.cpp
@@ -182,7 +182,18 @@ QVariant QDeclarativePropertyMap::value(const QString &key) const
void QDeclarativePropertyMap::insert(const QString &key, const QVariant &value)
{
Q_D(QDeclarativePropertyMap);
- d->mo->setValue(key.toUtf8(), value);
+ //The following strings shouldn't be used as property names
+ if (key != QLatin1String("keys")
+ && key != QLatin1String("valueChanged")
+ && key != QLatin1String("QObject")
+ && key != QLatin1String("destroyed")
+ && key != QLatin1String("deleteLater")) {
+ d->mo->setValue(key.toUtf8(), value);
+ } else {
+ qWarning() << "Creating property with name"
+ << key
+ << "is not permitted, conflicts with internal symbols.";
+ }
}
/*!
@@ -258,7 +269,7 @@ QVariant &QDeclarativePropertyMap::operator[](const QString &key)
Q_D(QDeclarativePropertyMap);
QByteArray utf8key = key.toUtf8();
if (!d->keys.contains(key))
- d->mo->setValue(utf8key, QVariant()); //force creation -- needed below
+ insert(key, QVariant());//force creation -- needed below
return (*(d->mo))[utf8key];
}
diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp
index de61169..dcc078d 100644
--- a/src/declarative/util/qdeclarativeview.cpp
+++ b/src/declarative/util/qdeclarativeview.cpp
@@ -293,6 +293,13 @@ void QDeclarativeViewPrivate::init()
q->setFocusPolicy(Qt::StrongFocus);
q->scene()->setStickyFocus(true); //### needed for correct focus handling
+
+#ifdef QDECLARATIVEVIEW_NOBACKGROUND
+ q->setAttribute(Qt::WA_OpaquePaintEvent);
+ q->setAttribute(Qt::WA_NoSystemBackground);
+ q->viewport()->setAttribute(Qt::WA_OpaquePaintEvent);
+ q->viewport()->setAttribute(Qt::WA_NoSystemBackground);
+#endif
}
/*!
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 265029b..d51fdfe 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -417,6 +417,11 @@
click focus to items underneath when being clicked on. This flag
allows you create a non-focusable item that can be clicked on without
changing the focus. \endomit
+
+ \omitvalue ItemStopsFocusHandling \omit Same as
+ ItemStopsClickFocusPropagation, but also suppresses focus-out. This flag
+ allows you to completely take over focus handling.
+ This flag was introduced in Qt 4.7. \endomit
*/
/*!
@@ -5579,8 +5584,10 @@ void QGraphicsItemPrivate::setSubFocus(QGraphicsItem *rootItem, QGraphicsItem *s
parent->d_ptr->subFocusItemChange();
} while (!parent->isPanel() && (parent = parent->d_ptr->parent) && (visible || !parent->d_ptr->visible));
- if (scene && !scene->isActive())
+ if (scene && !scene->isActive()) {
+ scene->d_func()->passiveFocusItem = subFocusItem;
scene->d_func()->lastFocusItem = subFocusItem;
+ }
}
/*!
@@ -11551,6 +11558,9 @@ QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemFlag flag)
case QGraphicsItem::ItemStopsClickFocusPropagation:
str = "ItemStopsClickFocusPropagation";
break;
+ case QGraphicsItem::ItemStopsFocusHandling:
+ str = "ItemStopsFocusHandling";
+ break;
}
debug << str;
return debug;
diff --git a/src/gui/graphicsview/qgraphicsitem.h b/src/gui/graphicsview/qgraphicsitem.h
index e59a7c9..67c9cd3 100644
--- a/src/gui/graphicsview/qgraphicsitem.h
+++ b/src/gui/graphicsview/qgraphicsitem.h
@@ -107,7 +107,8 @@ public:
ItemIsPanel = 0x4000,
ItemIsFocusScope = 0x8000, // internal
ItemSendsScenePositionChanges = 0x10000,
- ItemStopsClickFocusPropagation = 0x20000
+ ItemStopsClickFocusPropagation = 0x20000,
+ ItemStopsFocusHandling = 0x40000
// NB! Don't forget to increase the d_ptr->flags bit field by 1 when adding a new flag.
};
Q_DECLARE_FLAGS(GraphicsItemFlags, GraphicsItemFlag)
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index 5c82116..90ff43f 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -559,7 +559,7 @@ public:
quint32 dirtyChildrenBoundingRect : 1;
// Packed 32 bits
- quint32 flags : 18;
+ quint32 flags : 19;
quint32 paintedViewBoundingRectsNeedRepaint : 1;
quint32 dirtySceneTransform : 1;
quint32 geometryChanged : 1;
@@ -573,9 +573,9 @@ public:
quint32 sceneTransformTranslateOnly : 1;
quint32 notifyBoundingRectChanged : 1;
quint32 notifyInvalidated : 1;
- quint32 mouseSetsFocus : 1;
// New 32 bits
+ quint32 mouseSetsFocus : 1;
quint32 explicitActivate : 1;
quint32 wantsActive : 1;
quint32 holesInSiblingIndex : 1;
@@ -586,7 +586,7 @@ public:
quint32 mayHaveChildWithGraphicsEffect : 1;
quint32 isDeclarativeItem : 1;
quint32 sendParentChangeNotification : 1;
- quint32 padding : 22;
+ quint32 padding : 21;
// Optional stacking order
int globalStackingOrder;
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index f997fc2..85a4e16 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -306,6 +306,7 @@ QGraphicsScenePrivate::QGraphicsScenePrivate()
rectAdjust(2),
focusItem(0),
lastFocusItem(0),
+ passiveFocusItem(0),
tabFocusFirst(0),
activePanel(0),
lastActivePanel(0),
@@ -630,6 +631,8 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item)
focusItem = 0;
if (item == lastFocusItem)
lastFocusItem = 0;
+ if (item == passiveFocusItem)
+ passiveFocusItem = 0;
if (item == activePanel) {
// ### deactivate...
activePanel = 0;
@@ -1317,8 +1320,10 @@ void QGraphicsScenePrivate::mousePressEventHandler(QGraphicsSceneMouseEvent *mou
// Set focus on the topmost enabled item that can take focus.
bool setFocus = false;
+
foreach (QGraphicsItem *item, cachedItemsUnderMouse) {
- if (item->isBlockedByModalPanel()) {
+ if (item->isBlockedByModalPanel()
+ || (item->d_ptr->flags & QGraphicsItem::ItemStopsFocusHandling)) {
// Make sure we don't clear focus.
setFocus = true;
break;
@@ -1331,10 +1336,10 @@ void QGraphicsScenePrivate::mousePressEventHandler(QGraphicsSceneMouseEvent *mou
break;
}
}
- if (item->d_ptr->flags & QGraphicsItem::ItemStopsClickFocusPropagation)
- break;
if (item->isPanel())
break;
+ if (item->d_ptr->flags & QGraphicsItem::ItemStopsClickFocusPropagation)
+ break;
}
// Check for scene modality.
@@ -2980,7 +2985,7 @@ void QGraphicsScene::removeItem(QGraphicsItem *item)
QGraphicsItem *QGraphicsScene::focusItem() const
{
Q_D(const QGraphicsScene);
- return isActive() ? d->focusItem : d->lastFocusItem;
+ return isActive() ? d->focusItem : d->passiveFocusItem;
}
/*!
@@ -3054,6 +3059,7 @@ void QGraphicsScene::clearFocus()
Q_D(QGraphicsScene);
if (d->hasFocus) {
d->hasFocus = false;
+ d->passiveFocusItem = d->focusItem;
setFocusItem(0, Qt::OtherFocusReason);
}
}
@@ -3756,9 +3762,9 @@ void QGraphicsScene::focusInEvent(QFocusEvent *focusEvent)
focusEvent->ignore();
break;
default:
- if (d->lastFocusItem) {
+ if (d->passiveFocusItem) {
// Set focus on the last focus item
- setFocusItem(d->lastFocusItem, focusEvent->reason());
+ setFocusItem(d->passiveFocusItem, focusEvent->reason());
}
break;
}
@@ -3777,6 +3783,7 @@ void QGraphicsScene::focusOutEvent(QFocusEvent *focusEvent)
{
Q_D(QGraphicsScene);
d->hasFocus = false;
+ d->passiveFocusItem = d->focusItem;
setFocusItem(0, focusEvent->reason());
// Remove all popups when the scene loses focus.
@@ -5925,6 +5932,7 @@ bool QGraphicsScenePrivate::sendTouchBeginEvent(QGraphicsItem *origin, QTouchEve
// Set focus on the topmost enabled item that can take focus.
bool setFocus = false;
+
foreach (QGraphicsItem *item, cachedItemsUnderMouse) {
if (item->isEnabled() && ((item->flags() & QGraphicsItem::ItemIsFocusable) && item->d_ptr->mouseSetsFocus)) {
if (!item->isWidget() || ((QGraphicsWidget *)item)->focusPolicy() & Qt::ClickFocus) {
@@ -5938,6 +5946,11 @@ bool QGraphicsScenePrivate::sendTouchBeginEvent(QGraphicsItem *origin, QTouchEve
break;
if (item->d_ptr->flags & QGraphicsItem::ItemStopsClickFocusPropagation)
break;
+ if (item->d_ptr->flags & QGraphicsItem::ItemStopsFocusHandling) {
+ // Make sure we don't clear focus.
+ setFocus = true;
+ break;
+ }
}
// If nobody could take focus, clear it.
@@ -5970,7 +5983,8 @@ bool QGraphicsScenePrivate::sendTouchBeginEvent(QGraphicsItem *origin, QTouchEve
}
if (item && item->isPanel())
break;
- if (item && (item->d_ptr->flags & QGraphicsItem::ItemStopsClickFocusPropagation))
+ if (item && (item->d_ptr->flags
+ & (QGraphicsItem::ItemStopsClickFocusPropagation | QGraphicsItem::ItemStopsFocusHandling)))
break;
}
diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h
index 815c70b..2b47105 100644
--- a/src/gui/graphicsview/qgraphicsscene_p.h
+++ b/src/gui/graphicsview/qgraphicsscene_p.h
@@ -150,6 +150,7 @@ public:
quint32 rectAdjust;
QGraphicsItem *focusItem;
QGraphicsItem *lastFocusItem;
+ QGraphicsItem *passiveFocusItem;
QGraphicsWidget *tabFocusFirst;
QGraphicsItem *activePanel;
QGraphicsItem *lastActivePanel;
diff --git a/src/gui/image/image.pri b/src/gui/image/image.pri
index f89706c..00dccbe 100644
--- a/src/gui/image/image.pri
+++ b/src/gui/image/image.pri
@@ -28,7 +28,10 @@ HEADERS += \
image/qpixmapdata_p.h \
image/qpixmapdatafactory_p.h \
image/qpixmapfilter_p.h \
- image/qimagepixmapcleanuphooks_p.h
+ image/qimagepixmapcleanuphooks_p.h \
+ image/qvolatileimage_p.h \
+ image/qvolatileimagedata_p.h \
+ image/qnativeimagehandleprovider_p.h
SOURCES += \
image/qbitmap.cpp \
@@ -51,7 +54,8 @@ SOURCES += \
image/qmovie.cpp \
image/qpixmap_raster.cpp \
image/qnativeimage.cpp \
- image/qimagepixmapcleanuphooks.cpp
+ image/qimagepixmapcleanuphooks.cpp \
+ image/qvolatileimage.cpp
win32 {
SOURCES += image/qpixmap_win.cpp
@@ -72,6 +76,13 @@ else:symbian {
SOURCES += image/qpixmap_s60.cpp
}
+!symbian|contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2) {
+ SOURCES += image/qvolatileimagedata.cpp
+}
+else {
+ SOURCES += image/qvolatileimagedata_symbian.cpp
+}
+
# Built-in image format support
HEADERS += \
image/qbmphandler_p.h \
diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp
index 1fa1058..e7b1000 100644
--- a/src/gui/image/qimagereader.cpp
+++ b/src/gui/image/qimagereader.cpp
@@ -1482,6 +1482,9 @@ QByteArray QImageReader::imageFormat(QIODevice *device)
configure script or check the appropriate option in the graphical
installer.
+ Note that the QApplication instance must be created before this function is
+ called.
+
\sa setFormat(), QImageWriter::supportedImageFormats(), QImageIOPlugin
*/
QList<QByteArray> QImageReader::supportedImageFormats()
diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp
index 8a65ac0..504260a 100644
--- a/src/gui/image/qimagewriter.cpp
+++ b/src/gui/image/qimagewriter.cpp
@@ -679,6 +679,9 @@ bool QImageWriter::supportsOption(QImageIOHandler::ImageOption option) const
Reading and writing SVG files is supported through Qt's
\l{QtSvg Module}{SVG Module}.
+ Note that the QApplication instance must be created before this function is
+ called.
+
\sa setFormat(), QImageReader::supportedImageFormats(), QImageIOPlugin
*/
QList<QByteArray> QImageWriter::supportedImageFormats()
diff --git a/src/gui/image/qnativeimagehandleprovider_p.h b/src/gui/image/qnativeimagehandleprovider_p.h
new file mode 100644
index 0000000..4e6ed38
--- /dev/null
+++ b/src/gui/image/qnativeimagehandleprovider_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 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 QNATIVEIMAGEHANDLEPROVIDER_P_H
+#define QNATIVEIMAGEHANDLEPROVIDER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qstring.h>
+
+QT_BEGIN_NAMESPACE
+
+class QNativeImageHandleProvider
+{
+public:
+ virtual void get(void **handle, QString *type) = 0;
+ virtual void release(void *handle, const QString &type) = 0;
+};
+
+QT_END_NAMESPACE
+
+#endif // QNATIVEIMAGEHANDLEPROVIDER_P_H
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 0aefafb..1a83318 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -1997,7 +1997,7 @@ void QPixmap::detach()
}
if (data->is_cached && data->ref == 1)
- QImagePixmapCleanupHooks::executePixmapDataModificationHooks(pd);
+ QImagePixmapCleanupHooks::executePixmapDataModificationHooks(data.data());
#if defined(Q_WS_MAC)
QMacPixmapData *macData = id == QPixmapData::MacClass ? static_cast<QMacPixmapData*>(pd) : 0;
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp
index 368600f..5e0ffa8 100644
--- a/src/gui/image/qpixmap_raster.cpp
+++ b/src/gui/image/qpixmap_raster.cpp
@@ -380,6 +380,9 @@ int QRasterPixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const
void QRasterPixmapData::createPixmapForImage(QImage &sourceImage, Qt::ImageConversionFlags flags, bool inPlace)
{
QImage::Format format;
+ if (flags & Qt::NoFormatConversion)
+ format = sourceImage.format();
+ else
#ifdef Q_WS_QWS
if (pixelType() == BitmapType) {
format = QImage::Format_Mono;
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp
index ca5f133..32d8dd7 100644
--- a/src/gui/image/qpixmap_s60.cpp
+++ b/src/gui/image/qpixmap_s60.cpp
@@ -374,6 +374,8 @@ CFbsBitmap *QPixmap::toSymbianCFbsBitmap() const
To be sure that QPixmap does not modify your original instance, you should
make a copy of your \c CFbsBitmap before calling this function.
If the CFbsBitmap is not valid this function will return a null QPixmap.
+ For performance reasons it is recommended to use a \a bitmap with a display
+ mode of EColor16MAP or EColor16MU whenever possible.
\warning This function is only available on Symbian OS.
@@ -599,6 +601,9 @@ bool QS60PixmapData::scroll(int dx, int dy, const QRect &rect)
return res;
}
+Q_GUI_EXPORT int qt_defaultDpiX();
+Q_GUI_EXPORT int qt_defaultDpiY();
+
int QS60PixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const
{
if (!cfbsBitmap)
@@ -609,28 +614,18 @@ int QS60PixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const
return cfbsBitmap->SizeInPixels().iWidth;
case QPaintDevice::PdmHeight:
return cfbsBitmap->SizeInPixels().iHeight;
- case QPaintDevice::PdmWidthMM: {
- TInt twips = cfbsBitmap->SizeInTwips().iWidth;
- return (int)(twips * (25.4/KTwipsPerInch));
- }
- case QPaintDevice::PdmHeightMM: {
- TInt twips = cfbsBitmap->SizeInTwips().iHeight;
- return (int)(twips * (25.4/KTwipsPerInch));
- }
+ case QPaintDevice::PdmWidthMM:
+ return qRound(cfbsBitmap->SizeInPixels().iWidth * 25.4 / qt_defaultDpiX());
+ case QPaintDevice::PdmHeightMM:
+ return qRound(cfbsBitmap->SizeInPixels().iHeight * 25.4 / qt_defaultDpiY());
case QPaintDevice::PdmNumColors:
return TDisplayModeUtils::NumDisplayModeColors(cfbsBitmap->DisplayMode());
case QPaintDevice::PdmDpiX:
- case QPaintDevice::PdmPhysicalDpiX: {
- TReal inches = cfbsBitmap->SizeInTwips().iWidth / (TReal)KTwipsPerInch;
- TInt pixels = cfbsBitmap->SizeInPixels().iWidth;
- return pixels / inches;
- }
+ case QPaintDevice::PdmPhysicalDpiX:
+ return qt_defaultDpiX();
case QPaintDevice::PdmDpiY:
- case QPaintDevice::PdmPhysicalDpiY: {
- TReal inches = cfbsBitmap->SizeInTwips().iHeight / (TReal)KTwipsPerInch;
- TInt pixels = cfbsBitmap->SizeInPixels().iHeight;
- return pixels / inches;
- }
+ case QPaintDevice::PdmPhysicalDpiY:
+ return qt_defaultDpiY();
case QPaintDevice::PdmDepth:
return TDisplayModeUtils::NumDisplayModeBitsPerPixel(cfbsBitmap->DisplayMode());
default:
diff --git a/src/gui/image/qpixmapdata_p.h b/src/gui/image/qpixmapdata_p.h
index 7699344..0d0d417 100644
--- a/src/gui/image/qpixmapdata_p.h
+++ b/src/gui/image/qpixmapdata_p.h
@@ -71,7 +71,9 @@ public:
#if defined(Q_OS_SYMBIAN)
enum NativeType {
FbsBitmap,
- SgImage
+ SgImage,
+ VolatileImage,
+ NativeImageHandleProvider
};
#endif
enum ClassId { RasterClass, X11Class, MacClass, DirectFBClass,
diff --git a/src/gui/image/qvolatileimage.cpp b/src/gui/image/qvolatileimage.cpp
new file mode 100644
index 0000000..098e9a1
--- /dev/null
+++ b/src/gui/image/qvolatileimage.cpp
@@ -0,0 +1,318 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 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 "qvolatileimage_p.h"
+#include "qvolatileimagedata_p.h"
+#include <QtGui/private/qpaintengine_raster_p.h>
+#include <QtGui/private/qpixmapdata_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QVolatileImagePaintEnginePrivate : public QRasterPaintEnginePrivate
+{
+public:
+ QVolatileImagePaintEnginePrivate() { }
+ QVolatileImage *img;
+};
+
+class QVolatileImagePaintEngine : public QRasterPaintEngine
+{
+ Q_DECLARE_PRIVATE(QVolatileImagePaintEngine)
+
+public:
+ QVolatileImagePaintEngine(QPaintDevice *device, QVolatileImage *img);
+ bool begin(QPaintDevice *device);
+ bool end();
+ void drawPixmap(const QPointF &p, const QPixmap &pm);
+ void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr);
+};
+
+QVolatileImage::QVolatileImage()
+ : d(new QVolatileImageData)
+{
+}
+
+QVolatileImage::QVolatileImage(int w, int h, QImage::Format format)
+ : d(new QVolatileImageData(w, h, format))
+{
+}
+
+QVolatileImage::QVolatileImage(const QImage &sourceImage)
+ : d(new QVolatileImageData(sourceImage))
+{
+}
+
+QVolatileImage::QVolatileImage(void *nativeImage, void *nativeMask)
+ : d(new QVolatileImageData(nativeImage, nativeMask))
+{
+}
+
+// Need non-inline, non-autogenerated copy ctor, dtor, op= to keep the
+// fwd declared QSharedData working.
+
+QVolatileImage::QVolatileImage(const QVolatileImage &other)
+ : d(other.d)
+{
+}
+
+QVolatileImage::~QVolatileImage()
+{
+}
+
+QVolatileImage &QVolatileImage::operator=(const QVolatileImage &rhs)
+{
+ d = rhs.d;
+ return *this;
+}
+
+bool QVolatileImage::isNull() const
+{
+ return d->image.isNull();
+}
+
+QImage::Format QVolatileImage::format() const
+{
+ return d->image.format();
+}
+
+int QVolatileImage::width() const
+{
+ return d->image.width();
+}
+
+int QVolatileImage::height() const
+{
+ return d->image.height();
+}
+
+int QVolatileImage::bytesPerLine() const
+{
+ return d->image.bytesPerLine();
+}
+
+int QVolatileImage::byteCount() const
+{
+ return d->image.byteCount();
+}
+
+int QVolatileImage::depth() const
+{
+ return d->image.depth();
+}
+
+bool QVolatileImage::hasAlphaChannel() const
+{
+ return d->image.hasAlphaChannel();
+}
+
+void QVolatileImage::beginDataAccess() const
+{
+ d->beginDataAccess();
+}
+
+void QVolatileImage::endDataAccess(bool readOnly) const
+{
+ d->endDataAccess(readOnly);
+}
+
+/*!
+ Access to pixel data via bits() or constBits() should be guarded by
+ begin/endDataAccess().
+ */
+uchar *QVolatileImage::bits()
+{
+ return d->image.bits();
+}
+
+const uchar *QVolatileImage::constBits() const
+{
+ return d->image.constBits();
+}
+
+bool QVolatileImage::ensureFormat(QImage::Format format)
+{
+ return d->ensureFormat(format);
+}
+
+/*!
+ This will always perform a copy of the pixel data.
+ */
+QImage QVolatileImage::toImage() const
+{
+ d->beginDataAccess();
+ QImage newImage = d->image.copy(); // no sharing allowed
+ d->endDataAccess(true);
+ return newImage;
+}
+
+/*!
+ Returns a reference to the image that is potentially using some native
+ buffer internally. Access to the image's pixel data should be guarded by
+ begin/endDataAccess(). Use it when there is a need for QImage APIs not provided
+ by this class. The returned QImage must never be shared or assigned to.
+ */
+QImage &QVolatileImage::imageRef() // non-const, in order to cause a detach
+{
+ d->ensureImage();
+ return d->image;
+}
+
+void *QVolatileImage::duplicateNativeImage() const
+{
+ return d->duplicateNativeImage();
+}
+
+void QVolatileImage::setAlphaChannel(const QPixmap &alphaChannel)
+{
+ ensureFormat(QImage::Format_ARGB32_Premultiplied);
+ beginDataAccess();
+ imageRef().setAlphaChannel(alphaChannel.toImage());
+ endDataAccess();
+ d->ensureImage();
+}
+
+void QVolatileImage::fill(uint pixelValue)
+{
+ beginDataAccess();
+ imageRef().fill(pixelValue);
+ endDataAccess();
+ d->ensureImage();
+}
+
+void QVolatileImage::copyFrom(QVolatileImage *source, const QRect &rect)
+{
+ if (source->isNull()) {
+ return;
+ }
+ QRect r = rect;
+ if (rect.isNull()) {
+ r = QRect(0, 0, source->width(), source->height());
+ }
+ source->beginDataAccess();
+ QImage &srcImgRef(source->imageRef());
+ int srcbpl = srcImgRef.bytesPerLine();
+ int srcbpp = srcImgRef.depth() / 8;
+ const uchar *sptr = srcImgRef.constBits() + r.y() * srcbpl;
+ beginDataAccess();
+ QImage &dstImgRef(imageRef());
+ int dstbpl = dstImgRef.bytesPerLine();
+ uchar *dptr = dstImgRef.bits();
+ for (int y = 0; y < r.height(); ++y) {
+ qMemCopy(dptr, sptr + r.x() * srcbpp, r.width() * srcbpp);
+ sptr += srcbpl;
+ dptr += dstbpl;
+ }
+ endDataAccess();
+ source->endDataAccess(true);
+}
+
+/*!
+ To be called from the PixmapData's paintEngine().
+ */
+QPaintEngine *QVolatileImage::paintEngine()
+{
+ if (!d->pengine) {
+ d->pengine = new QVolatileImagePaintEngine(&imageRef(), this);
+ }
+ return d->pengine;
+}
+
+QVolatileImagePaintEngine::QVolatileImagePaintEngine(QPaintDevice *device,
+ QVolatileImage *img)
+ : QRasterPaintEngine(*(new QVolatileImagePaintEnginePrivate), device)
+{
+ Q_D(QVolatileImagePaintEngine);
+ d->img = img;
+}
+
+bool QVolatileImagePaintEngine::begin(QPaintDevice *device)
+{
+ Q_D(QVolatileImagePaintEngine);
+ d->img->beginDataAccess();
+ return QRasterPaintEngine::begin(device);
+}
+
+bool QVolatileImagePaintEngine::end()
+{
+ Q_D(QVolatileImagePaintEngine);
+ bool ret = QRasterPaintEngine::end();
+ d->img->endDataAccess();
+ return ret;
+}
+
+// For non-RasterClass pixmaps drawPixmap() would call toImage() which is slow in
+// our case. Therefore drawPixmap() is rerouted to drawImage().
+
+void QVolatileImagePaintEngine::drawPixmap(const QPointF &p, const QPixmap &pm)
+{
+#ifdef Q_OS_SYMBIAN
+ void *nativeData = pm.pixmapData()->toNativeType(QPixmapData::VolatileImage);
+ if (nativeData) {
+ QVolatileImage *img = static_cast<QVolatileImage *>(nativeData);
+ img->beginDataAccess();
+ QRasterPaintEngine::drawImage(p, img->imageRef());
+ img->endDataAccess(true);
+ } else {
+ QRasterPaintEngine::drawPixmap(p, pm);
+ }
+#else
+ QRasterPaintEngine::drawPixmap(p, pm);
+#endif
+}
+
+void QVolatileImagePaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr)
+{
+#ifdef Q_OS_SYMBIAN
+ void *nativeData = pm.pixmapData()->toNativeType(QPixmapData::VolatileImage);
+ if (nativeData) {
+ QVolatileImage *img = static_cast<QVolatileImage *>(nativeData);
+ img->beginDataAccess();
+ QRasterPaintEngine::drawImage(r, img->imageRef(), sr);
+ img->endDataAccess(true);
+ } else {
+ QRasterPaintEngine::drawPixmap(r, pm, sr);
+ }
+#else
+ QRasterPaintEngine::drawPixmap(r, pm, sr);
+#endif
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/image/qvolatileimage_p.h b/src/gui/image/qvolatileimage_p.h
new file mode 100644
index 0000000..fc5d6b1
--- /dev/null
+++ b/src/gui/image/qvolatileimage_p.h
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 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 QVOLATILEIMAGE_P_H
+#define QVOLATILEIMAGE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtGui/qimage.h>
+#include <QtCore/qshareddata.h>
+
+QT_BEGIN_NAMESPACE
+
+class QVolatileImageData;
+
+class Q_GUI_EXPORT QVolatileImage
+{
+public:
+ QVolatileImage();
+ QVolatileImage(int w, int h, QImage::Format format);
+ explicit QVolatileImage(const QImage &sourceImage);
+ explicit QVolatileImage(void *nativeImage, void *nativeMask = 0);
+ QVolatileImage(const QVolatileImage &other);
+ ~QVolatileImage();
+ QVolatileImage &operator=(const QVolatileImage &rhs);
+
+ bool isNull() const;
+ QImage::Format format() const;
+ int width() const;
+ int height() const;
+ int bytesPerLine() const;
+ int byteCount() const;
+ int depth() const;
+ bool hasAlphaChannel() const;
+ void beginDataAccess() const;
+ void endDataAccess(bool readOnly = false) const;
+ uchar *bits();
+ const uchar *constBits() const;
+ bool ensureFormat(QImage::Format format);
+ QImage toImage() const;
+ QImage &imageRef();
+ QPaintEngine *paintEngine();
+ void setAlphaChannel(const QPixmap &alphaChannel);
+ void fill(uint pixelValue);
+ void *duplicateNativeImage() const;
+ void copyFrom(QVolatileImage *source, const QRect &rect);
+
+private:
+ QSharedDataPointer<QVolatileImageData> d;
+};
+
+QT_END_NAMESPACE
+
+#endif // QVOLATILEIMAGE_P_H
diff --git a/src/gui/image/qvolatileimagedata.cpp b/src/gui/image/qvolatileimagedata.cpp
new file mode 100644
index 0000000..51b5995
--- /dev/null
+++ b/src/gui/image/qvolatileimagedata.cpp
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 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 "qvolatileimagedata_p.h"
+#include <QtGui/qpaintengine.h>
+
+QT_BEGIN_NAMESPACE
+
+QVolatileImageData::QVolatileImageData()
+ : pengine(0)
+{
+}
+
+QVolatileImageData::QVolatileImageData(int w, int h, QImage::Format format)
+ : pengine(0)
+{
+ image = QImage(w, h, format);
+}
+
+QVolatileImageData::QVolatileImageData(const QImage &sourceImage)
+ : pengine(0)
+{
+ image = sourceImage;
+}
+
+QVolatileImageData::QVolatileImageData(void *, void *)
+ : pengine(0)
+{
+ // Not supported.
+}
+
+QVolatileImageData::QVolatileImageData(const QVolatileImageData &other)
+{
+ image = other.image;
+ // The detach is not mandatory here but we do it nonetheless in order to
+ // keep the behavior consistent with other platforms.
+ image.detach();
+ pengine = 0;
+}
+
+QVolatileImageData::~QVolatileImageData()
+{
+ delete pengine;
+}
+
+void QVolatileImageData::beginDataAccess() const
+{
+ // nothing to do here
+}
+
+void QVolatileImageData::endDataAccess(bool readOnly) const
+{
+ Q_UNUSED(readOnly);
+ // nothing to do here
+}
+
+bool QVolatileImageData::ensureFormat(QImage::Format format)
+{
+ if (image.format() != format) {
+ image = image.convertToFormat(format);
+ }
+ return true;
+}
+
+void *QVolatileImageData::duplicateNativeImage() const
+{
+ return 0;
+}
+
+void QVolatileImageData::ensureImage()
+{
+ // nothing to do here
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/image/qvolatileimagedata_p.h b/src/gui/image/qvolatileimagedata_p.h
new file mode 100644
index 0000000..dab1685
--- /dev/null
+++ b/src/gui/image/qvolatileimagedata_p.h
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 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 QVOLATILEIMAGEDATA_P_H
+#define QVOLATILEIMAGEDATA_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtGui/qimage.h>
+#include <QtCore/qshareddata.h>
+
+#ifdef Q_OS_SYMBIAN
+class CFbsBitmap;
+#endif
+
+QT_BEGIN_NAMESPACE
+
+class QVolatileImageData : public QSharedData
+{
+public:
+ QVolatileImageData();
+ QVolatileImageData(int w, int h, QImage::Format format);
+ QVolatileImageData(const QImage &sourceImage);
+ QVolatileImageData(void *nativeImage, void *nativeMask);
+ QVolatileImageData(const QVolatileImageData &other);
+ ~QVolatileImageData();
+
+ void beginDataAccess() const;
+ void endDataAccess(bool readOnly = false) const;
+ bool ensureFormat(QImage::Format format);
+ void *duplicateNativeImage() const;
+ void ensureImage();
+
+#ifdef Q_OS_SYMBIAN
+ void updateImage();
+ void initWithBitmap(CFbsBitmap *source);
+ void applyMask(CFbsBitmap *mask);
+ void ensureBitmap();
+ void release();
+ QVolatileImageData *next;
+ QVolatileImageData *prev;
+ CFbsBitmap *bitmap;
+#endif
+ QImage image;
+ QPaintEngine *pengine;
+};
+
+QT_END_NAMESPACE
+
+#endif // QVOLATILEIMAGEDATA_P_H
diff --git a/src/gui/image/qvolatileimagedata_symbian.cpp b/src/gui/image/qvolatileimagedata_symbian.cpp
new file mode 100644
index 0000000..6e2909b
--- /dev/null
+++ b/src/gui/image/qvolatileimagedata_symbian.cpp
@@ -0,0 +1,474 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 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 "qvolatileimagedata_p.h"
+#include <fbs.h>
+#include <QtGui/private/qt_s60_p.h>
+#include <QtGui/qpaintengine.h>
+#include <QtGui/private/qimage_p.h>
+
+QT_BEGIN_NAMESPACE
+
+static CFbsBitmap *rasterizeBitmap(CFbsBitmap *bitmap, TDisplayMode newMode)
+{
+ if (!bitmap) {
+ return 0;
+ }
+ QScopedPointer<CFbsBitmap> newBitmap(new CFbsBitmap);
+ if (newBitmap->Create(bitmap->SizeInPixels(), newMode) != KErrNone) {
+ qWarning("QVolatileImage: Failed to create new bitmap");
+ return 0;
+ }
+ CFbsBitmapDevice *bitmapDevice = 0;
+ CFbsBitGc *bitmapGc = 0;
+ QT_TRAP_THROWING(bitmapDevice = CFbsBitmapDevice::NewL(newBitmap.data()));
+ QScopedPointer<CFbsBitmapDevice> bitmapDevicePtr(bitmapDevice);
+ QT_TRAP_THROWING(bitmapGc = CFbsBitGc::NewL());
+ bitmapGc->Activate(bitmapDevice);
+ bitmapGc->BitBlt(TPoint(), bitmap);
+ delete bitmapGc;
+ return newBitmap.take();
+}
+
+static inline TDisplayMode format2TDisplayMode(QImage::Format format)
+{
+ TDisplayMode mode;
+ switch (format) {
+ case QImage::Format_MonoLSB:
+ mode = EGray2;
+ break;
+ case QImage::Format_Indexed8:
+ mode = EColor256;
+ break;
+ case QImage::Format_RGB444:
+ mode = EColor4K;
+ break;
+ case QImage::Format_RGB16:
+ mode = EColor64K;
+ break;
+ case QImage::Format_RGB888:
+ mode = EColor16M;
+ break;
+ case QImage::Format_RGB32:
+ mode = EColor16MU;
+ break;
+ case QImage::Format_ARGB32:
+ mode = EColor16MA;
+ break;
+ case QImage::Format_ARGB32_Premultiplied:
+ mode = Q_SYMBIAN_ECOLOR16MAP;
+ break;
+ default:
+ mode = ENone;
+ break;
+ }
+ return mode;
+}
+
+static CFbsBitmap *imageToBitmap(const QImage &image)
+{
+ if (image.isNull()) {
+ return 0;
+ }
+ CFbsBitmap *bitmap = new CFbsBitmap;
+ if (bitmap->Create(TSize(image.width(), image.height()),
+ format2TDisplayMode(image.format())) == KErrNone) {
+ bitmap->BeginDataAccess();
+ uchar *dptr = reinterpret_cast<uchar *>(bitmap->DataAddress());
+ int bmpLineLen = bitmap->DataStride();
+ int imgLineLen = image.bytesPerLine();
+ if (bmpLineLen == imgLineLen) {
+ qMemCopy(dptr, image.constBits(), image.byteCount());
+ } else {
+ int len = qMin(bmpLineLen, imgLineLen);
+ const uchar *sptr = image.constBits();
+ for (int y = 0; y < image.height(); ++y) {
+ qMemCopy(dptr, sptr, len);
+ dptr += bmpLineLen;
+ sptr += imgLineLen;
+ }
+ }
+ bitmap->EndDataAccess();
+ } else {
+ qWarning("QVolatileImage: Failed to create source bitmap");
+ delete bitmap;
+ bitmap = 0;
+ }
+ return bitmap;
+}
+
+static CFbsBitmap *copyData(const QVolatileImageData &source)
+{
+ source.beginDataAccess();
+ CFbsBitmap *bmp = imageToBitmap(source.image);
+ source.endDataAccess();
+ return bmp;
+}
+
+static CFbsBitmap *convertData(const QVolatileImageData &source, QImage::Format newFormat)
+{
+ source.beginDataAccess();
+ QImage img = source.image.convertToFormat(newFormat);
+ CFbsBitmap *bmp = imageToBitmap(img);
+ source.endDataAccess();
+ return bmp;
+}
+
+static CFbsBitmap *duplicateBitmap(const CFbsBitmap &sourceBitmap)
+{
+ CFbsBitmap *bitmap = new CFbsBitmap;
+ if (bitmap->Duplicate(sourceBitmap.Handle()) != KErrNone) {
+ qWarning("QVolatileImage: Failed to duplicate source bitmap");
+ delete bitmap;
+ bitmap = 0;
+ }
+ return bitmap;
+}
+
+static CFbsBitmap *createBitmap(int w, int h, QImage::Format format)
+{
+ CFbsBitmap *bitmap = new CFbsBitmap;
+ if (bitmap->Create(TSize(w, h), format2TDisplayMode(format)) != KErrNone) {
+ qWarning("QVolatileImage: Failed to create source bitmap %d,%d (%d)", w, h, format);
+ delete bitmap;
+ bitmap = 0;
+ }
+ return bitmap;
+}
+
+static inline bool bitmapNeedsCopy(CFbsBitmap *bitmap)
+{
+ bool needsCopy = bitmap->IsCompressedInRAM();
+#ifdef Q_SYMBIAN_HAS_EXTENDED_BITMAP_TYPE
+ needsCopy |= (bitmap->ExtendedBitmapType() != KNullUid);
+#endif
+ return needsCopy;
+}
+
+static bool cleanup_function_registered = false;
+static QVolatileImageData *firstImageData = 0;
+
+static void cleanup()
+{
+ if (RFbsSession::GetSession()) {
+ QVolatileImageData *imageData = firstImageData;
+ while (imageData) {
+ imageData->release();
+ imageData = imageData->next;
+ }
+ }
+}
+
+static void ensureCleanup()
+{
+ // Destroy all underlying bitmaps in a post routine to prevent panics.
+ // This is a must because CFbsBitmap destructor needs the fbs session,
+ // that was used to create the bitmap, to be open still.
+ if (!cleanup_function_registered) {
+ qAddPostRoutine(cleanup);
+ cleanup_function_registered = true;
+ }
+}
+
+static void registerImageData(QVolatileImageData *imageData)
+{
+ ensureCleanup();
+ imageData->next = firstImageData;
+ if (firstImageData) {
+ firstImageData->prev = imageData;
+ }
+ firstImageData = imageData;
+}
+
+static void unregisterImageData(QVolatileImageData *imageData)
+{
+ if (imageData->prev) {
+ imageData->prev->next = imageData->next;
+ } else {
+ firstImageData = imageData->next;
+ }
+ if (imageData->next) {
+ imageData->next->prev = imageData->prev;
+ }
+}
+
+QVolatileImageData::QVolatileImageData()
+ : next(0), prev(0), bitmap(0), pengine(0)
+{
+ registerImageData(this);
+}
+
+QVolatileImageData::QVolatileImageData(int w, int h, QImage::Format format)
+ : next(0), prev(0), bitmap(0), pengine(0)
+{
+ registerImageData(this);
+ bitmap = createBitmap(w, h, format);
+ updateImage();
+}
+
+QVolatileImageData::QVolatileImageData(const QImage &sourceImage)
+ : next(0), prev(0), bitmap(0), pengine(0)
+{
+ registerImageData(this);
+ image = sourceImage;
+ // The following is not mandatory, but we do it here to have a bitmap
+ // created always in order to reduce local heap usage.
+ ensureBitmap();
+}
+
+QVolatileImageData::QVolatileImageData(void *nativeImage, void *nativeMask)
+ : next(0), prev(0), bitmap(0), pengine(0)
+{
+ registerImageData(this);
+ if (nativeImage) {
+ CFbsBitmap *source = static_cast<CFbsBitmap *>(nativeImage);
+ CFbsBitmap *mask = static_cast<CFbsBitmap *>(nativeMask);
+ initWithBitmap(source);
+ if (mask) {
+ applyMask(mask);
+ }
+ }
+}
+
+QVolatileImageData::QVolatileImageData(const QVolatileImageData &other)
+{
+ bitmap = 0;
+ pengine = 0;
+ next = prev = 0;
+ registerImageData(this);
+ if (!other.image.isNull()) {
+ bitmap = copyData(other);
+ updateImage();
+ }
+}
+
+QVolatileImageData::~QVolatileImageData()
+{
+ release();
+ unregisterImageData(this);
+}
+
+void QVolatileImageData::release()
+{
+ delete bitmap;
+ bitmap = 0;
+ delete pengine;
+ pengine = 0;
+}
+
+void QVolatileImageData::beginDataAccess() const
+{
+ if (bitmap) {
+ bitmap->BeginDataAccess();
+ }
+}
+
+void QVolatileImageData::endDataAccess(bool readOnly) const
+{
+ if (bitmap) {
+ bitmap->EndDataAccess(readOnly);
+ }
+}
+
+bool QVolatileImageData::ensureFormat(QImage::Format format)
+{
+ if (image.isNull()) {
+ return false;
+ }
+ if (image.format() != format) {
+ CFbsBitmap *newBitmap = convertData(*this, format);
+ if (newBitmap && newBitmap != bitmap) {
+ delete bitmap;
+ bitmap = newBitmap;
+ updateImage();
+ } else {
+ return false;
+ }
+ }
+ return true;
+}
+
+void *QVolatileImageData::duplicateNativeImage() const
+{
+ const_cast<QVolatileImageData *>(this)->ensureBitmap();
+ if (bitmap) {
+ if (bitmap->DisplayMode() == EColor16M) {
+ // slow path: needs rgb swapping
+ beginDataAccess();
+ QImage tmp = image.rgbSwapped();
+ endDataAccess(true);
+ return imageToBitmap(tmp);
+ } else if (bitmap->DisplayMode() == EGray2) {
+ // slow path: needs inverting pixels
+ beginDataAccess();
+ QImage tmp = image.copy();
+ endDataAccess(true);
+ tmp.invertPixels();
+ return imageToBitmap(tmp);
+ } else {
+ // fast path: just duplicate the bitmap
+ return duplicateBitmap(*bitmap);
+ }
+ }
+ return 0;
+}
+
+void QVolatileImageData::updateImage()
+{
+ if (bitmap) {
+ TSize size = bitmap->SizeInPixels();
+ beginDataAccess();
+ // Use existing buffer, no copy. The data address never changes so it
+ // is enough to do this whenever we have a new CFbsBitmap. N.B. never
+ // use const uchar* here, that would create a read-only image data which
+ // would make a copy in detach() even when refcount is 1.
+ image = QImage(reinterpret_cast<uchar *>(bitmap->DataAddress()),
+ size.iWidth, size.iHeight, bitmap->DataStride(),
+ qt_TDisplayMode2Format(bitmap->DisplayMode()));
+ endDataAccess(true);
+ } else {
+ image = QImage();
+ }
+}
+
+void QVolatileImageData::initWithBitmap(CFbsBitmap *source)
+{
+ bool needsCopy = bitmapNeedsCopy(source);
+ if (source->DisplayMode() == EColor16M) {
+ // EColor16M is BGR
+ CFbsBitmap *unswappedBmp = source;
+ if (needsCopy) {
+ unswappedBmp = rasterizeBitmap(source, source->DisplayMode());
+ }
+ unswappedBmp->BeginDataAccess();
+ TSize sourceSize = unswappedBmp->SizeInPixels();
+ QImage img((uchar *) unswappedBmp->DataAddress(),
+ sourceSize.iWidth, sourceSize.iHeight, unswappedBmp->DataStride(),
+ qt_TDisplayMode2Format(unswappedBmp->DisplayMode()));
+ img = img.rgbSwapped();
+ unswappedBmp->EndDataAccess(true);
+ bitmap = imageToBitmap(img);
+ if (needsCopy) {
+ delete unswappedBmp;
+ }
+ } else if (needsCopy) {
+ // Rasterize extended and compressed bitmaps.
+ bitmap = rasterizeBitmap(source, EColor16MAP);
+ } else if (source->DisplayMode() == EGray2) {
+ // The pixels will be inverted, must make a copy.
+ bitmap = rasterizeBitmap(source, source->DisplayMode());
+ } else {
+ // Efficient path: no pixel data copying. Just duplicate. This of course
+ // means the original bitmap's data may get modified, but that's fine
+ // and is in accordance with the QPixmap::fromSymbianCFbsBitmap() docs.
+ bitmap = duplicateBitmap(*source);
+ }
+ updateImage();
+ if (bitmap && bitmap->DisplayMode() == EGray2) {
+ // Symbian thinks set pixels are white/transparent, Qt thinks they are
+ // foreground/solid. Invert mono bitmaps so that masks work correctly.
+ beginDataAccess();
+ image.invertPixels();
+ endDataAccess();
+ }
+}
+
+void QVolatileImageData::applyMask(CFbsBitmap *mask)
+{
+ ensureFormat(QImage::Format_ARGB32_Premultiplied);
+ bool destroyMask = false;
+ if (bitmapNeedsCopy(mask)) {
+ mask = rasterizeBitmap(mask, EColor16MU);
+ if (!mask) {
+ return;
+ }
+ destroyMask = true;
+ }
+ mask->BeginDataAccess();
+ TSize maskSize = mask->SizeInPixels();
+ QImage maskImg((const uchar *) mask->DataAddress(), maskSize.iWidth, maskSize.iHeight,
+ mask->DataStride(), qt_TDisplayMode2Format(mask->DisplayMode()));
+ if (mask->DisplayMode() == EGray2) {
+ maskImg = maskImg.copy();
+ maskImg.invertPixels();
+ }
+ beginDataAccess();
+ image.setAlphaChannel(maskImg);
+ endDataAccess();
+ mask->EndDataAccess(true);
+ ensureImage();
+ if (destroyMask) {
+ delete mask;
+ }
+}
+
+void QVolatileImageData::ensureImage()
+{
+ if (bitmap && !image.isNull()) {
+ QImageData *imaged = image.data_ptr();
+ if (imaged->ref != 1 || imaged->ro_data) {
+ // This is bad, the imagedata got shared somehow. Detach, in order to
+ // have the next check fail and thus have 'image' recreated.
+ beginDataAccess();
+ image.detach();
+ endDataAccess(true);
+ }
+ }
+ if (bitmap && image.constBits() != reinterpret_cast<const uchar *>(bitmap->DataAddress())) {
+ // Should not ever get here. If we do it means that either 'image' has
+ // been replaced with a copy (e.g. because some QImage API assigned a
+ // new, regular QImage to *this) or the bitmap's data address changed
+ // unexpectedly.
+ qWarning("QVolatileImageData: Ptr mismatch");
+ // Recover by recreating the image so that it uses the bitmap as its buffer.
+ updateImage();
+ }
+}
+
+void QVolatileImageData::ensureBitmap()
+{
+ if (!bitmap && !image.isNull()) {
+ bitmap = imageToBitmap(image);
+ updateImage();
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h
index 8c8ffd4..de3577f 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_p.h
+++ b/src/gui/inputmethod/qcoefepinputcontext_p.h
@@ -93,6 +93,9 @@ public:
TCoeInputCapabilities inputCapabilities();
+ void resetSplitViewWidget(bool keepInputWidget = false);
+ void ensureFocusWidgetVisible(QWidget *widget);
+
protected:
void timerEvent(QTimerEvent *timerEvent);
@@ -104,9 +107,11 @@ private:
void queueInputCapabilitiesChanged();
bool needsInputPanel();
void commitTemporaryPreeditString();
+ bool isWidgetVisible(QWidget *widget, int offset = 0);
private Q_SLOTS:
void ensureInputCapabilitiesChanged();
+ void translateInputWidget();
// From MCoeFepAwareTextEditor
public:
@@ -155,9 +160,15 @@ private:
QBasicTimer m_tempPreeditStringTimeout;
bool m_hasTempPreeditString;
+ int m_splitViewResizeBy;
+ Qt::WindowStates m_splitViewPreviousWindowStates;
+ QRectF m_transformation;
+
friend class tst_QInputContext;
};
+Q_GUI_EXPORT void qt_s60_setPartialScreenInputMode(bool enable);
+
QT_END_NAMESPACE
#endif // QT_NO_IM
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index 1bef64d..9d8dd41 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -48,6 +48,8 @@
#include <qgraphicsscene.h>
#include <qgraphicswidget.h>
#include <qsymbianevent.h>
+#include <qlayout.h>
+#include <qdesktopwidget.h>
#include <private/qcore_symbian_p.h>
#include <fepitfr.h>
@@ -67,8 +69,16 @@
// that support text selection.
#define QT_EAknEditorFlagSelectionVisible 0x100000
+// EAknEditorFlagEnablePartialScreen is only valid from Sym^3 onwards.
+#define QT_EAknEditorFlagEnablePartialScreen 0x200000
+
QT_BEGIN_NAMESPACE
+Q_GUI_EXPORT void qt_s60_setPartialScreenInputMode(bool enable)
+{
+ S60->partial_keyboard = enable;
+}
+
QCoeFepInputContext::QCoeFepInputContext(QObject *parent)
: QInputContext(parent),
m_fepState(q_check_ptr(new CAknEdwinState)), // CBase derived object needs check on new
@@ -80,13 +90,19 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent)
m_inlinePosition(0),
m_formatRetriever(0),
m_pointerHandler(0),
- m_hasTempPreeditString(false)
+ m_hasTempPreeditString(false),
+ m_splitViewResizeBy(0),
+ m_splitViewPreviousWindowStates(Qt::WindowNoState)
{
m_fepState->SetObjectProvider(this);
- if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0)
- m_fepState->SetFlags(EAknEditorFlagDefault | QT_EAknEditorFlagSelectionVisible);
- else
- m_fepState->SetFlags(EAknEditorFlagDefault);
+ int defaultFlags = EAknEditorFlagDefault;
+ if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0) {
+ if (S60->partial_keyboard) {
+ defaultFlags |= QT_EAknEditorFlagEnablePartialScreen;
+ }
+ defaultFlags |= QT_EAknEditorFlagSelectionVisible;
+ }
+ m_fepState->SetFlags(defaultFlags);
m_fepState->SetDefaultInputMode( EAknEditorTextInputMode );
m_fepState->SetPermittedInputModes( EAknEditorAllInputModes );
m_fepState->SetDefaultCase( EAknEditorTextCase );
@@ -210,6 +226,21 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event)
return false;
switch (event->type()) {
+ case QEvent::MouseButtonPress:
+ // Alphanumeric keypad doesn't like it when we click and text is still getting displayed
+ // It ignores the mouse event, so we need to commit and send a selection event (which will get triggered
+ // after the commit)
+ if (!m_preeditString.isEmpty()) {
+ commitCurrentString(false);
+
+ int pos = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt();
+
+ QList<QInputMethodEvent::Attribute> selectAttributes;
+ selectAttributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, pos, 0, QVariant());
+ QInputMethodEvent selectEvent(QLatin1String(""), selectAttributes);
+ sendEvent(selectEvent);
+ }
+ break;
case QEvent::KeyPress:
commitTemporaryPreeditString();
// fall through intended
@@ -343,6 +374,165 @@ TCoeInputCapabilities QCoeFepInputContext::inputCapabilities()
return TCoeInputCapabilities(m_textCapabilities, this, 0);
}
+void QCoeFepInputContext::resetSplitViewWidget(bool keepInputWidget)
+{
+ QGraphicsView *gv = qobject_cast<QGraphicsView*>(S60->splitViewLastWidget);
+
+ if (!gv) {
+ return;
+ }
+
+ QSymbianControl *symControl = static_cast<QSymbianControl*>(gv->effectiveWinId());
+ symControl->CancelLongTapTimer();
+
+ const bool alwaysResize = (gv->verticalScrollBarPolicy() != Qt::ScrollBarAlwaysOff);
+ QWidget *windowToMove = gv->window();
+
+ bool userResize = gv->testAttribute(Qt::WA_Resized);
+
+ windowToMove->setUpdatesEnabled(false);
+
+ if (!alwaysResize) {
+ if (gv->scene()) {
+ if (gv->scene()->focusItem())
+ disconnect(gv->scene()->focusItem()->toGraphicsObject(), SIGNAL(cursorPositionChanged()), this, SLOT(translateInputWidget()));
+ QGraphicsItem *rootItem;
+ foreach (QGraphicsItem *item, gv->scene()->items()) {
+ if (!item->parentItem()) {
+ rootItem = item;
+ break;
+ }
+ }
+ if (rootItem)
+ rootItem->resetTransform();
+ }
+ } else {
+ if (m_splitViewResizeBy)
+ gv->resize(gv->rect().width(), m_splitViewResizeBy);
+ }
+ // Resizing might have led to widget losing its original windowstate.
+ // Restore previous window state.
+
+ if (m_splitViewPreviousWindowStates != windowToMove->windowState())
+ windowToMove->setWindowState(m_splitViewPreviousWindowStates);
+
+ windowToMove->setUpdatesEnabled(true);
+
+ gv->setAttribute(Qt::WA_Resized, userResize); //not a user resize
+
+ m_splitViewResizeBy = 0;
+ if (!keepInputWidget) {
+ m_splitViewPreviousWindowStates = Qt::WindowNoState;
+ S60->splitViewLastWidget = 0;
+ }
+}
+
+// Checks if a given widget is visible in the splitview rect. The offset
+// parameter can be used to validate if moving widget upwards or downwards
+// by the offset would make a difference for the visibility.
+
+bool QCoeFepInputContext::isWidgetVisible(QWidget *widget, int offset)
+{
+ bool visible = false;
+ if (widget) {
+ QRect splitViewRect = qt_TRect2QRect(static_cast<CEikAppUi*>(S60->appUi())->ClientRect());
+ QWidget *window = QApplication::activeWindow();
+ QGraphicsView *gv = qobject_cast<QGraphicsView*>(widget);
+ if (gv && window) {
+ if (QGraphicsScene *scene = gv->scene()) {
+ if (QGraphicsItem *focusItem = scene->focusItem()) {
+ QPoint cursorPos = window->mapToGlobal(focusItem->cursor().pos());
+ cursorPos.setY(cursorPos.y() + offset);
+ if (splitViewRect.contains(cursorPos)) {
+ visible = true;
+ }
+ }
+ }
+ }
+ }
+ return visible;
+}
+
+// Ensure that the input widget is visible in the splitview rect.
+
+void QCoeFepInputContext::ensureFocusWidgetVisible(QWidget *widget)
+{
+ // Native side opening and closing its virtual keyboard when it changes the keyboard layout,
+ // has an adverse impact on long tap timer. Cancel the timer when splitview opens to avoid this.
+ QSymbianControl *symControl = static_cast<QSymbianControl*>(widget->effectiveWinId());
+ symControl->CancelLongTapTimer();
+
+ // Graphicsviews that have vertical scrollbars should always be resized to the splitview area.
+ // Graphicsviews without scrollbars should be translated.
+
+ QGraphicsView *gv = qobject_cast<QGraphicsView*>(widget);
+ if (!gv)
+ return;
+
+ const bool alwaysResize = (gv && gv->verticalScrollBarPolicy() != Qt::ScrollBarAlwaysOff);
+ const bool moveWithinVisibleArea = (S60->splitViewLastWidget != 0);
+
+ QWidget *windowToMove = gv ? gv : symControl->widget();
+ if (!windowToMove->isWindow())
+ windowToMove = windowToMove->window();
+ if (!windowToMove) {
+ return;
+ }
+
+ // When opening the keyboard (not moving within the splitview area), save the original
+ // window state. In some cases, ensuring input widget visibility might lead to window
+ // states getting changed.
+
+ if (!moveWithinVisibleArea) {
+ S60->splitViewLastWidget = widget;
+ m_splitViewPreviousWindowStates = windowToMove->windowState();
+ }
+
+ int windowTop = widget->window()->pos().y();
+
+ const bool userResize = widget->testAttribute(Qt::WA_Resized);
+
+ QRect splitViewRect = qt_TRect2QRect(static_cast<CEikAppUi*>(S60->appUi())->ClientRect());
+
+
+ // When resizing a window widget, it will lose its maximized window state.
+ // Native applications hide statuspane in splitview state, so lets move to
+ // fullscreen mode. This makes available area slightly bigger, which helps usability
+ // and greatly reduces event passing in orientation switch cases,
+ // as the statuspane size is not changing.
+
+ if (!(windowToMove->windowState() & Qt::WindowFullScreen)) {
+ windowToMove->setWindowState(
+ (windowToMove->windowState() & ~(Qt::WindowMinimized | Qt::WindowFullScreen)) | Qt::WindowFullScreen);
+ }
+
+ if (alwaysResize) {
+ windowToMove->setUpdatesEnabled(false);
+ if (!moveWithinVisibleArea)
+ m_splitViewResizeBy = widget->height();
+
+ windowTop = widget->geometry().top();
+ widget->resize(widget->width(), splitViewRect.height() - windowTop);
+
+ if (gv->scene()) {
+ const QRectF microFocusRect = gv->scene()->inputMethodQuery(Qt::ImMicroFocus).toRectF();
+ gv->ensureVisible(microFocusRect);
+ }
+ windowToMove->setUpdatesEnabled(true);
+ } else {
+ if (!moveWithinVisibleArea) {
+ // Check if the widget contains cursorPositionChanged signal and connect to it.
+ const char *signal = QMetaObject::normalizedSignature(SIGNAL(cursorPositionChanged())).constData();
+ int index = gv->scene()->focusItem()->toGraphicsObject()->metaObject()->indexOfSignal(signal + 1);
+ if (index != -1)
+ connect(gv->scene()->focusItem()->toGraphicsObject(), SIGNAL(cursorPositionChanged()), this, SLOT(translateInputWidget()));
+ }
+ translateInputWidget();
+ }
+
+ widget->setAttribute(Qt::WA_Resized, userResize); //not a user resize
+}
+
static QTextCharFormat qt_TCharFormat2QTextCharFormat(const TCharFormat &cFormat, bool validStyleColor)
{
QTextCharFormat qFormat;
@@ -474,10 +664,12 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints)
m_fepState->SetPermittedCases(flags);
ReportAknEdStateEvent(MAknEdStateObserver::EAknEdwinStateCaseModeUpdate);
- if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0)
- flags = QT_EAknEditorFlagSelectionVisible;
- else
- flags = 0;
+ flags = 0;
+ if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0) {
+ if (S60->partial_keyboard)
+ flags |= QT_EAknEditorFlagEnablePartialScreen;
+ flags |= QT_EAknEditorFlagSelectionVisible;
+ }
if (hints & ImhUppercaseOnly && !(hints & ImhLowercaseOnly)
|| hints & ImhLowercaseOnly && !(hints & ImhUppercaseOnly)) {
flags |= EAknEditorFlagFixedCase;
@@ -604,6 +796,47 @@ void QCoeFepInputContext::ensureInputCapabilitiesChanged()
m_pendingInputCapabilitiesChanged = false;
}
+void QCoeFepInputContext::translateInputWidget()
+{
+ QGraphicsView *gv = qobject_cast<QGraphicsView *>(S60->splitViewLastWidget);
+ QRect splitViewRect = qt_TRect2QRect(static_cast<CEikAppUi*>(S60->appUi())->ClientRect());
+
+ QRectF cursor = gv->scene()->inputMethodQuery(Qt::ImMicroFocus).toRectF();
+ QPolygon cursorP = gv->mapFromScene(cursor);
+ QRectF vkbRect = QRectF(splitViewRect.bottomLeft(), qApp->desktop()->rect().bottomRight());
+ if (cursor.isEmpty() || vkbRect.isEmpty())
+ return;
+
+ // Fetch root item (i.e. graphicsitem with no parent)
+ QGraphicsItem *rootItem;
+ foreach (QGraphicsItem *item, gv->scene()->items()) {
+ if (!item->parentItem()) {
+ rootItem = item;
+ break;
+ }
+ }
+ if (!rootItem)
+ return;
+
+ m_transformation = (rootItem->transform().isTranslating()) ? QRectF(0,0, gv->width(), rootItem->transform().dy()) : QRectF();
+
+ // Do nothing if the cursor is visible in the splitview area.
+ if (splitViewRect.contains(cursorP.boundingRect()))
+ return;
+
+ // New Y position should be ideally at the center of the splitview area.
+ // If that would expose unpainted canvas, limit the tranformation to the visible scene bottom.
+
+ const qreal maxY = gv->sceneRect().bottom() - splitViewRect.bottom() + m_transformation.height();
+ qreal dy = -(qMin(maxY, (cursor.bottom() - vkbRect.top() / 2)));
+
+ // Do not allow transform above screen top.
+ if (m_transformation.height() + dy > 0)
+ return;
+
+ rootItem->setTransform(QTransform::fromTranslate(0, dy), true);
+}
+
void QCoeFepInputContext::StartFepInlineEditL(const TDesC& aInitialInlineText,
TInt aPositionOfInsertionPointInInlineText, TBool aCursorVisibility, const MFormCustomDraw* /*aCustomDraw*/,
MFepInlineTextFormatRetriever& aInlineTextFormatRetriever,
diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h
index 43634ef..3d2c9d6 100644
--- a/src/gui/kernel/qapplication_p.h
+++ b/src/gui/kernel/qapplication_p.h
@@ -599,6 +599,8 @@ public:
int pressureSupported;
int maxTouchPressure;
QList<QTouchEvent::TouchPoint> appAllTouchPoints;
+
+ bool useTranslucentEGLSurfaces;
#endif
private:
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index fb0c6b8..2b10d63 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -96,6 +96,9 @@ QT_BEGIN_NAMESPACE
// Goom Events through Window Server
static const int KGoomMemoryLowEvent = 0x10282DBF;
static const int KGoomMemoryGoodEvent = 0x20026790;
+// Split view open/close events from AVKON
+static const int KSplitViewOpenEvent = 0x2001E2C0;
+static const int KSplitViewCloseEvent = 0x2001E2C1;
#if defined(QT_DEBUG)
static bool appNoGrab = false; // Grabbing enabled
@@ -401,6 +404,7 @@ QSymbianControl::QSymbianControl(QWidget *w)
, m_longTapDetector(0)
, m_ignoreFocusChanged(0)
, m_symbianPopupIsOpen(0)
+ , m_inExternalScreenOverride(false)
{
}
@@ -408,9 +412,11 @@ void QSymbianControl::ConstructL(bool isWindowOwning, bool desktop)
{
if (!desktop)
{
- if (isWindowOwning || !qwidget->parentWidget())
- CreateWindowL(S60->windowGroup());
- else
+ if (isWindowOwning || !qwidget->parentWidget()
+ || qwidget->parentWidget()->windowType() == Qt::Desktop) {
+ RWindowGroup &wg(S60->windowGroup(qwidget));
+ CreateWindowL(wg);
+ } else {
/**
* TODO: in order to avoid creating windows for all ancestors of
* this widget up to the root window, the parameter passed to
@@ -420,6 +426,7 @@ void QSymbianControl::ConstructL(bool isWindowOwning, bool desktop)
* is created for a widget between this one and the root window.
*/
CreateWindowL(qwidget->parentWidget()->winId());
+ }
// Necessary in order to be able to track the activation status of
// the control's window
@@ -452,7 +459,7 @@ void QSymbianControl::ConstructL(bool isWindowOwning, bool desktop)
windowPurpose = ETfxPurposeSplashScreenWindow;
break;
default:
- windowPurpose = (isWindowOwning || !qwidget->parentWidget())
+ windowPurpose = (isWindowOwning || !qwidget->parentWidget() || qwidget->parentWidget()->windowType() == Qt::Desktop)
? ETfxPurposeWindow : ETfxPurposeChildWindow;
break;
}
@@ -983,14 +990,15 @@ TKeyResponse QSymbianControl::handleVirtualMouse(const TKeyEvent& keyEvent,TEven
}
}
//clip to screen size (window server allows a sprite hotspot to be outside the screen)
+ int screenNumber = S60->screenNumberForWidget(qwidget);
if (x < 0)
x = 0;
- else if (x >= S60->screenWidthInPixels)
- x = S60->screenWidthInPixels - 1;
+ else if (x >= S60->screenWidthInPixelsForScreen[screenNumber])
+ x = S60->screenWidthInPixelsForScreen[screenNumber] - 1;
if (y < 0)
y = 0;
- else if (y >= S60->screenHeightInPixels)
- y = S60->screenHeightInPixels - 1;
+ else if (y >= S60->screenHeightInPixelsForScreen[screenNumber])
+ y = S60->screenHeightInPixelsForScreen[screenNumber] - 1;
TPoint epos(x, y);
TPoint cpos = epos - PositionRelativeToScreen();
fakeEvent.iPosition = cpos;
@@ -1124,7 +1132,8 @@ void QSymbianControl::Draw(const TRect& controlRect) const
// Do nothing
break;
case QWExtra::Blit:
- if (qwidget->d_func()->isOpaque)
+ case QWExtra::BlitWriteAlpha:
+ if (qwidget->d_func()->isOpaque || nativePaintMode == QWExtra::BlitWriteAlpha)
gc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
gc.BitBlt(controlRect.iTl, bitmap, backingStoreRect);
break;
@@ -1167,6 +1176,18 @@ void QSymbianControl::SizeChanged()
QSize newSize(Size().iWidth, Size().iHeight);
if (oldSize != newSize) {
+ const bool isFullscreen = qwidget->windowState() & Qt::WindowFullScreen;
+ const int screenNumber = S60->screenNumberForWidget(qwidget);
+ if (!m_inExternalScreenOverride && isFullscreen && screenNumber > 0) {
+ int screenWidth = S60->screenWidthInPixelsForScreen[screenNumber];
+ int screenHeight = S60->screenHeightInPixelsForScreen[screenNumber];
+ TSize screenSize(screenWidth, screenHeight);
+ if (screenWidth > 0 && screenHeight > 0 && screenSize != Size()) {
+ m_inExternalScreenOverride = true;
+ SetExtent(TPoint(0, 0), screenSize);
+ return;
+ }
+ }
QRect cr = qwidget->geometry();
cr.setSize(newSize);
qwidget->data->crect = cr;
@@ -1189,6 +1210,8 @@ void QSymbianControl::SizeChanged()
}
}
+ m_inExternalScreenOverride = false;
+
// CCoeControl::SetExtent calls SizeChanged, but does not call
// PositionChanged, so we call it here to ensure that the widget's
// position is updated.
@@ -1224,6 +1247,11 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */)
if (m_ignoreFocusChanged || (qwidget->windowType() & Qt::WindowType_Mask) == Qt::Desktop)
return;
+#ifdef Q_WS_S60
+ if (S60->splitViewLastWidget)
+ return;
+#endif
+
// Popups never get focused, but still receive the FocusChanged when they are hidden.
if (QApplicationPrivate::popupWidgets != 0
|| (qwidget->windowType() & Qt::Popup) == Qt::Popup)
@@ -1302,9 +1330,56 @@ void QSymbianControl::handleClientAreaChange()
}
}
+bool QSymbianControl::isSplitViewWidget(QWidget *widget) {
+ bool returnValue = true;
+ //Ignore events sent to non-active windows, not visible widgets and not parents of input widget.
+ if (!qwidget->isActiveWindow()
+ || !qwidget->isVisible()
+ || !qwidget->isAncestorOf(widget)) {
+
+ returnValue = false;
+ }
+ return returnValue;
+}
+
void QSymbianControl::HandleResourceChange(int resourceType)
{
switch (resourceType) {
+ case KSplitViewCloseEvent: //intentional fall-through
+ case KSplitViewOpenEvent: {
+#if !defined(QT_NO_IM) && defined(Q_WS_S60)
+
+ //Fetch widget getting the text input
+ QWidget *widget = QWidget::keyboardGrabber();
+ if (!widget) {
+ if (QApplicationPrivate::popupWidgets) {
+ widget = QApplication::activePopupWidget()->focusWidget();
+ if (!widget) {
+ widget = QApplication::activePopupWidget();
+ }
+ } else {
+ widget = QApplicationPrivate::focus_widget;
+ if (!widget) {
+ widget = qwidget;
+ }
+ }
+ }
+ if (widget) {
+ QCoeFepInputContext *ic = qobject_cast<QCoeFepInputContext *>(widget->inputContext());
+ if (!ic) {
+ ic = qobject_cast<QCoeFepInputContext *>(qApp->inputContext());
+ }
+ if (ic && isSplitViewWidget(widget)) {
+ if (resourceType == KSplitViewCloseEvent) {
+ ic->resetSplitViewWidget();
+ } else {
+ ic->ensureFocusWidgetVisible(widget);
+ }
+ }
+ }
+#endif // !defined(QT_NO_IM) && defined(Q_WS_S60)
+ }
+ break;
case KInternalStatusPaneChange:
handleClientAreaChange();
if (IsFocused() && IsVisible()) {
@@ -1590,6 +1665,32 @@ void qt_init(QApplicationPrivate * /* priv */, int)
QObject::connect(qApp, SIGNAL(aboutToQuit()), qApp, SLOT(_q_aboutToQuit()));
#endif
+#ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
+ QApplicationPrivate::instance()->useTranslucentEGLSurfaces = true;
+
+ const TUid KIvePropertyCat = {0x2726beef};
+ enum TIvePropertyChipType {
+ EVCBCM2727B1 = 0x00000000,
+ EVCBCM2763A0 = 0x04000100,
+ EVCBCM2763B0 = 0x04000102,
+ EVCBCM2763C0 = 0x04000103,
+ EVCBCM2763C1 = 0x04000104,
+ EVCBCMUnknown = 0x7fffffff
+ };
+
+ TInt chipType = EVCBCMUnknown;
+ if (RProperty::Get(KIvePropertyCat, 0 /*chip type*/, chipType) == KErrNone) {
+ if (chipType == EVCBCM2727B1) {
+ // We have only 32MB GPU memory. Use raster surfaces
+ // for transparent TLWs.
+ QApplicationPrivate::instance()->useTranslucentEGLSurfaces = false;
+ }
+ } else {
+ QApplicationPrivate::instance()->useTranslucentEGLSurfaces = false;
+ }
+#else
+ QApplicationPrivate::instance()->useTranslucentEGLSurfaces = false;
+#endif
/*
### Commented out for now as parameter handling not needed in SOS(yet). Code below will break testlib with -o flag
int argc = priv->argc;
@@ -1979,7 +2080,10 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent
return 1;
}
break;
- case EEventScreenDeviceChanged:
+ case EEventScreenDeviceChanged: // fallthrough
+#if defined(Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS)
+ case EEventDisplayChanged:
+#endif
if (callSymbianEventFilters(symbianEvent))
return 1;
if (S60)
diff --git a/src/gui/kernel/qclipboard_win.cpp b/src/gui/kernel/qclipboard_win.cpp
index 52b9663..ea41165 100644
--- a/src/gui/kernel/qclipboard_win.cpp
+++ b/src/gui/kernel/qclipboard_win.cpp
@@ -52,6 +52,7 @@
#include "qt_windows.h"
#include "qdnd_p.h"
#include <private/qwidget_p.h>
+#include <private/qsystemlibrary_p.h>
QT_BEGIN_NAMESPACE
@@ -70,6 +71,9 @@ void QtCeFlushClipboard();
#endif
+typedef BOOL (WINAPI *PtrIsHungAppWindow)(HWND);
+
+static PtrIsHungAppWindow ptrIsHungAppWindow = 0;
class QClipboardWatcher : public QInternalMimeData {
public:
@@ -327,9 +331,16 @@ bool QClipboard::event(QEvent *e)
d->releaseIData();
propagate = true;
}
-
if (propagate && d->nextClipboardViewer) {
- SendMessage(d->nextClipboardViewer, m->message, m->wParam, m->lParam);
+ if (ptrIsHungAppWindow == 0) {
+ QSystemLibrary library(QLatin1String("User32"));
+ ptrIsHungAppWindow = (PtrIsHungAppWindow)library.resolve("IsHungAppWindow");
+ }
+ if (ptrIsHungAppWindow && ptrIsHungAppWindow(d->nextClipboardViewer)) {
+ qWarning("%s: Cowardly refusing to send clipboard message to hung application...", Q_FUNC_INFO);
+ } else {
+ SendMessage(d->nextClipboardViewer, m->message, m->wParam, m->lParam);
+ }
}
return true;
diff --git a/src/gui/kernel/qdesktopwidget_s60.cpp b/src/gui/kernel/qdesktopwidget_s60.cpp
index 3653ae2..62a4d40 100644
--- a/src/gui/kernel/qdesktopwidget_s60.cpp
+++ b/src/gui/kernel/qdesktopwidget_s60.cpp
@@ -44,36 +44,67 @@
#include "qwidget_p.h"
#include "qt_s60_p.h"
#include <w32std.h>
-
-#include "hal.h"
-#include "hal_data.h"
+#if defined(Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS)
+#include <graphics/displaycontrol.h>
+#endif
QT_BEGIN_NAMESPACE
-class QDesktopWidgetPrivate : public QWidgetPrivate
+extern int qt_symbian_create_desktop_on_screen;
+
+class QSingleDesktopWidget : public QWidget
+{
+public:
+ QSingleDesktopWidget();
+ ~QSingleDesktopWidget();
+};
+
+QSingleDesktopWidget::QSingleDesktopWidget()
+ : QWidget(0, Qt::Desktop)
+{
+}
+
+QSingleDesktopWidget::~QSingleDesktopWidget()
{
+ const QObjectList &childList = children();
+ for (int i = childList.size(); i > 0 ;) {
+ --i;
+ childList.at(i)->setParent(0);
+ }
+}
+class QDesktopWidgetPrivate : public QWidgetPrivate
+{
public:
QDesktopWidgetPrivate();
~QDesktopWidgetPrivate();
-
static void init(QDesktopWidget *that);
static void cleanup();
+ static void init_sys();
static int screenCount;
static int primaryScreen;
static QVector<QRect> *rects;
static QVector<QRect> *workrects;
+ static QVector<QWidget *> *screens;
static int refcount;
+
+#if defined(Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS)
+ static MDisplayControl *displayControl;
+#endif
};
int QDesktopWidgetPrivate::screenCount = 1;
int QDesktopWidgetPrivate::primaryScreen = 0;
QVector<QRect> *QDesktopWidgetPrivate::rects = 0;
QVector<QRect> *QDesktopWidgetPrivate::workrects = 0;
+QVector<QWidget *> *QDesktopWidgetPrivate::screens = 0;
int QDesktopWidgetPrivate::refcount = 0;
+#if defined(Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS)
+MDisplayControl *QDesktopWidgetPrivate::displayControl = 0;
+#endif
QDesktopWidgetPrivate::QDesktopWidgetPrivate()
{
@@ -88,25 +119,55 @@ QDesktopWidgetPrivate::~QDesktopWidgetPrivate()
void QDesktopWidgetPrivate::init(QDesktopWidget *that)
{
- Q_UNUSED(that);
-// int screenCount=0;
-
- // ### TODO: Implement proper multi-display support
- QDesktopWidgetPrivate::screenCount = 1;
-// if (HAL::Get(0, HALData::EDisplayNumberOfScreens, screenCount) == KErrNone)
-// QDesktopWidgetPrivate::screenCount = screenCount;
-// else
-// QDesktopWidgetPrivate::screenCount = 0;
+ // Note that on S^3 devices the screen count retrieved via RWsSession
+ // will always be 2 but the width and height for screen number 1 will
+ // be 0 as long as TV-out is not connected.
+ //
+ // On the other hand a valid size for screen 1 will be reported even
+ // after the cable is disconnected. In order to overcome this, we use
+ // MDisplayControl::NumberOfResolutions() to check if the display is
+ // valid or not.
+
+ screenCount = S60->screenCount();
+#if defined(Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS)
+ if (displayControl) {
+ if (displayControl->NumberOfResolutions() < 1)
+ screenCount = 1;
+ }
+#endif
+ if (screenCount < 1) {
+ qWarning("No screen available");
+ screenCount = 1;
+ }
rects = new QVector<QRect>();
workrects = new QVector<QRect>();
-
- rects->resize(QDesktopWidgetPrivate::screenCount);
- workrects->resize(QDesktopWidgetPrivate::screenCount);
-
- (*rects)[0].setRect(0, 0, S60->screenWidthInPixels, S60->screenHeightInPixels);
- QRect wr = qt_TRect2QRect(static_cast<CEikAppUi*>(S60->appUi())->ClientRect());
- (*workrects)[0].setRect(wr.x(), wr.y(), wr.width(), wr.height());
+ screens = new QVector<QWidget *>();
+
+ rects->resize(screenCount);
+ workrects->resize(screenCount);
+ screens->resize(screenCount);
+
+ for (int i = 0; i < screenCount; ++i) {
+ // All screens will have a position of (0, 0) as there is no true virtual desktop
+ // or pointer event support for multiple screens on Symbian.
+ QRect r(0, 0,
+ S60->screenWidthInPixelsForScreen[i], S60->screenHeightInPixelsForScreen[i]);
+ // Stop here if empty and ignore this screen.
+ if (r.isEmpty()) {
+ screenCount = i;
+ break;
+ }
+ (*rects)[i] = r;
+ QRect wr;
+ if (i == 0)
+ wr = qt_TRect2QRect(static_cast<CEikAppUi*>(S60->appUi())->ClientRect());
+ else
+ wr = rects->at(i);
+ (*workrects)[i].setRect(wr.x(), wr.y(), wr.width(), wr.height());
+ (*screens)[i] = 0;
+ }
+ (*screens)[0] = that;
}
void QDesktopWidgetPrivate::cleanup()
@@ -115,6 +176,29 @@ void QDesktopWidgetPrivate::cleanup()
rects = 0;
delete workrects;
workrects = 0;
+ if (screens) {
+ // First item is the QDesktopWidget so skip it.
+ for (int i = 1; i < screens->count(); ++i)
+ delete screens->at(i);
+ }
+ delete screens;
+ screens = 0;
+}
+
+void QDesktopWidgetPrivate::init_sys()
+{
+#if defined(Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS)
+ if (S60->screenCount() > 1) {
+ CWsScreenDevice *dev = S60->screenDevice(1);
+ if (dev) {
+ displayControl = static_cast<MDisplayControl *>(
+ dev->GetInterface(MDisplayControl::ETypeId));
+ if (displayControl) {
+ displayControl->EnableDisplayChangeEvents(ETrue);
+ }
+ }
+ }
+#endif
}
@@ -122,6 +206,7 @@ QDesktopWidget::QDesktopWidget()
: QWidget(*new QDesktopWidgetPrivate, 0, Qt::Desktop)
{
setObjectName(QLatin1String("desktop"));
+ QDesktopWidgetPrivate::init_sys();
QDesktopWidgetPrivate::init(this);
}
@@ -131,7 +216,7 @@ QDesktopWidget::~QDesktopWidget()
bool QDesktopWidget::isVirtualDesktop() const
{
- return true;
+ return false;
}
int QDesktopWidget::primaryScreen() const
@@ -145,9 +230,23 @@ int QDesktopWidget::numScreens() const
return QDesktopWidgetPrivate::screenCount;
}
-QWidget *QDesktopWidget::screen(int /* screen */)
+static inline QWidget *newSingleDesktopWidget(int screen)
{
- return this;
+ qt_symbian_create_desktop_on_screen = screen;
+ QWidget *w = new QSingleDesktopWidget;
+ qt_symbian_create_desktop_on_screen = -1;
+ return w;
+}
+
+QWidget *QDesktopWidget::screen(int screen)
+{
+ Q_D(QDesktopWidget);
+ if (screen < 0 || screen >= d->screenCount)
+ screen = d->primaryScreen;
+ if (!d->screens->at(screen)
+ || d->screens->at(screen)->windowType() != Qt::Desktop)
+ (*d->screens)[screen] = newSingleDesktopWidget(screen);
+ return (*d->screens)[screen];
}
const QRect QDesktopWidget::availableGeometry(int screen) const
@@ -168,14 +267,19 @@ const QRect QDesktopWidget::screenGeometry(int screen) const
return d->rects->at(screen);
}
-int QDesktopWidget::screenNumber(const QWidget * /* widget */) const
+int QDesktopWidget::screenNumber(const QWidget *widget) const
{
- return QDesktopWidgetPrivate::primaryScreen;
+ Q_D(const QDesktopWidget);
+ return widget
+ ? S60->screenNumberForWidget(widget)
+ : d->primaryScreen;
}
-int QDesktopWidget::screenNumber(const QPoint & /* point */) const
+int QDesktopWidget::screenNumber(const QPoint &point) const
{
- return QDesktopWidgetPrivate::primaryScreen;
+ Q_UNUSED(point);
+ Q_D(const QDesktopWidget);
+ return d->primaryScreen;
}
void QDesktopWidget::resizeEvent(QResizeEvent *)
@@ -203,6 +307,10 @@ void QDesktopWidget::resizeEvent(QResizeEvent *)
if (oldrect != newrect)
emit workAreaResized(j);
}
+
+ if (oldscreencount != d->screenCount) {
+ emit screenCountChanged(d->screenCount);
+ }
}
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index 40697bf..3bb27c3 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -64,6 +64,7 @@
#include "qapplication.h"
#include "qelapsedtimer.h"
#include "QtCore/qthreadstorage.h"
+#include "qwidget_p.h"
#include <w32std.h>
#include <coecntrl.h>
#include <eikenv.h>
@@ -84,6 +85,8 @@ QT_BEGIN_NAMESPACE
// system events seems to start with 0x10
const TInt KInternalStatusPaneChange = 0x50000000;
+static const int qt_symbian_max_screens = 4;
+
//this macro exists because EColor16MAP enum value doesn't exist in Symbian OS 9.2
#define Q_SYMBIAN_ECOLOR16MAP TDisplayMode(13)
@@ -142,7 +145,10 @@ public:
int avkonComponentsSupportTransparency : 1;
int menuBeingConstructed : 1;
int orientationSet : 1;
+ int partial_keyboard : 1;
QApplication::QS60MainApplicationFactory s60ApplicationFactory; // typedef'ed pointer type
+ QPointer<QWidget> splitViewLastWidget;
+
static CEikButtonGroupContainer *cba;
enum ScanCodeState {
@@ -154,8 +160,14 @@ public:
static inline void updateScreenSize();
inline RWsSession& wsSession();
+ static inline int screenCount();
static inline RWindowGroup& windowGroup();
+ static inline RWindowGroup& windowGroup(const QWidget *widget);
+ static inline RWindowGroup& windowGroup(int screenNumber);
inline CWsScreenDevice* screenDevice();
+ inline CWsScreenDevice* screenDevice(const QWidget *widget);
+ inline CWsScreenDevice* screenDevice(int screenNumber);
+ static inline int screenNumberForWidget(const QWidget *widget);
static inline CCoeAppUi* appUi();
static inline CEikMenuBar* menuBar();
#ifdef Q_WS_S60
@@ -172,6 +184,11 @@ public:
#ifdef Q_OS_SYMBIAN
TTrapHandler *s60InstalledTrapHandler;
#endif
+
+ int screenWidthInPixelsForScreen[qt_symbian_max_screens];
+ int screenHeightInPixelsForScreen[qt_symbian_max_screens];
+ int screenWidthInTwipsForScreen[qt_symbian_max_screens];
+ int screenHeightInTwipsForScreen[qt_symbian_max_screens];
};
Q_AUTOTEST_EXPORT QS60Data* qGlobalS60Data();
@@ -252,6 +269,7 @@ private:
#ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
void translateAdvancedPointerEvent(const TAdvancedPointerEvent *event);
#endif
+ bool isSplitViewWidget(QWidget *widget);
public:
void handleClientAreaChange();
@@ -270,6 +288,8 @@ private:
// Fader object used to fade everything except this menu and the CBA.
TAknPopupFader popupFader;
#endif
+
+ bool m_inExternalScreenOverride : 1;
};
inline QS60Data::QS60Data()
@@ -297,6 +317,7 @@ inline QS60Data::QS60Data()
avkonComponentsSupportTransparency(0),
menuBeingConstructed(0),
orientationSet(0),
+ partial_keyboard(0),
s60ApplicationFactory(0)
#ifdef Q_OS_SYMBIAN
,s60InstalledTrapHandler(0)
@@ -320,6 +341,17 @@ inline void QS60Data::updateScreenSize()
S60->defaultDpiY = S60->screenHeightInPixels / inches;
inches = S60->screenWidthInTwips / (TReal)KTwipsPerInch;
S60->defaultDpiX = S60->screenWidthInPixels / inches;
+
+ int screens = S60->screenCount();
+ for (int i = 0; i < screens; ++i) {
+ CWsScreenDevice *dev = S60->screenDevice(i);
+ mode = dev->CurrentScreenMode();
+ dev->GetScreenModeSizeAndRotation(mode, params);
+ S60->screenWidthInPixelsForScreen[i] = params.iPixelSize.iWidth;
+ S60->screenHeightInPixelsForScreen[i] = params.iPixelSize.iHeight;
+ S60->screenWidthInTwipsForScreen[i] = params.iTwipsSize.iWidth;
+ S60->screenHeightInTwipsForScreen[i] = params.iTwipsSize.iHeight;
+ }
}
inline RWsSession& QS60Data::wsSession()
@@ -330,11 +362,38 @@ inline RWsSession& QS60Data::wsSession()
return tls.localData()->wsSession;
}
+inline int QS60Data::screenCount()
+{
+#if defined(Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS)
+ CCoeEnv *env = CCoeEnv::Static();
+ if (env) {
+ return qMin(env->WsSession().NumberOfScreens(), qt_symbian_max_screens);
+ }
+#endif
+ return 1;
+}
+
inline RWindowGroup& QS60Data::windowGroup()
{
return CCoeEnv::Static()->RootWin();
}
+inline RWindowGroup& QS60Data::windowGroup(const QWidget *widget)
+{
+ return windowGroup(screenNumberForWidget(widget));
+}
+
+inline RWindowGroup& QS60Data::windowGroup(int screenNumber)
+{
+#if defined(Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS)
+ RWindowGroup *wg = CCoeEnv::Static()->RootWin(screenNumber);
+ return wg ? *wg : windowGroup();
+#else
+ Q_UNUSED(screenNumber);
+ return windowGroup();
+#endif
+}
+
inline CWsScreenDevice* QS60Data::screenDevice()
{
if(!tls.hasLocalData()) {
@@ -343,6 +402,36 @@ inline CWsScreenDevice* QS60Data::screenDevice()
return tls.localData()->screenDevice;
}
+inline CWsScreenDevice* QS60Data::screenDevice(const QWidget *widget)
+{
+ return screenDevice(screenNumberForWidget(widget));
+}
+
+inline CWsScreenDevice* QS60Data::screenDevice(int screenNumber)
+{
+#if defined(Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS)
+ CCoeEnv *env = CCoeEnv::Static();
+ if (env) {
+ CWsScreenDevice *dev = env->ScreenDevice(screenNumber);
+ return dev ? dev : screenDevice();
+ } else {
+ return screenDevice();
+ }
+#else
+ return screenDevice();
+#endif
+}
+
+inline int QS60Data::screenNumberForWidget(const QWidget *widget)
+{
+ if (!widget)
+ return 0;
+ const QWidget *w = widget;
+ while (w->parentWidget())
+ w = w->parentWidget();
+ return qt_widget_private(const_cast<QWidget *>(w))->symbianScreenNumber;
+}
+
inline CCoeAppUi* QS60Data::appUi()
{
return CCoeEnv::Static()-> AppUi();
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 7065e85..18255a1 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -304,6 +304,8 @@ QWidgetPrivate::QWidgetPrivate(int version)
, hasAlienChildren(0)
, window_event(0)
, qd_hd(0)
+#elif defined(Q_OS_SYMBIAN)
+ , symbianScreenNumber(0)
#endif
{
if (!qApp) {
@@ -596,7 +598,6 @@ void QWidget::setAutoFillBackground(bool enabled)
\ingroup basicwidgets
-
The widget is the atom of the user interface: it receives mouse, keyboard
and other events from the window system, and paints a representation of
itself on the screen. Every widget is rectangular, and they are sorted in a
@@ -1284,6 +1285,10 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
// programmer specified desktop widget
xinfo = desktopWidget->d_func()->xinfo;
}
+#elif defined(Q_OS_SYMBIAN)
+ if (desktopWidget) {
+ symbianScreenNumber = qt_widget_private(desktopWidget)->symbianScreenNumber;
+ }
#else
Q_UNUSED(desktopWidget);
#endif
@@ -1320,8 +1325,8 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
//give potential windows a bigger "pre-initial" size; create_sys() will give them a new size later
#ifdef Q_OS_SYMBIAN
if (isGLWidget) {
- // Don't waste GPU mem for unnecessary large egl surface
- data.crect = QRect(0,0,2,2);
+ // Don't waste GPU mem for unnecessary large egl surface until resized by application
+ data.crect = QRect(0,0,1,1);
} else {
data.crect = parentWidget ? QRect(0,0,100,30) : QRect(0,0,360,640);
}
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index 9f6ba6f..13e2349 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -315,6 +315,11 @@ struct QWExtra {
*/
ZeroFill,
+ /**
+ * Blit backing store, propagating alpha channel into the framebuffer.
+ */
+ BlitWriteAlpha,
+
Default = Blit
};
@@ -877,6 +882,7 @@ public:
#elif defined(Q_OS_SYMBIAN) // <--------------------------------------------------------- SYMBIAN
static QWidget *mouseGrabber;
static QWidget *keyboardGrabber;
+ int symbianScreenNumber; // only valid for desktop widget and top-levels
void s60UpdateIsOpaque();
void reparentChildren();
void registerTouchWindow();
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index af9ae47..b65ae4d 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -84,6 +84,8 @@ QWidget *QWidgetPrivate::mouseGrabber = 0;
QWidget *QWidgetPrivate::keyboardGrabber = 0;
CEikButtonGroupContainer *QS60Data::cba = 0;
+int qt_symbian_create_desktop_on_screen = -1;
+
static bool isEqual(const QList<QAction*>& a, const QList<QAction*>& b)
{
if ( a.count() != b.count())
@@ -349,12 +351,18 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
int sh = clientRect.Height();
if (desktop) {
- TSize screenSize = S60->screenDevice()->SizeInPixels();
+ symbianScreenNumber = qMax(qt_symbian_create_desktop_on_screen, 0);
+ TSize screenSize = S60->screenDevice(symbianScreenNumber)->SizeInPixels();
data.crect.setRect(0, 0, screenSize.iWidth, screenSize.iHeight);
q->setAttribute(Qt::WA_DontShowOnScreen);
} else if (topLevel && !q->testAttribute(Qt::WA_Resized)){
int width = sw;
int height = sh;
+ if (symbianScreenNumber > 0) {
+ TSize screenSize = S60->screenDevice(symbianScreenNumber)->SizeInPixels();
+ width = screenSize.iWidth;
+ height = screenSize.iHeight;
+ }
if (extra) {
width = qMax(qMin(width, extra->maxw), extra->minw);
height = qMax(qMin(height, extra->maxh), extra->minh);
@@ -640,7 +648,7 @@ void QWidgetPrivate::raise_sys()
// If toplevel widget, raise app to foreground
if (q->isWindow())
- S60->wsSession().SetWindowGroupOrdinalPosition(S60->windowGroup().Identifier(), 0);
+ S60->wsSession().SetWindowGroupOrdinalPosition(S60->windowGroup(q).Identifier(), 0);
}
}
@@ -652,7 +660,7 @@ void QWidgetPrivate::lower_sys()
if (q->internalWinId()) {
// If toplevel widget, lower app to background
if (q->isWindow())
- S60->wsSession().SetWindowGroupOrdinalPosition(S60->windowGroup().Identifier(), -1);
+ S60->wsSession().SetWindowGroupOrdinalPosition(S60->windowGroup(q).Identifier(), -1);
else
q->internalWinId()->DrawableWindow()->SetOrdinalPosition(-1);
}
@@ -722,6 +730,11 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f)
{
Q_Q(QWidget);
+ if (parent && parent->windowType() == Qt::Desktop) {
+ symbianScreenNumber = qt_widget_private(parent)->symbianScreenNumber;
+ parent = 0;
+ }
+
bool wasCreated = q->testAttribute(Qt::WA_WState_Created);
if (q->isVisible() && q->parentWidget() && parent != q->parentWidget())
@@ -792,25 +805,33 @@ void QWidgetPrivate::s60UpdateIsOpaque()
{
Q_Q(QWidget);
- if (!q->testAttribute(Qt::WA_WState_Created) || !q->testAttribute(Qt::WA_TranslucentBackground))
+ if (!q->testAttribute(Qt::WA_WState_Created))
return;
+ const bool writeAlpha = extraData()->nativePaintMode == QWExtra::BlitWriteAlpha;
+ if (!q->testAttribute(Qt::WA_TranslucentBackground) && !writeAlpha)
+ return;
+ const bool requireAlphaChannel = !isOpaque || writeAlpha;
+
createTLExtra();
RWindow *const window = static_cast<RWindow *>(q->effectiveWinId()->DrawableWindow());
#ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
- window->SetSurfaceTransparency(!isOpaque);
- extra->topextra->nativeWindowTransparencyEnabled = !isOpaque;
-#else
- if (!isOpaque) {
+ if (QApplicationPrivate::instance()->useTranslucentEGLSurfaces) {
+ window->SetSurfaceTransparency(!isOpaque);
+ extra->topextra->nativeWindowTransparencyEnabled = !isOpaque;
+ return;
+ }
+#endif
+ if (requireAlphaChannel) {
const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA));
if (window->SetTransparencyAlphaChannel() == KErrNone) {
window->SetBackgroundColor(TRgb(255, 255, 255, 0));
extra->topextra->nativeWindowTransparencyEnabled = 1;
-
- if (extra->topextra->backingStore.data() &&
- QApplicationPrivate::graphics_system_name == QLatin1String("openvg")) {
+ if (extra->topextra->backingStore.data() && (
+ QApplicationPrivate::graphics_system_name == QLatin1String("openvg")
+ || QApplicationPrivate::graphics_system_name == QLatin1String("opengl"))) {
// Semi-transparent EGL surfaces aren't supported. We need to
// recreate backing store to get translucent surface (raster surface).
extra->topextra->backingStore.create(q);
@@ -821,7 +842,6 @@ void QWidgetPrivate::s60UpdateIsOpaque()
window->SetTransparentRegion(TRegionFix<1>());
extra->topextra->nativeWindowTransparencyEnabled = 0;
}
-#endif
}
void QWidgetPrivate::setWindowIcon_sys(bool forceReset)
@@ -1037,7 +1057,7 @@ int QWidget::metric(PaintDeviceMetric m) const
} else if (m == PdmHeight) {
val = data->crect.height();
} else {
- CWsScreenDevice *scr = S60->screenDevice();
+ CWsScreenDevice *scr = S60->screenDevice(this);
switch(m) {
case PdmDpiX:
case PdmPhysicalDpiX:
@@ -1207,7 +1227,16 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
const bool cbaVisibilityHint = windowFlags() & Qt::WindowSoftkeysVisibleHint;
if (newstate & Qt::WindowFullScreen && !cbaVisibilityHint) {
setAttribute(Qt::WA_OutsideWSRange, false);
- window->SetExtentToWholeScreen();
+ if (d->symbianScreenNumber > 0) {
+ int w = S60->screenWidthInPixelsForScreen[d->symbianScreenNumber];
+ int h = S60->screenHeightInPixelsForScreen[d->symbianScreenNumber];
+ if (w <= 0 || h <= 0)
+ window->SetExtentToWholeScreen();
+ else
+ window->SetExtent(TPoint(0, 0), TSize(w, h));
+ } else {
+ window->SetExtentToWholeScreen();
+ }
} else if (newstate & Qt::WindowMaximized || ((newstate & Qt::WindowFullScreen) && cbaVisibilityHint)) {
setAttribute(Qt::WA_OutsideWSRange, false);
TRect maxExtent = qt_QRect2TRect(qApp->desktop()->availableGeometry(this));
diff --git a/src/gui/math3d/qvector2d.cpp b/src/gui/math3d/qvector2d.cpp
index 7f5a937..1fccfc9 100644
--- a/src/gui/math3d/qvector2d.cpp
+++ b/src/gui/math3d/qvector2d.cpp
@@ -60,6 +60,11 @@ QT_BEGIN_NAMESPACE
The QVector2D class can also be used to represent vertices in 2D space.
We therefore do not need to provide a separate vertex class.
+ \bold{Note:} By design values in the QVector2D instance are stored as \c float.
+ This means that on platforms where the \c qreal arguments to QVector2D
+ functions are represented by \c double values, it is possible to
+ lose precision.
+
\sa QVector3D, QVector4D, QQuaternion
*/
diff --git a/src/gui/math3d/qvector3d.cpp b/src/gui/math3d/qvector3d.cpp
index 2414b5f..7bf0400 100644
--- a/src/gui/math3d/qvector3d.cpp
+++ b/src/gui/math3d/qvector3d.cpp
@@ -63,6 +63,11 @@ QT_BEGIN_NAMESPACE
The QVector3D class can also be used to represent vertices in 3D space.
We therefore do not need to provide a separate vertex class.
+ \bold{Note:} By design values in the QVector3D instance are stored as \c float.
+ This means that on platforms where the \c qreal arguments to QVector3D
+ functions are represented by \c double values, it is possible to
+ lose precision.
+
\sa QVector2D, QVector4D, QQuaternion
*/
diff --git a/src/gui/math3d/qvector4d.cpp b/src/gui/math3d/qvector4d.cpp
index 74dedc4..23befc0 100644
--- a/src/gui/math3d/qvector4d.cpp
+++ b/src/gui/math3d/qvector4d.cpp
@@ -59,6 +59,11 @@ QT_BEGIN_NAMESPACE
The QVector4D class can also be used to represent vertices in 4D space.
We therefore do not need to provide a separate vertex class.
+ \bold{Note:} By design values in the QVector4D instance are stored as \c float.
+ This means that on platforms where the \c qreal arguments to QVector4D
+ functions are represented by \c double values, it is possible to
+ lose precision.
+
\sa QQuaternion, QVector2D, QVector3D
*/
diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp
index 83c58c4..4fcff1d 100644
--- a/src/gui/painting/qbackingstore.cpp
+++ b/src/gui/painting/qbackingstore.cpp
@@ -1117,6 +1117,11 @@ void QWidgetBackingStore::sync(QWidget *exposedWidget, const QRegion &exposedReg
return;
}
+ // If there's no partial update support we always need
+ // to do a full repaint before flushing
+ if (!windowSurface->hasPartialUpdateSupport())
+ fullUpdatePending = true;
+
// Nothing to repaint.
if (!isDirty()) {
qt_flush(exposedWidget, exposedRegion, windowSurface, tlw, tlwOffset);
diff --git a/src/gui/painting/qgraphicssystem.cpp b/src/gui/painting/qgraphicssystem.cpp
index 770d947..5112019 100644
--- a/src/gui/painting/qgraphicssystem.cpp
+++ b/src/gui/painting/qgraphicssystem.cpp
@@ -84,4 +84,9 @@ QPixmapData *QGraphicsSystem::createPixmapData(QPixmapData *origin)
return createPixmapData(origin->pixelType());
}
+void QGraphicsSystem::releaseCachedResources()
+{
+ // Do nothing here
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/painting/qgraphicssystem_p.h b/src/gui/painting/qgraphicssystem_p.h
index 76e9a8e..80e8959 100644
--- a/src/gui/painting/qgraphicssystem_p.h
+++ b/src/gui/painting/qgraphicssystem_p.h
@@ -72,6 +72,8 @@ public:
//### Remove this & change qpixmap.cpp & qbitmap.cpp once every platform is gaurenteed
// to have a graphics system.
static QPixmapData *createDefaultPixmapData(QPixmapData::PixelType type);
+
+ virtual void releaseCachedResources();
};
QT_END_NAMESPACE
diff --git a/src/gui/painting/qgraphicssystem_runtime.cpp b/src/gui/painting/qgraphicssystem_runtime.cpp
index 5841d40..33652ee 100644
--- a/src/gui/painting/qgraphicssystem_runtime.cpp
+++ b/src/gui/painting/qgraphicssystem_runtime.cpp
@@ -394,7 +394,10 @@ void QRuntimeGraphicsSystem::setGraphicsSystem(const QString &name)
if(m_windowSurfaceDestroyPolicy == DestroyAfterFirstFlush)
proxy->m_pendingWindowSurface.reset(proxy->m_windowSurface.take());
- proxy->m_windowSurface.reset(m_graphicsSystem->createWindowSurface(widget));
+ QWindowSurface *newWindowSurface = m_graphicsSystem->createWindowSurface(widget);
+ newWindowSurface->setGeometry(proxy->geometry());
+
+ proxy->m_windowSurface.reset(newWindowSurface);
qt_widget_private(widget)->invalidateBuffer(widget->rect());
}
diff --git a/src/gui/painting/qpaintengine_s60.cpp b/src/gui/painting/qpaintengine_s60.cpp
index 1bc7799..ca303be 100644
--- a/src/gui/painting/qpaintengine_s60.cpp
+++ b/src/gui/painting/qpaintengine_s60.cpp
@@ -41,6 +41,7 @@
#include <private/qpaintengine_s60_p.h>
#include <private/qpixmap_s60_p.h>
#include <private/qt_s60_p.h>
+#include <private/qvolatileimage_p.h>
QT_BEGIN_NAMESPACE
@@ -90,7 +91,15 @@ void QS60PaintEngine::drawPixmap(const QPointF &p, const QPixmap &pm)
QRasterPaintEngine::drawPixmap(p, pm);
srcData->endDataAccess();
} else {
- QRasterPaintEngine::drawPixmap(p, pm);
+ void *nativeData = pm.pixmapData()->toNativeType(QPixmapData::VolatileImage);
+ if (nativeData) {
+ QVolatileImage *img = static_cast<QVolatileImage *>(nativeData);
+ img->beginDataAccess();
+ QRasterPaintEngine::drawImage(p, img->imageRef());
+ img->endDataAccess(true);
+ } else {
+ QRasterPaintEngine::drawPixmap(p, pm);
+ }
}
}
@@ -102,7 +111,15 @@ void QS60PaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRect
QRasterPaintEngine::drawPixmap(r, pm, sr);
srcData->endDataAccess();
} else {
- QRasterPaintEngine::drawPixmap(r, pm, sr);
+ void *nativeData = pm.pixmapData()->toNativeType(QPixmapData::VolatileImage);
+ if (nativeData) {
+ QVolatileImage *img = static_cast<QVolatileImage *>(nativeData);
+ img->beginDataAccess();
+ QRasterPaintEngine::drawImage(r, img->imageRef(), sr);
+ img->endDataAccess(true);
+ } else {
+ QRasterPaintEngine::drawPixmap(r, pm, sr);
+ }
}
}
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp
index 9ef6955..0948a64 100644
--- a/src/gui/painting/qpainterpath.cpp
+++ b/src/gui/painting/qpainterpath.cpp
@@ -1690,7 +1690,7 @@ static void qt_painterpath_isect_line(const QPointF &p1,
}
static void qt_painterpath_isect_curve(const QBezier &bezier, const QPointF &pt,
- int *winding)
+ int *winding, int depth = 0)
{
qreal y = pt.y();
qreal x = pt.x();
@@ -1705,7 +1705,7 @@ static void qt_painterpath_isect_curve(const QBezier &bezier, const QPointF &pt,
// hit lower limit... This is a rough threshold, but its a
// tradeoff between speed and precision.
const qreal lower_bound = qreal(.001);
- if (bounds.width() < lower_bound && bounds.height() < lower_bound) {
+ if (depth == 32 || (bounds.width() < lower_bound && bounds.height() < lower_bound)) {
// We make the assumption here that the curve starts to
// approximate a line after while (i.e. that it doesn't
// change direction drastically during its slope)
@@ -1718,8 +1718,8 @@ static void qt_painterpath_isect_curve(const QBezier &bezier, const QPointF &pt,
// split curve and try again...
QBezier first_half, second_half;
bezier.split(&first_half, &second_half);
- qt_painterpath_isect_curve(first_half, pt, winding);
- qt_painterpath_isect_curve(second_half, pt, winding);
+ qt_painterpath_isect_curve(first_half, pt, winding, depth + 1);
+ qt_painterpath_isect_curve(second_half, pt, winding, depth + 1);
}
}
diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp
index 9f371a8..cb53ea0 100644
--- a/src/gui/painting/qwindowsurface_s60.cpp
+++ b/src/gui/painting/qwindowsurface_s60.cpp
@@ -63,7 +63,6 @@ struct QS60WindowSurfacePrivate
TDisplayMode displayMode(bool opaque)
{
-
TDisplayMode mode = S60->screenDevice()->DisplayMode();
if (opaque) {
mode = EColor16MU;
@@ -76,10 +75,18 @@ TDisplayMode displayMode(bool opaque)
return mode;
}
+bool blitWriteAlpha(QWidgetPrivate *widgetPrivate)
+{
+ QWExtra *extra = widgetPrivate->extraData();
+ return extra ? extra->nativePaintMode == QWExtra::BlitWriteAlpha : false;
+}
+
QS60WindowSurface::QS60WindowSurface(QWidget* widget)
: QWindowSurface(widget), d_ptr(new QS60WindowSurfacePrivate)
{
- TDisplayMode mode = displayMode(qt_widget_private(widget)->isOpaque);
+ QWidgetPrivate *widgetPrivate = qt_widget_private(widget);
+ const bool opaque = widgetPrivate->isOpaque && !blitWriteAlpha(widgetPrivate);
+ TDisplayMode mode = displayMode(opaque);
// We create empty CFbsBitmap here -> it will be resized in setGeometry
CFbsBitmap *bitmap = q_check_ptr(new CFbsBitmap); // CBase derived object needs check on new
qt_symbian_throwIfError( bitmap->Create( TSize(0, 0), mode ) );
@@ -123,7 +130,8 @@ void QS60WindowSurface::beginPaint(const QRegion &rgn)
S60->wsSession().Finish();
#endif
- if (!qt_widget_private(window())->isOpaque) {
+ QWidgetPrivate *windowPrivate = qt_widget_private(window());
+ if (!windowPrivate->isOpaque || blitWriteAlpha(windowPrivate)) {
QS60PixmapData *pixmapData = static_cast<QS60PixmapData *>(d_ptr->device.data_ptr().data());
TDisplayMode mode = displayMode(false);
@@ -132,12 +140,14 @@ void QS60WindowSurface::beginPaint(const QRegion &rgn)
pixmapData->beginDataAccess();
- QPainter p(&pixmapData->image);
- p.setCompositionMode(QPainter::CompositionMode_Source);
- const QVector<QRect> rects = rgn.rects();
- const QColor blank = Qt::transparent;
- for (QVector<QRect>::const_iterator it = rects.begin(); it != rects.end(); ++it) {
- p.fillRect(*it, blank);
+ if (!windowPrivate->isOpaque) {
+ QPainter p(&pixmapData->image);
+ p.setCompositionMode(QPainter::CompositionMode_Source);
+ const QVector<QRect> rects = rgn.rects();
+ const QColor blank = Qt::transparent;
+ for (QVector<QRect>::const_iterator it = rects.begin(); it != rects.end(); ++it) {
+ p.fillRect(*it, blank);
+ }
}
pixmapData->endDataAccess();
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 38a4b7c..a9e10a3 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -118,6 +118,7 @@ const short *QS60StylePrivate::m_pmPointer = QS60StylePrivate::data[0];
// theme background texture
QPixmap *QS60StylePrivate::m_background = 0;
+QPixmap *QS60StylePrivate::m_placeHolderTexture = 0;
// theme palette
QPalette *QS60StylePrivate::m_themePalette = 0;
@@ -155,6 +156,10 @@ const double KTabFontMul = 0.72;
QS60StylePrivate::~QS60StylePrivate()
{
clearCaches(); //deletes also background image
+ if (m_placeHolderTexture) {
+ delete m_placeHolderTexture;
+ m_placeHolderTexture = 0;
+ }
deleteThemePalette();
#ifdef Q_WS_S60
removeAnimations();
@@ -505,7 +510,10 @@ void QS60StylePrivate::setBackgroundTexture(QApplication *app) const
{
Q_UNUSED(app)
QPalette applicationPalette = QApplication::palette();
- applicationPalette.setBrush(QPalette::Window, backgroundTexture());
+ // The initial QPalette::Window is just a placeHolder QPixmap to save RAM
+ // if the actual texture is not needed. The real texture is created just before
+ // painting it in qt_s60_fill_background().
+ applicationPalette.setBrush(QPalette::Window, placeHolderTexture());
setThemePalette(&applicationPalette);
}
@@ -630,25 +638,6 @@ QPixmap QS60StylePrivate::cachedFrame(SkinFrameElements frame, const QSize &size
return result;
}
-void QS60StylePrivate::refreshUI()
-{
- QList<QWidget *> widgets = QApplication::allWidgets();
-
- for (int i = 0; i < widgets.size(); ++i) {
- QWidget *widget = widgets.at(i);
- if (widget == 0)
- continue;
-
- if (widget->style()) {
- widget->style()->polish(widget);
- QEvent event(QEvent::StyleChange);
- qApp->sendEvent(widget, &event);
- }
- widget->update();
- widget->updateGeometry();
- }
-}
-
void QS60StylePrivate::setFont(QWidget *widget) const
{
QS60StyleEnums::FontCategories fontCategory = QS60StyleEnums::FC_Undefined;
@@ -678,7 +667,7 @@ void QS60StylePrivate::setFont(QWidget *widget) const
}
}
-void QS60StylePrivate::setThemePalette(QWidget *widget) const
+void QS60StylePrivate::setThemePalette(QWidget *widget)
{
if(!widget)
return;
@@ -719,8 +708,10 @@ void QS60StylePrivate::setThemePalette(QPalette *palette) const
palette->setColor(QPalette::LinkVisited, palette->color(QPalette::Link).darker());
palette->setColor(QPalette::Highlight,
s60Color(QS60StyleEnums::CL_QsnHighlightColors, 2, 0));
- // set background image as a texture brush
- palette->setBrush(QPalette::Window, backgroundTexture());
+ // The initial QPalette::Window is just a placeHolder QPixmap to save RAM
+ // if the actual texture is not needed. The real texture is created just before
+ // painting it in qt_s60_fill_background().
+ palette->setBrush(QPalette::Window, placeHolderTexture());
// set as transparent so that styled full screen theme background is visible
palette->setBrush(QPalette::Base, Qt::transparent);
// set button color based on pixel colors
@@ -761,7 +752,7 @@ void QS60StylePrivate::storeThemePalette(QPalette *palette)
}
// set widget specific palettes
-void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const
+void QS60StylePrivate::setThemePaletteHash(QPalette *palette)
{
if (!palette)
return;
@@ -2643,10 +2634,13 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
//native items have small empty areas at the beginning and end of menu item
sz.setWidth(sz.width() + 2 * pixelMetric(PM_MenuHMargin) + 2 * QS60StylePrivate::pixelMetric(PM_FrameCornerWidth));
- if (QS60StylePrivate::isTouchSupported())
+ if (QS60StylePrivate::isTouchSupported()) {
//Make itemview easier to use in touch devices
+ sz.setHeight(sz.height() + 2 * pixelMetric(PM_FocusFrameVMargin));
//QCommonStyle does not adjust height with horizontal margin, it only adjusts width
- sz.setHeight(sz.height() + 2 * pixelMetric(PM_FocusFrameVMargin) - 8); //QCommonstyle adds 8 to height that this style handles through PM values
+ if (ct == CT_MenuItem)
+ sz.setHeight(sz.height() - 8); //QCommonstyle adds 8 to height that this style handles through PM values
+ }
break;
#ifndef QT_NO_COMBOBOX
case CT_ComboBox: {
@@ -3545,10 +3539,18 @@ extern QPoint qt_s60_fill_background_offset(const QWidget *targetWidget);
bool qt_s60_fill_background(QPainter *painter, const QRegion &rgn, const QBrush &brush)
{
- const QPixmap backgroundTexture(QS60StylePrivate::backgroundTexture());
- if (backgroundTexture.cacheKey() != brush.texture().cacheKey())
+ // Check if the widget's palette matches placeholder or actual background texture.
+ // When accessing backgroundTexture, use parameter value 'true' to avoid creating
+ // the texture, if it is not already created.
+
+ const QPixmap placeHolder(QS60StylePrivate::placeHolderTexture());
+ const QPixmap bg(QS60StylePrivate::backgroundTexture(true));
+ if (placeHolder.cacheKey() != brush.texture().cacheKey()
+ && bg.cacheKey() != brush.texture().cacheKey())
return false;
+ const QPixmap backgroundTexture(QS60StylePrivate::backgroundTexture());
+
const QPaintDevice *target = painter->device();
if (target->devType() == QInternal::Widget) {
const QWidget *widget = static_cast<const QWidget *>(target);
diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h
index 242c451..3628b27 100644
--- a/src/gui/styles/qs60style_p.h
+++ b/src/gui/styles/qs60style_p.h
@@ -554,7 +554,8 @@ public:
static QPixmap frame(SkinFrameElements frame, const QSize &size,
SkinElementFlags flags = KDefaultSkinElementFlags);
- static QPixmap backgroundTexture();
+ static QPixmap backgroundTexture(bool skipCreation = false);
+ static QPixmap placeHolderTexture();
#ifdef Q_WS_S60
void handleDynamicLayoutVariantSwitch();
@@ -592,13 +593,11 @@ private:
static QPixmap cachedFrame(SkinFrameElements frame, const QSize &size,
SkinElementFlags flags = KDefaultSkinElementFlags);
- static void refreshUI();
-
// set S60 font for widget
void setFont(QWidget *widget) const;
- void setThemePalette(QWidget *widget) const;
+ static void setThemePalette(QWidget *widget);
void setThemePalette(QPalette *palette) const;
- void setThemePaletteHash(QPalette *palette) const;
+ static void setThemePaletteHash(QPalette *palette);
static void storeThemePalette(QPalette *palette);
static void deleteThemePalette();
static bool equalToThemePalette(QColor color, QPalette::ColorRole role);
@@ -616,6 +615,9 @@ private:
// Contains background texture.
static QPixmap *m_background;
+ // Placeholder pixmap for the real background texture.
+ static QPixmap *m_placeHolderTexture;
+
const static SkinElementFlags KDefaultSkinElementFlags;
// defined theme palette
static QPalette *m_themePalette;
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index 605872e..c5149a3 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -47,6 +47,7 @@
#include "private/qt_s60_p.h"
#include "private/qpixmap_s60_p.h"
#include "private/qcore_symbian_p.h"
+#include "private/qvolatileimage_p.h"
#include "qapplication.h"
#include "qsettings.h"
@@ -65,7 +66,6 @@
#include <aknnavi.h>
#include <gulicon.h>
#include <AknBitmapAnimation.h>
-
#include <centralrepository.h>
#if !defined(QT_NO_STYLE_S60) || defined(QT_PLUGIN)
@@ -637,9 +637,23 @@ QPixmap QS60StyleModeSpecifics::fromFbsBitmap(CFbsBitmap *icon, CFbsBitmap *mask
if (error)
return QPixmap();
- QPixmap pixmap = QPixmap::fromSymbianCFbsBitmap(icon);
- if (mask)
- pixmap.setAlphaChannel(QPixmap::fromSymbianCFbsBitmap(mask));
+ QPixmap pixmap;
+ QScopedPointer<QPixmapData> pd(QPixmapData::create(0, 0, QPixmapData::PixmapType));
+ if (mask) {
+ // Try the efficient path with less copying and conversion.
+ QVolatileImage img(icon, mask);
+ pd->fromNativeType(&img, QPixmapData::VolatileImage);
+ if (!pd->isNull())
+ pixmap = QPixmap(pd.take());
+ }
+ if (pixmap.isNull()) {
+ // Potentially more expensive path.
+ pd->fromNativeType(icon, QPixmapData::FbsBitmap);
+ pixmap = QPixmap(pd.take());
+ if (mask) {
+ pixmap.setAlphaChannel(QPixmap::fromSymbianCFbsBitmap(mask));
+ }
+ }
if ((flags & QS60StylePrivate::SF_PointEast) ||
(flags & QS60StylePrivate::SF_PointSouth) ||
@@ -795,6 +809,8 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsLX(
rotatedBy90or270 ? TSize(size.height(), size.width()) : qt_QSize2TSize(size);
MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
+ static const TDisplayMode displayMode = S60->supportsPremultipliedAlpha ? Q_SYMBIAN_ECOLOR16MAP : EColor16MA;
+ static const TInt drawParam = S60->supportsPremultipliedAlpha ? KAknsDrawParamDefault : KAknsDrawParamRGBOnly;
QPixmap result;
@@ -833,7 +849,7 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsLX(
// QS60WindowSurface::unlockBitmapHeap();
CFbsBitmap *background = new (ELeave) CFbsBitmap(); //offscreen
CleanupStack::PushL(background);
- User::LeaveIfError(background->Create(targetSize, EColor16MA));
+ User::LeaveIfError(background->Create(targetSize, displayMode));
CFbsBitmapDevice *dev = CFbsBitmapDevice::NewL(background);
CleanupStack::PushL(dev);
@@ -854,7 +870,7 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsLX(
*gc,
TPoint(),
targetSize,
- KAknsDrawParamDefault | KAknsDrawParamRGBOnly);
+ drawParam);
if (drawn)
result = fromFbsBitmap(background, NULL, flags, targetSize);
@@ -1375,7 +1391,7 @@ QPixmap QS60StylePrivate::frame(SkinFrameElements frame, const QSize &size, Skin
return result;
}
-QPixmap QS60StylePrivate::backgroundTexture()
+QPixmap QS60StylePrivate::backgroundTexture(bool skipCreation)
{
bool createNewBackground = false;
TRect applicationRect = (static_cast<CEikAppUi*>(S60->appUi())->ApplicationRect());
@@ -1390,14 +1406,40 @@ QPixmap QS60StylePrivate::backgroundTexture()
}
}
- if (createNewBackground) {
+ if (createNewBackground && !skipCreation) {
QPixmap background = part(QS60StyleEnums::SP_QsnBgScreen,
- QSize(applicationRect.Width(), applicationRect.Height()), 0, SkinElementFlags());
+ QSize(applicationRect.Width(), applicationRect.Height()), 0, SkinElementFlags());
m_background = new QPixmap(background);
+
+ // Notify all widgets that palette is updated with the actual background texture.
+ QPalette pal = QApplication::palette();
+ pal.setBrush(QPalette::Window, *m_background);
+ QApplication::setPalette(pal);
+ setThemePaletteHash(&pal);
+ storeThemePalette(&pal);
+ foreach (QWidget *widget, QApplication::allWidgets()){
+ QEvent e(QEvent::PaletteChange);
+ QApplication::sendEvent(widget, &e);
+ setThemePalette(widget);
+ widget->ensurePolished();
+ }
}
+ if (!m_background)
+ return QPixmap();
return *m_background;
}
+// Generates 1*1 white pixmap as a placeholder for real texture.
+// The actual theme texture is drawn in qt_s60_fill_background().
+QPixmap QS60StylePrivate::placeHolderTexture()
+{
+ if (!m_placeHolderTexture) {
+ m_placeHolderTexture = new QPixmap(1,1);
+ m_placeHolderTexture->fill(Qt::white);
+ }
+ return *m_placeHolderTexture;
+}
+
QSize QS60StylePrivate::screenSize()
{
return QSize(S60->screenWidthInPixels, S60->screenHeightInPixels);
@@ -1412,8 +1454,8 @@ QS60Style::QS60Style()
void QS60StylePrivate::handleDynamicLayoutVariantSwitch()
{
clearCaches(QS60StylePrivate::CC_LayoutChange);
+ setBackgroundTexture(qApp);
setActiveLayout();
- refreshUI();
foreach (QWidget *widget, QApplication::allWidgets())
widget->ensurePolished();
}
diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp
index 77e0d0e..7223c6b 100644
--- a/src/gui/styles/qs60style_simulated.cpp
+++ b/src/gui/styles/qs60style_simulated.cpp
@@ -308,7 +308,7 @@ QPixmap QS60StylePrivate::frame(SkinFrameElements frame, const QSize &size,
return result;
}
-QPixmap QS60StylePrivate::backgroundTexture()
+QPixmap QS60StylePrivate::backgroundTexture(bool /*skipCreation*/)
{
if (!m_background) {
const QSize size = QApplication::desktop()->screen()->size();
diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm
index 1c21f91..42b9402 100644
--- a/src/gui/text/qfontengine_mac.mm
+++ b/src/gui/text/qfontengine_mac.mm
@@ -59,6 +59,8 @@
QT_BEGIN_NAMESPACE
+static float SYNTHETIC_ITALIC_SKEW = tanf(14 * acosf(0) / 90);
+
/*****************************************************************************
QFontEngine debug facilities
*****************************************************************************/
@@ -467,6 +469,9 @@ glyph_metrics_t QCoreTextFontEngine::boundingBox(glyph_t glyph)
glyph_metrics_t ret;
CGGlyph g = glyph;
CGRect rect = CTFontGetBoundingRectsForGlyphs(ctfont, kCTFontHorizontalOrientation, &g, 0, 1);
+ if (synthesisFlags & QFontEngine::SynthesizedItalic) {
+ rect.size.width += rect.size.height * SYNTHETIC_ITALIC_SKEW;
+ }
ret.width = QFixed::fromReal(rect.size.width);
ret.height = QFixed::fromReal(rect.size.height);
ret.x = QFixed::fromReal(rect.origin.x);
@@ -558,7 +563,7 @@ void QCoreTextFontEngine::draw(CGContextRef ctx, qreal x, qreal y, const QTextIt
CGAffineTransformConcat(cgMatrix, oldTextMatrix);
if (synthesisFlags & QFontEngine::SynthesizedItalic)
- cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, -tanf(14 * acosf(0) / 90), 1, 0, 0));
+ cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, -SYNTHETIC_ITALIC_SKEW, 1, 0, 0));
cgMatrix = CGAffineTransformConcat(cgMatrix, transform);
@@ -646,7 +651,7 @@ void QCoreTextFontEngine::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *position
cgMatrix = CGAffineTransformScale(cgMatrix, 1, -1);
if (synthesisFlags & QFontEngine::SynthesizedItalic)
- cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, -tanf(14 * acosf(0) / 90), 1, 0, 0));
+ cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, -SYNTHETIC_ITALIC_SKEW, 1, 0, 0));
for (int i = 0; i < nGlyphs; ++i) {
@@ -681,7 +686,7 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, int margin, bool aa)
CGAffineTransformConcat(cgMatrix, oldTextMatrix);
if (synthesisFlags & QFontEngine::SynthesizedItalic)
- cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, tanf(14 * acosf(0) / 90), 1, 0, 0));
+ cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, SYNTHETIC_ITALIC_SKEW, 1, 0, 0));
cgMatrix = CGAffineTransformConcat(cgMatrix, transform);
@@ -1625,7 +1630,7 @@ QImage QFontEngineMac::imageForGlyph(glyph_t glyph, int margin, bool colorful)
CGAffineTransformConcat(cgMatrix, oldTextMatrix);
if (synthesisFlags & QFontEngine::SynthesizedItalic)
- cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, tanf(14 * acosf(0) / 90), 1, 0, 0));
+ cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, SYNTHETIC_ITALIC_SKEW, 1, 0, 0));
cgMatrix = CGAffineTransformConcat(cgMatrix, transform);
@@ -1718,7 +1723,7 @@ void QFontEngineMac::draw(CGContextRef ctx, qreal x, qreal y, const QTextItemInt
CGAffineTransformConcat(cgMatrix, oldTextMatrix);
if (synthesisFlags & QFontEngine::SynthesizedItalic)
- cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, -tanf(14 * acosf(0) / 90), 1, 0, 0));
+ cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, -SYNTHETIC_ITALIC_SKEW, 1, 0, 0));
cgMatrix = CGAffineTransformConcat(cgMatrix, transform);
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index b25588d..6babca1 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -284,7 +284,7 @@ bool QTextControlPrivate::cursorMoveKeyEvent(QKeyEvent *e)
if (cursor.position() != oldCursorPos)
emit q->cursorPositionChanged();
emit q->microFocusChanged();
- } else if (ignoreNavigationEvents && isNavigationEvent) {
+ } else if (ignoreNavigationEvents && isNavigationEvent && oldSelection.anchor() == cursor.anchor()) {
return false;
}
@@ -1607,7 +1607,10 @@ void QTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button, cons
if (!(buttons & Qt::LeftButton))
return;
- if (!((interactionFlags & Qt::TextSelectableByMouse) || (interactionFlags & Qt::TextEditable)))
+ const bool selectable = interactionFlags & Qt::TextSelectableByMouse;
+ const bool editable = interactionFlags & Qt::TextEditable;
+
+ if (!selectable && !editable)
return;
if (!(mousePressed
@@ -1623,6 +1626,10 @@ void QTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button, cons
startDrag();
return;
}
+
+ if (!selectable)
+ return;
+
const qreal mouseX = qreal(mousePos.x());
int newCursorPos = q->hitTest(mousePos, Qt::FuzzyHit);
@@ -1638,7 +1645,7 @@ void QTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button, cons
extendBlockwiseSelection(newCursorPos);
else if (selectedWordOnDoubleClick.hasSelection())
extendWordwiseSelection(newCursorPos, mouseX);
- else if (interactionFlags & Qt::TextSelectableByMouse)
+ else
setCursorPosition(newCursorPos, QTextCursor::KeepAnchor);
if (interactionFlags & Qt::TextEditable) {
@@ -1649,8 +1656,10 @@ void QTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button, cons
emit q->cursorPositionChanged();
_q_updateCurrentCharFormatAndSelection();
#ifndef QT_NO_IM
- if (QInputContext *ic = inputContext()) {
- ic->update();
+ if (contextWidget) {
+ if (QInputContext *ic = inputContext()) {
+ ic->update();
+ }
}
#endif //QT_NO_IM
} else {
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp
index a1dcb63..5e59341 100644
--- a/src/gui/text/qtextdocumentlayout.cpp
+++ b/src/gui/text/qtextdocumentlayout.cpp
@@ -3148,7 +3148,7 @@ QRectF QTextDocumentLayoutPrivate::frameBoundingRectInternal(QTextFrame *frame)
QRectF QTextDocumentLayout::blockBoundingRect(const QTextBlock &block) const
{
Q_D(const QTextDocumentLayout);
- if (d->docPrivate->pageSize.isNull())
+ if (d->docPrivate->pageSize.isNull() || !block.isValid())
return QRectF();
d->ensureLayoutedByPosition(block.position() + block.length());
QTextFrame *frame = d->document->frameAt(block.position());
diff --git a/src/gui/text/qtextengine_mac.cpp b/src/gui/text/qtextengine_mac.cpp
index ce42241..c34bdb3 100644
--- a/src/gui/text/qtextengine_mac.cpp
+++ b/src/gui/text/qtextengine_mac.cpp
@@ -604,8 +604,9 @@ void QTextEngine::shapeTextMac(int item) const
bool stringToCMapFailed = false;
if (!fe->stringToCMap(str, len, &g, &num_glyphs, flags, log_clusters, attributes())) {
ensureSpace(num_glyphs);
- stringToCMapFailed = fe->stringToCMap(str, len, &g, &num_glyphs, flags, log_clusters,
- attributes());
+ g = availableGlyphs(&si);
+ stringToCMapFailed = !fe->stringToCMap(str, len, &g, &num_glyphs, flags, log_clusters,
+ attributes());
}
if (!stringToCMapFailed) {
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index a996f59..905f81b 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -1682,6 +1682,7 @@ namespace {
int glyphCount;
int maxGlyphs;
int currentPosition;
+ glyph_t previousGlyph;
QFixed minw;
QFixed softHyphenWidth;
@@ -1709,6 +1710,15 @@ namespace {
return glyphs.glyphs[logClusters[currentPosition - 1]];
}
+ inline void saveCurrentGlyph()
+ {
+ previousGlyph = 0;
+ if (currentPosition > 0 &&
+ logClusters[currentPosition - 1] < glyphs.numGlyphs) {
+ previousGlyph = currentGlyph(); // needed to calculate right bearing later
+ }
+ }
+
inline void adjustRightBearing(glyph_t glyph)
{
qreal rb;
@@ -1723,6 +1733,12 @@ namespace {
adjustRightBearing(currentGlyph());
}
+ inline void adjustPreviousRightBearing()
+ {
+ if (previousGlyph > 0)
+ adjustRightBearing(previousGlyph);
+ }
+
inline void resetRightBearing()
{
rightBearing = QFixed(1); // Any positive number is defined as invalid since only
@@ -1798,22 +1814,7 @@ void QTextLine::layout_helper(int maxGlyphs)
lbh.manualWrap = (wrapMode == QTextOption::ManualWrap || wrapMode == QTextOption::NoWrap);
int item = -1;
- int newItem = -1;
- int left = 0;
- int right = eng->layoutData->items.size()-1;
- while(left <= right) {
- int middle = ((right-left)/2)+left;
- if (line.from > eng->layoutData->items[middle].position)
- left = middle+1;
- else if(line.from < eng->layoutData->items[middle].position)
- right = middle-1;
- else {
- newItem = middle;
- break;
- }
- }
- if (newItem == -1)
- newItem = right;
+ int newItem = eng->findItem(line.from);
LB_DEBUG("from: %d: item=%d, total %d, width available %f", line.from, newItem, eng->layoutData->items.size(), line.width.toReal());
@@ -1825,6 +1826,7 @@ void QTextLine::layout_helper(int maxGlyphs)
lbh.currentPosition = line.from;
int end = 0;
lbh.logClusters = eng->layoutData->logClustersPtr;
+ lbh.previousGlyph = 0;
while (newItem < eng->layoutData->items.size()) {
lbh.resetRightBearing();
@@ -1885,6 +1887,7 @@ void QTextLine::layout_helper(int maxGlyphs)
current, lbh.logClusters, lbh.glyphs);
} else {
lbh.tmpData.length++;
+ lbh.adjustPreviousRightBearing();
}
line += lbh.tmpData;
goto found;
@@ -1915,9 +1918,7 @@ void QTextLine::layout_helper(int maxGlyphs)
} else {
lbh.whiteSpaceOrObject = false;
bool sb_or_ws = false;
- glyph_t previousGlyph = 0;
- if (lbh.currentPosition > 0 && lbh.logClusters[lbh.currentPosition - 1] <lbh.glyphs.numGlyphs)
- previousGlyph = lbh.currentGlyph(); // needed to calculate right bearing later
+ lbh.saveCurrentGlyph();
do {
addNextCluster(lbh.currentPosition, end, lbh.tmpData, lbh.glyphCount,
current, lbh.logClusters, lbh.glyphs);
@@ -1942,7 +1943,7 @@ void QTextLine::layout_helper(int maxGlyphs)
// b) if we are so short of available width that the
// soft hyphen is the first breakable position, then
// we don't want to show it. However we initially
- // have to take the width for it into accoun so that
+ // have to take the width for it into account so that
// the text document layout sees the overflow and
// switch to break-anywhere mode, in which we
// want the soft-hyphen to slip into the next line
@@ -1970,8 +1971,9 @@ void QTextLine::layout_helper(int maxGlyphs)
// we are too wide, fix right bearing
if (rightBearing <= 0)
lbh.rightBearing = rightBearing; // take from cache
- else if (previousGlyph > 0)
- lbh.adjustRightBearing(previousGlyph);
+ else
+ lbh.adjustPreviousRightBearing();
+
if (!breakany) {
line.textWidth += lbh.softHyphenWidth;
}
@@ -1979,6 +1981,7 @@ void QTextLine::layout_helper(int maxGlyphs)
goto found;
}
}
+ lbh.saveCurrentGlyph();
}
if (lbh.currentPosition == end)
newItem = item + 1;
diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp
index e323fd0..94f2fc7 100644
--- a/src/gui/text/qtextobject.cpp
+++ b/src/gui/text/qtextobject.cpp
@@ -1504,7 +1504,7 @@ QTextBlock QTextBlock::next() const
*/
QTextBlock QTextBlock::previous() const
{
- if (!isValid())
+ if (!p)
return QTextBlock();
return QTextBlock(p, p->blockMap().previous(n));
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index d108ad9..5a281ad 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -414,13 +414,17 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event)
if (isGettingInput) {
// If any text is being input, remove selected text.
priorState = m_undoState;
+ if (echoMode() == QLineEdit::PasswordEchoOnEdit && !passwordEchoEditing()) {
+ updatePasswordEchoEditing(true);
+ m_selstart = 0;
+ m_selend = m_text.length();
+ }
removeSelectedText();
}
-
int c = m_cursor; // cursor position after insertion of commit string
if (event->replacementStart() <= 0)
- c += event->commitString().length() + qMin(-event->replacementStart(), event->replacementLength());
+ c += event->commitString().length() - qMin(-event->replacementStart(), event->replacementLength());
m_cursor += event->replacementStart();
diff --git a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp b/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp
index d5726c1..9fe01bf 100644
--- a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp
+++ b/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp
@@ -365,7 +365,7 @@ void QDeclarativeFolderListModel::refresh()
{
d->folderIndex = QModelIndex();
if (d->count) {
- emit beginRemoveRows(QModelIndex(), 0, d->count);
+ emit beginRemoveRows(QModelIndex(), 0, d->count-1);
d->count = 0;
emit endRemoveRows();
}
diff --git a/src/imports/gestures/qdeclarativegesturearea.cpp b/src/imports/gestures/qdeclarativegesturearea.cpp
index ad44905..aae6a01 100644
--- a/src/imports/gestures/qdeclarativegesturearea.cpp
+++ b/src/imports/gestures/qdeclarativegesturearea.cpp
@@ -89,6 +89,10 @@ public:
\warning Elements in the Qt.labs module are not guaranteed to remain compatible
in future versions.
+ \warning GestureArea is an experimental element whose development has
+ been discontinued. PinchArea is available in QtQuick 1.1 and handles
+ two finger gesture input.
+
\note This element is only functional on devices with touch input.
\qml
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 82b5ce3..700b455 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -963,8 +963,20 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket
} else {
errorCode = QNetworkReply::RemoteHostClosedError;
}
+ } else if (state == QHttpNetworkConnectionChannel::ReadingState) {
+ if (!reply->d_func()->expectContent()) {
+ // No content expected, this is a valid way to have the connection closed by the server
+ return;
+ }
+ if (reply->contentLength() == -1 && !reply->d_func()->isChunked()) {
+ // There was no content-length header and it's not chunked encoding,
+ // so this is a valid way to have the connection closed by the server
+ return;
+ }
+ // ok, we got a disconnect even though we did not expect it
+ errorCode = QNetworkReply::RemoteHostClosedError;
} else {
- return;
+ errorCode = QNetworkReply::RemoteHostClosedError;
}
break;
case QAbstractSocket::SocketTimeoutError:
@@ -992,6 +1004,7 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket
if (reply) {
reply->d_func()->errorString = errorString;
emit reply->finishedWithError(errorCode, errorString);
+ reply = 0;
}
// send the next request
QMetaObject::invokeMethod(that, "_q_startNextRequest", Qt::QueuedConnection);
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp
index 4189743..108ac68 100644
--- a/src/network/access/qnetworkaccesshttpbackend.cpp
+++ b/src/network/access/qnetworkaccesshttpbackend.cpp
@@ -360,6 +360,11 @@ void QNetworkAccessHttpBackend::validateCache(QHttpNetworkRequest &httpRequest,
return;
}
+ // The disk cache API does not currently support partial content retrieval.
+ // That is why we don't use the disk cache for any such requests.
+ if (request().hasRawHeader("Range"))
+ return;
+
QAbstractNetworkCache *nc = networkCache();
if (!nc)
return; // no local cache
diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp
index 70ea5c2..c2a6925 100644
--- a/src/network/access/qnetworkcookie.cpp
+++ b/src/network/access/qnetworkcookie.cpp
@@ -359,7 +359,7 @@ void QNetworkCookie::setValue(const QByteArray &value)
}
// ### move this to qnetworkcookie_p.h and share with qnetworkaccesshttpbackend
-static QPair<QByteArray, QByteArray> nextField(const QByteArray &text, int &position)
+static QPair<QByteArray, QByteArray> nextField(const QByteArray &text, int &position, bool isNameValue)
{
// format is one of:
// (1) token
@@ -394,13 +394,22 @@ static QPair<QByteArray, QByteArray> nextField(const QByteArray &text, int &posi
// quoted-string = ( <"> *(qdtext | quoted-pair ) <"> )
// qdtext = <any TEXT except <">>
// quoted-pair = "\" CHAR
+
+ // If its NAME=VALUE, retain the value as is
+ // refer to ttp://bugreports.qt.nokia.com/browse/QTBUG-17746
+ if (isNameValue)
+ second += '"';
++i;
while (i < length) {
register char c = text.at(i);
if (c == '"') {
// end of quoted text
+ if (isNameValue)
+ second += '"';
break;
} else if (c == '\\') {
+ if (isNameValue)
+ second += '\\';
++i;
if (i >= length)
// broken line
@@ -476,10 +485,12 @@ QByteArray QNetworkCookie::toRawForm(RawForm form) const
result = d->name;
result += '=';
- if (d->value.contains(';') ||
+ if ((d->value.contains(';') ||
d->value.contains(',') ||
d->value.contains(' ') ||
- d->value.contains('"')) {
+ d->value.contains('"')) &&
+ (!d->value.startsWith('"') &&
+ !d->value.endsWith('"'))) {
result += '"';
QByteArray value = d->value;
@@ -947,7 +958,7 @@ QList<QNetworkCookie> QNetworkCookiePrivate::parseSetCookieHeaderLine(const QByt
QNetworkCookie cookie;
// The first part is always the "NAME=VALUE" part
- QPair<QByteArray,QByteArray> field = nextField(cookieString, position);
+ QPair<QByteArray,QByteArray> field = nextField(cookieString, position, true);
if (field.first.isEmpty() || field.second.isNull())
// parsing error
break;
@@ -965,7 +976,7 @@ QList<QNetworkCookie> QNetworkCookiePrivate::parseSetCookieHeaderLine(const QByt
case ';':
// new field in the cookie
- field = nextField(cookieString, position);
+ field = nextField(cookieString, position, false);
field.first = field.first.toLower(); // everything but the NAME=VALUE is case-insensitive
if (field.first == "expires") {
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp
index 343f344..894df79 100644
--- a/src/network/access/qnetworkreplyimpl.cpp
+++ b/src/network/access/qnetworkreplyimpl.cpp
@@ -505,6 +505,13 @@ void QNetworkReplyImplPrivate::initCacheSaveDevice()
{
Q_Q(QNetworkReplyImpl);
+ // The disk cache does not support partial content, so don't even try to
+ // save any such content into the cache.
+ if (q->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() == 206) {
+ cacheEnabled = false;
+ return;
+ }
+
// save the meta data
QNetworkCacheMetaData metaData;
metaData.setUrl(url);
diff --git a/src/network/bearer/qsharednetworksession.cpp b/src/network/bearer/qsharednetworksession.cpp
index 51b3a32..28ca173 100644
--- a/src/network/bearer/qsharednetworksession.cpp
+++ b/src/network/bearer/qsharednetworksession.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/network/kernel/qnetworkinterface_symbian.cpp b/src/network/kernel/qnetworkinterface_symbian.cpp
index 03133d0..8e5db3c 100644
--- a/src/network/kernel/qnetworkinterface_symbian.cpp
+++ b/src/network/kernel/qnetworkinterface_symbian.cpp
@@ -43,7 +43,7 @@
#include "qnetworkinterface.h"
#include "qnetworkinterface_p.h"
-#include "../corelib/kernel/qcore_symbian_p.h"
+#include <private/qcore_symbian_p.h>
#ifndef QT_NO_NETWORKINTERFACE
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 84e14ff..0866534 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -312,9 +312,18 @@ init_context:
q_X509_STORE_add_cert(ctx->cert_store, (X509 *)caCertificate.handle());
}
}
+
+ bool addExpiredCerts = true;
+#if defined(Q_OS_MAC) && (MAC_OS_X_VERSION_MAX_ALLOWED == MAC_OS_X_VERSION_10_5)
+ //On Leopard SSL does not work if we add the expired certificates.
+ if (QSysInfo::MacintoshVersion == QSysInfo::MV_10_5)
+ addExpiredCerts = false;
+#endif
// now add the expired certs
- foreach (const QSslCertificate &caCertificate, expiredCerts) {
- q_X509_STORE_add_cert(ctx->cert_store, (X509 *)caCertificate.handle());
+ if (addExpiredCerts) {
+ foreach (const QSslCertificate &caCertificate, expiredCerts) {
+ q_X509_STORE_add_cert(ctx->cert_store, (X509 *)caCertificate.handle());
+ }
}
// Register a custom callback to get all verification errors.
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index cda31e5..c8786fb 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1335,11 +1335,14 @@ void QGL2PaintEngineEx::drawPixmap(const QRectF& dest, const QPixmap & pixmap, c
ensureActive();
d->transferMode(ImageDrawingMode);
+ QGLContext::BindOptions bindOptions = QGLContext::InternalBindOption|QGLContext::CanFlipNativePixmapBindOption;
+#ifdef QGL_USE_TEXTURE_POOL
+ bindOptions |= QGLContext::TemporarilyCachedBindOption;
+#endif
+
glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT);
QGLTexture *texture =
- ctx->d_func()->bindTexture(pixmap, GL_TEXTURE_2D, GL_RGBA,
- QGLContext::InternalBindOption
- | QGLContext::CanFlipNativePixmapBindOption);
+ ctx->d_func()->bindTexture(pixmap, GL_TEXTURE_2D, GL_RGBA, bindOptions);
GLfloat top = texture->options & QGLContext::InvertedYBindOption ? (pixmap.height() - src.top()) : src.top();
GLfloat bottom = texture->options & QGLContext::InvertedYBindOption ? (pixmap.height() - src.bottom()) : src.bottom();
@@ -1351,6 +1354,12 @@ void QGL2PaintEngineEx::drawPixmap(const QRectF& dest, const QPixmap & pixmap, c
d->updateTextureFilter(GL_TEXTURE_2D, GL_CLAMP_TO_EDGE,
state()->renderHints & QPainter::SmoothPixmapTransform, texture->id);
d->drawTexture(dest, srcRect, pixmap.size(), isOpaque, isBitmap);
+
+ if (texture->options&QGLContext::TemporarilyCachedBindOption) {
+ // pixmap was temporarily cached as a QImage texture by pooling system
+ // and should be destroyed immediately
+ QGLTextureCache::instance()->remove(ctx, texture->id);
+ }
}
void QGL2PaintEngineEx::drawImage(const QRectF& dest, const QImage& image, const QRectF& src,
@@ -1375,12 +1384,23 @@ void QGL2PaintEngineEx::drawImage(const QRectF& dest, const QImage& image, const
glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT);
- QGLTexture *texture = ctx->d_func()->bindTexture(image, GL_TEXTURE_2D, GL_RGBA, QGLContext::InternalBindOption);
+ QGLContext::BindOptions bindOptions = QGLContext::InternalBindOption;
+#ifdef QGL_USE_TEXTURE_POOL
+ bindOptions |= QGLContext::TemporarilyCachedBindOption;
+#endif
+
+ QGLTexture *texture = ctx->d_func()->bindTexture(image, GL_TEXTURE_2D, GL_RGBA, bindOptions);
GLuint id = texture->id;
d->updateTextureFilter(GL_TEXTURE_2D, GL_CLAMP_TO_EDGE,
state()->renderHints & QPainter::SmoothPixmapTransform, id);
d->drawTexture(dest, src, image.size(), !image.hasAlphaChannel());
+
+ if (texture->options&QGLContext::TemporarilyCachedBindOption) {
+ // image was temporarily cached by texture pooling system
+ // and should be destroyed immediately
+ QGLTextureCache::instance()->remove(ctx, texture->id);
+ }
}
void QGL2PaintEngineEx::drawStaticTextItem(QStaticTextItem *textItem)
diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro
index 0e82467..6bbf99b 100644
--- a/src/opengl/opengl.pro
+++ b/src/opengl/opengl.pro
@@ -148,11 +148,16 @@ embedded {
}
symbian {
+ DEFINES += QGL_USE_TEXTURE_POOL
+ SOURCES -= qpixmapdata_gl.cpp
SOURCES += qgl_symbian.cpp \
+ qpixmapdata_poolgl.cpp \
qglpixelbuffer_egl.cpp \
- qgl_egl.cpp
+ qgl_egl.cpp \
+ qgltexturepool.cpp
- HEADERS += qgl_egl_p.h
+ HEADERS += qgl_egl_p.h \
+ qgltexturepool_p.h
symbian:TARGET.UID3 = 0x2002131A
}
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 062218c..ded7aa8 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -93,6 +93,10 @@
#include "qlibrary.h"
#include <qmutex.h>
+#ifdef QGL_USE_TEXTURE_POOL
+#include <private/qgltexturepool_p.h>
+#endif
+
QT_BEGIN_NAMESPACE
@@ -2022,6 +2026,10 @@ struct DDSFormat {
the pixmap/image that it stems from, e.g. installing destruction
hooks in them.
+ \omitvalue TemporarilyCachedBindOption Used by paint engines on some
+ platforms to indicate that the pixmap or image texture is possibly
+ cached only temporarily and must be destroyed immediately after the use.
+
\omitvalue InternalBindOption
*/
@@ -2529,8 +2537,18 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
#endif
const QImage &constRef = img; // to avoid detach in bits()...
+#ifdef QGL_USE_TEXTURE_POOL
+ QGLTexturePool::instance()->createPermanentTexture(tx_id,
+ target,
+ 0, internalFormat,
+ img.width(), img.height(),
+ externalFormat,
+ pixel_type,
+ constRef.bits());
+#else
glTexImage2D(target, 0, internalFormat, img.width(), img.height(), 0, externalFormat,
pixel_type, constRef.bits());
+#endif
#if defined(QT_OPENGL_ES_2)
if (genMipmap)
glGenerateMipmap(target);
@@ -2569,7 +2587,6 @@ QGLTexture *QGLContextPrivate::textureCacheLookup(const qint64 key, GLenum targe
return 0;
}
-
/*! \internal */
QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target, GLint format, QGLContext::BindOptions options)
{
diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h
index 9443c74..7d72c8a 100644
--- a/src/opengl/qgl.h
+++ b/src/opengl/qgl.h
@@ -329,6 +329,7 @@ public:
MemoryManagedBindOption = 0x0010, // internal flag
CanFlipNativePixmapBindOption = 0x0020, // internal flag
+ TemporarilyCachedBindOption = 0x0040, // internal flag
DefaultBindOption = LinearFilteringBindOption
| InvertedYBindOption
diff --git a/src/opengl/qgl_egl.cpp b/src/opengl/qgl_egl.cpp
index 674d80d..d6b2d3b 100644
--- a/src/opengl/qgl_egl.cpp
+++ b/src/opengl/qgl_egl.cpp
@@ -39,6 +39,7 @@
**
****************************************************************************/
+#include <QtCore/qdebug.h>
#include <QtOpenGL/qgl.h>
#include <QtOpenGL/qglpixelbuffer.h>
#include "qgl_p.h"
@@ -195,6 +196,7 @@ void QGLContext::makeCurrent()
// PowerVR MBX/SGX chips needs to clear all buffers when starting to render
// a new frame, otherwise there will be a performance penalty to pay for
// each frame.
+ qDebug() << "Found SGX/MBX driver, enabling FullClearOnEveryFrame";
d->workaround_needsFullClearOnEveryFrame = true;
// Older PowerVR SGX drivers (like the one in the N900) have a
@@ -202,10 +204,31 @@ void QGLContext::makeCurrent()
// or GL_ALPHA texture bound to an FBO. The only way to
// identify that driver is to check the EGL version number for it.
const char *egl_version = eglQueryString(d->eglContext->display(), EGL_VERSION);
- if (egl_version && strstr(egl_version, "1.3"))
+
+ if (egl_version && strstr(egl_version, "1.3")) {
+ qDebug() << "Found v1.3 driver, enabling brokenFBOReadBack";
d->workaround_brokenFBOReadBack = true;
- else if (egl_version && strstr(egl_version, "1.4"))
+ } else if (egl_version && strstr(egl_version, "1.4")) {
+ qDebug() << "Found v1.4 driver, enabling brokenTexSubImage";
d->workaround_brokenTexSubImage = true;
+
+ // this is a bit complicated; 1.4 version SGX drivers from
+ // Nokia have fixed the brokenFBOReadBack problem, but
+ // official drivers from TI haven't, meaning that things
+ // like the beagleboard are broken unless we hack around it
+ // - but at the same time, we want to not reduce performance
+ // by not enabling this elsewhere.
+ //
+ // so, let's check for a Nokia-specific addon, and only
+ // enable if it isn't present.
+ // (see MeeGo bug #5616)
+ if (!QEgl::hasExtension("EGL_NOK_image_shared")) {
+ // no Nokia extension, this is probably a standard SGX
+ // driver, so enable the workaround
+ qDebug() << "Found non-Nokia v1.4 driver, enabling brokenFBOReadBack";
+ d->workaround_brokenFBOReadBack = true;
+ }
+ }
}
}
}
diff --git a/src/opengl/qgl_symbian.cpp b/src/opengl/qgl_symbian.cpp
index a9e2248..78624a2 100644
--- a/src/opengl/qgl_symbian.cpp
+++ b/src/opengl/qgl_symbian.cpp
@@ -41,9 +41,7 @@
#include "qgl.h"
-#include <coemain.h>
-#include <coecntrl.h>
-#include <w32std.h>
+#include <fbs.h>
#include <private/qt_s60_p.h>
#include <private/qpixmap_s60_p.h>
#include <private/qimagepixmapcleanuphooks_p.h>
@@ -52,6 +50,7 @@
#include <private/qwidget_p.h> // to access QWExtra
#include "qgl_egl_p.h"
#include "qpixmapdata_gl_p.h"
+#include "qgltexturepool_p.h"
#include "qcolormap.h"
#include <QDebug>
@@ -71,6 +70,8 @@ QT_BEGIN_NAMESPACE
#endif
#endif
+extern int qt_gl_pixmap_serial;
+
/*
QGLTemporaryContext implementation
*/
@@ -360,117 +361,61 @@ void QGLWidgetPrivate::recreateEglSurface()
eglSurfaceWindowId = currentId;
}
-/*
- * Symbian specific QGLPixmapData functions
- */
-
-static CFbsBitmap* createBlitCopy(CFbsBitmap* bitmap)
+static inline bool knownGoodFormat(QImage::Format format)
{
- CFbsBitmap *copy = q_check_ptr(new CFbsBitmap);
- if (!copy)
- return 0;
-
- if (copy->Create(bitmap->SizeInPixels(), bitmap->DisplayMode()) != KErrNone) {
- delete copy;
- copy = 0;
-
- return 0;
+ switch (format) {
+ case QImage::Format_RGB16: // EColor64K
+ case QImage::Format_RGB32: // EColor16MU
+ case QImage::Format_ARGB32_Premultiplied: // EColor16MAP
+ return true;
+ default:
+ return false;
}
-
- CFbsBitmapDevice* bitmapDevice = 0;
- CFbsBitGc *bitmapGc = 0;
- QT_TRAP_THROWING(bitmapDevice = CFbsBitmapDevice::NewL(copy));
- QT_TRAP_THROWING(bitmapGc = CFbsBitGc::NewL());
- bitmapGc->Activate(bitmapDevice);
-
- bitmapGc->BitBlt(TPoint(), bitmap);
-
- delete bitmapGc;
- delete bitmapDevice;
-
- return copy;
}
void QGLPixmapData::fromNativeType(void* pixmap, NativeType type)
{
if (type == QPixmapData::FbsBitmap) {
- CFbsBitmap *bitmap = reinterpret_cast<CFbsBitmap*>(pixmap);
-
- bool deleteSourceBitmap = false;
-#ifdef Q_SYMBIAN_HAS_EXTENDED_BITMAP_TYPE
-
- // Rasterize extended bitmaps
-
- TUid extendedBitmapType = bitmap->ExtendedBitmapType();
- if (extendedBitmapType != KNullUid) {
- bitmap = createBlitCopy(bitmap);
- deleteSourceBitmap = true;
- }
-#endif
-
- if (bitmap->IsCompressedInRAM()) {
- bitmap = createBlitCopy(bitmap);
- deleteSourceBitmap = true;
+ CFbsBitmap *bitmap = reinterpret_cast<CFbsBitmap *>(pixmap);
+ QSize size(bitmap->SizeInPixels().iWidth, bitmap->SizeInPixels().iHeight);
+ if (size.width() == w && size.height() == h)
+ setSerialNumber(++qt_gl_pixmap_serial);
+ resize(size.width(), size.height());
+ m_source = QVolatileImage(bitmap);
+ if (pixelType() == BitmapType) {
+ m_source.ensureFormat(QImage::Format_MonoLSB);
+ } else if (!knownGoodFormat(m_source.format())) {
+ m_source.beginDataAccess();
+ QImage::Format format = idealFormat(m_source.imageRef(), Qt::AutoColor);
+ m_source.endDataAccess(true);
+ m_source.ensureFormat(format);
}
-
- TDisplayMode displayMode = bitmap->DisplayMode();
- QImage::Format format = qt_TDisplayMode2Format(displayMode);
-
- TSize size = bitmap->SizeInPixels();
- int bytesPerLine = bitmap->ScanLineLength(size.iWidth, displayMode);
-
- bitmap->BeginDataAccess();
- uchar *bytes = (uchar*)bitmap->DataAddress();
- QImage img = QImage(bytes, size.iWidth, size.iHeight, bytesPerLine, format);
- img = img.copy();
- bitmap->EndDataAccess();
-
- if (displayMode == EGray2) {
- //Symbian thinks set pixels are white/transparent, Qt thinks they are foreground/solid
- //So invert mono bitmaps so that masks work correctly.
- img.invertPixels();
- } else if (displayMode == EColor16M) {
- img = img.rgbSwapped(); // EColor16M is BGR
- }
-
- fromImage(img, Qt::AutoColor);
-
- if (deleteSourceBitmap)
- delete bitmap;
+ m_hasAlpha = m_source.hasAlphaChannel();
+ m_hasFillColor = false;
+ m_dirty = true;
+
+ } else if (type == QPixmapData::VolatileImage && pixmap) {
+ // Support QS60Style in more efficient skin graphics retrieval.
+ QVolatileImage *img = static_cast<QVolatileImage *>(pixmap);
+ if (img->width() == w && img->height() == h)
+ setSerialNumber(++qt_gl_pixmap_serial);
+ resize(img->width(), img->height());
+ m_source = *img;
+ m_hasAlpha = m_source.hasAlphaChannel();
+ m_hasFillColor = false;
+ m_dirty = true;
}
}
void* QGLPixmapData::toNativeType(NativeType type)
{
if (type == QPixmapData::FbsBitmap) {
- CFbsBitmap *bitmap = q_check_ptr(new CFbsBitmap);
-
- if (bitmap) {
- QImage image = toImage();
-
- TDisplayMode displayMode(EColor16MU);
- if (image.format()==QImage::Format_ARGB32_Premultiplied)
- displayMode = EColor16MAP;
-
- if (bitmap->Create(TSize(image.width(), image.height()),
- displayMode) == KErrNone) {
- const uchar *sptr = const_cast<const QImage&>(image).bits();
- bitmap->BeginDataAccess();
-
- uchar *dptr = (uchar*)bitmap->DataAddress();
- Mem::Copy(dptr, sptr, image.byteCount());
-
- bitmap->EndDataAccess();
- } else {
- delete bitmap;
- bitmap = 0;
- }
- }
-
- return reinterpret_cast<void*>(bitmap);
+ if (m_source.isNull())
+ m_source = QVolatileImage(w, h, QImage::Format_ARGB32_Premultiplied);
+ return m_source.duplicateNativeImage();
}
+
return 0;
}
QT_END_NAMESPACE
-
diff --git a/src/opengl/qgltexturepool.cpp b/src/opengl/qgltexturepool.cpp
new file mode 100644
index 0000000..61a88c3
--- /dev/null
+++ b/src/opengl/qgltexturepool.cpp
@@ -0,0 +1,241 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtOpenVG 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 "qgltexturepool_p.h"
+#include "qpixmapdata_gl_p.h"
+
+QT_BEGIN_NAMESPACE
+
+Q_OPENGL_EXPORT extern QGLWidget* qt_gl_share_widget();
+
+static QGLTexturePool *qt_gl_texture_pool = 0;
+
+class QGLTexturePoolPrivate
+{
+public:
+ QGLTexturePoolPrivate() : lruFirst(0), lruLast(0) {}
+
+ QGLPixmapData *lruFirst;
+ QGLPixmapData *lruLast;
+};
+
+QGLTexturePool::QGLTexturePool()
+ : d_ptr(new QGLTexturePoolPrivate())
+{
+}
+
+QGLTexturePool::~QGLTexturePool()
+{
+}
+
+QGLTexturePool *QGLTexturePool::instance()
+{
+ if (!qt_gl_texture_pool)
+ qt_gl_texture_pool = new QGLTexturePool();
+ return qt_gl_texture_pool;
+}
+
+GLuint QGLTexturePool::createTextureForPixmap(GLenum target,
+ GLint level,
+ GLint internalformat,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ QGLPixmapData *data)
+{
+ GLuint texture;
+ glGenTextures(1, &texture);
+ glBindTexture(target, texture);
+ do {
+ glTexImage2D(target, level, internalformat, width, height, 0, format, type, 0);
+ GLenum error = glGetError();
+ if (error == GL_NO_ERROR) {
+ if (data)
+ moveToHeadOfLRU(data);
+ return texture;
+ } else if (error != GL_OUT_OF_MEMORY) {
+ qWarning("QGLTexturePool: cannot create temporary texture because of invalid params");
+ return 0;
+ }
+ } while (reclaimSpace(internalformat, width, height, format, type, data));
+ qWarning("QGLTexturePool: cannot reclaim sufficient space for a %dx%d pixmap",
+ width, height);
+ return 0;
+}
+
+bool QGLTexturePool::createPermanentTexture(GLuint texture,
+ GLenum target,
+ GLint level,
+ GLint internalformat,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ const GLvoid *data)
+{
+ glBindTexture(target, texture);
+ do {
+ glTexImage2D(target, level, internalformat, width, height, 0, format, type, data);
+
+ GLenum error = glGetError();
+ if (error == GL_NO_ERROR) {
+ return true;
+ } else if (error != GL_OUT_OF_MEMORY) {
+ qWarning("QGLTexturePool: cannot create permanent texture because of invalid params");
+ return false;
+ }
+ } while (reclaimSpace(internalformat, width, height, format, type, 0));
+ qWarning("QGLTexturePool: cannot reclaim sufficient space for a %dx%d pixmap",
+ width, height);
+ return 0;
+}
+
+void QGLTexturePool::releaseTexture(QGLPixmapData *data, GLuint texture)
+{
+ // Very simple strategy at the moment: just destroy the texture.
+ if (data)
+ removeFromLRU(data);
+
+ QGLShareContextScope ctx(qt_gl_share_widget()->context());
+ glDeleteTextures(1, &texture);
+}
+
+void QGLTexturePool::useTexture(QGLPixmapData *data)
+{
+ moveToHeadOfLRU(data);
+}
+
+void QGLTexturePool::detachTexture(QGLPixmapData *data)
+{
+ removeFromLRU(data);
+}
+
+bool QGLTexturePool::reclaimSpace(GLint internalformat,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ QGLPixmapData *data)
+{
+ Q_UNUSED(internalformat); // For future use in picking the best texture to eject.
+ Q_UNUSED(width);
+ Q_UNUSED(height);
+ Q_UNUSED(format);
+ Q_UNUSED(type);
+
+ bool succeeded = false;
+ bool wasInLRU = false;
+ if (data) {
+ wasInLRU = data->inLRU;
+ moveToHeadOfLRU(data);
+ }
+
+ QGLPixmapData *lrudata = pixmapLRU();
+ if (lrudata && lrudata != data) {
+ lrudata->reclaimTexture();
+ succeeded = true;
+ }
+
+ if (data && !wasInLRU)
+ removeFromLRU(data);
+
+ return succeeded;
+}
+
+void QGLTexturePool::hibernate()
+{
+ Q_D(QGLTexturePool);
+ QGLPixmapData *pd = d->lruLast;
+ while (pd) {
+ QGLPixmapData *prevLRU = pd->prevLRU;
+ pd->inTexturePool = false;
+ pd->inLRU = false;
+ pd->nextLRU = 0;
+ pd->prevLRU = 0;
+ pd->hibernate();
+ pd = prevLRU;
+ }
+ d->lruFirst = 0;
+ d->lruLast = 0;
+}
+
+void QGLTexturePool::moveToHeadOfLRU(QGLPixmapData *data)
+{
+ Q_D(QGLTexturePool);
+ if (data->inLRU) {
+ if (!data->prevLRU)
+ return; // Already at the head of the list.
+ removeFromLRU(data);
+ }
+ data->inLRU = true;
+ data->nextLRU = d->lruFirst;
+ data->prevLRU = 0;
+ if (d->lruFirst)
+ d->lruFirst->prevLRU = data;
+ else
+ d->lruLast = data;
+ d->lruFirst = data;
+}
+
+void QGLTexturePool::removeFromLRU(QGLPixmapData *data)
+{
+ Q_D(QGLTexturePool);
+ if (!data->inLRU)
+ return;
+ if (data->nextLRU)
+ data->nextLRU->prevLRU = data->prevLRU;
+ else
+ d->lruLast = data->prevLRU;
+ if (data->prevLRU)
+ data->prevLRU->nextLRU = data->nextLRU;
+ else
+ d->lruFirst = data->nextLRU;
+ data->inLRU = false;
+}
+
+QGLPixmapData *QGLTexturePool::pixmapLRU()
+{
+ Q_D(QGLTexturePool);
+ return d->lruLast;
+}
+
+QT_END_NAMESPACE
diff --git a/src/opengl/qgltexturepool_p.h b/src/opengl/qgltexturepool_p.h
new file mode 100644
index 0000000..8b6f726
--- /dev/null
+++ b/src/opengl/qgltexturepool_p.h
@@ -0,0 +1,147 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtOpenVG 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 QGLTEXTUREPOOL_P_H
+#define QGLTEXTUREPOOL_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qgl.h"
+#include <QtCore/qscopedpointer.h>
+
+QT_BEGIN_NAMESPACE
+
+class QGLPixmapData;
+class QGLTexturePoolPrivate;
+
+class QGLTexturePool
+{
+public:
+ QGLTexturePool();
+ virtual ~QGLTexturePool();
+
+ static QGLTexturePool *instance();
+
+ // Create a new texture with the specified parameters and associate
+ // it with "data". The QGLPixmapData will be notified when the
+ // texture needs to be reclaimed by the pool.
+ //
+ // This function will call reclaimSpace() when texture creation fails.
+ GLuint createTextureForPixmap(GLenum target,
+ GLint level,
+ GLint internalformat,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ QGLPixmapData *data);
+
+ // Create a permanent texture with the specified parameters.
+ // If there is insufficient space for the texture,
+ // then this function will call reclaimSpace() and try again.
+ //
+ // The caller is responsible for calling glDeleteTextures()
+ // when it no longer needs the texture, as the texture is not
+ // recorded in the texture pool.
+ bool createPermanentTexture(GLuint texture,
+ GLenum target,
+ GLint level,
+ GLint internalformat,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ const GLvoid *data);
+
+ // Release a texture that is no longer required.
+ void releaseTexture(QGLPixmapData *data, GLuint texture);
+
+ // Notify the pool that a QGLPixmapData object is using
+ // an texture again. This allows the pool to move the texture
+ // within a least-recently-used list of QGLPixmapData objects.
+ void useTexture(QGLPixmapData *data);
+
+ // Notify the pool that the texture associated with a
+ // QGLPixmapData is being detached from the pool. The caller
+ // will become responsible for calling glDeleteTextures().
+ void detachTexture(QGLPixmapData *data);
+
+ // Reclaim space for an image allocation with the specified parameters.
+ // Returns true if space was reclaimed, or false if there is no
+ // further space that can be reclaimed. The "data" parameter
+ // indicates the pixmap that is trying to obtain space which should
+ // not itself be reclaimed.
+ bool reclaimSpace(GLint internalformat,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ QGLPixmapData *data);
+
+ // Hibernate the image pool because the context is about to be
+ // destroyed. All textures left in the pool should be released.
+ void hibernate();
+
+protected:
+ // Helper functions for managing the LRU list of QGLPixmapData objects.
+ void moveToHeadOfLRU(QGLPixmapData *data);
+ void removeFromLRU(QGLPixmapData *data);
+ QGLPixmapData *pixmapLRU();
+
+private:
+ QScopedPointer<QGLTexturePoolPrivate> d_ptr;
+
+ Q_DECLARE_PRIVATE(QGLTexturePool)
+ Q_DISABLE_COPY(QGLTexturePool)
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/opengl/qgraphicssystem_gl.cpp b/src/opengl/qgraphicssystem_gl.cpp
index 79911fb..0aa3c2e 100644
--- a/src/opengl/qgraphicssystem_gl.cpp
+++ b/src/opengl/qgraphicssystem_gl.cpp
@@ -53,6 +53,14 @@
#include "private/qwindowsurface_x11gl_p.h"
#endif
+#if defined(Q_OS_SYMBIAN)
+#include <QtGui/private/qapplication_p.h>
+#endif
+
+#ifdef QGL_USE_TEXTURE_POOL
+#include "private/qgltexturepool_p.h"
+#endif
+
QT_BEGIN_NAMESPACE
extern QGLWidget *qt_gl_getShareWidget();
@@ -86,8 +94,21 @@ QWindowSurface *QGLGraphicsSystem::createWindowSurface(QWidget *widget) const
}
#endif
+#if defined(Q_OS_SYMBIAN)
+ if (!QApplicationPrivate::instance()->useTranslucentEGLSurfaces) {
+ QWidgetPrivate *d = qt_widget_private(widget);
+ if (!d->isOpaque && widget->testAttribute(Qt::WA_TranslucentBackground))
+ return d->createDefaultWindowSurface_sys();
+ }
+#endif
+
return new QGLWindowSurface(widget);
}
-
+#ifdef QGL_USE_TEXTURE_POOL
+void QGLGraphicsSystem::releaseCachedResources()
+{
+ QGLTexturePool::instance()->hibernate();
+}
+#endif
QT_END_NAMESPACE
diff --git a/src/opengl/qgraphicssystem_gl_p.h b/src/opengl/qgraphicssystem_gl_p.h
index 4630da1..5829dcc 100644
--- a/src/opengl/qgraphicssystem_gl_p.h
+++ b/src/opengl/qgraphicssystem_gl_p.h
@@ -66,6 +66,10 @@ public:
QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
QWindowSurface *createWindowSurface(QWidget *widget) const;
+
+#ifdef QGL_USE_TEXTURE_POOL
+ void releaseCachedResources();
+#endif
private:
bool m_useX11GL;
};
diff --git a/src/opengl/qpixmapdata_gl_p.h b/src/opengl/qpixmapdata_gl_p.h
index a4066fd..41740dd 100644
--- a/src/opengl/qpixmapdata_gl_p.h
+++ b/src/opengl/qpixmapdata_gl_p.h
@@ -59,6 +59,10 @@
#include "private/qpixmapdata_p.h"
#include "private/qglpaintdevice_p.h"
+#ifdef Q_OS_SYMBIAN
+#include "private/qvolatileimage_p.h"
+#endif
+
QT_BEGIN_NAMESPACE
class QPaintEngine;
@@ -66,6 +70,12 @@ class QGLFramebufferObject;
class QGLFramebufferObjectFormat;
class QGLPixmapData;
+#ifdef QGL_USE_TEXTURE_POOL
+void qt_gl_register_pixmap(QGLPixmapData *pd);
+void qt_gl_unregister_pixmap(QGLPixmapData *pd);
+void qt_gl_hibernate_pixmaps();
+#endif
+
class QGLFramebufferObjectPool
{
public:
@@ -129,7 +139,25 @@ public:
GLuint bind(bool copyBack = true) const;
QGLTexture *texture() const;
-#if defined(Q_OS_SYMBIAN)
+#ifdef QGL_USE_TEXTURE_POOL
+ void destroyTexture();
+ // Detach this image from the image pool.
+ void detachTextureFromPool();
+ // Release the GL resources associated with this pixmap and copy
+ // the pixmap's contents out of the GPU back into main memory.
+ // The GL resource will be automatically recreated the next time
+ // ensureCreated() is called. Does nothing if the pixmap cannot be
+ // hibernated for some reason (e.g. texture is shared with another
+ // process via a SgImage).
+ void hibernate();
+ // Called when the QGLTexturePool wants to reclaim this pixmap's
+ // texture objects to reuse storage.
+ void reclaimTexture();
+ void forceToImage();
+#endif
+
+#ifdef Q_OS_SYMBIAN
+ QImage::Format idealFormat(QImage &image, Qt::ImageConversionFlags flags);
void* toNativeType(NativeType type);
void fromNativeType(void* pixmap, NativeType type);
#endif
@@ -161,7 +189,11 @@ private:
mutable QGLFramebufferObject *m_renderFbo;
mutable QPaintEngine *m_engine;
mutable QGLContext *m_ctx;
+#ifdef Q_OS_SYMBIAN
+ mutable QVolatileImage m_source;
+#else
mutable QImage m_source;
+#endif
mutable QGLTexture m_texture;
// the texture is not in sync with the source image
@@ -176,6 +208,23 @@ private:
mutable QGLPixmapGLPaintDevice m_glDevice;
+#ifdef QGL_USE_TEXTURE_POOL
+ QGLPixmapData *nextLRU;
+ QGLPixmapData *prevLRU;
+ mutable bool inLRU;
+ mutable bool failedToAlloc;
+ mutable bool inTexturePool;
+
+ QGLPixmapData *next;
+ QGLPixmapData *prev;
+
+ friend class QGLTexturePool;
+
+ friend void qt_gl_register_pixmap(QGLPixmapData *pd);
+ friend void qt_gl_unregister_pixmap(QGLPixmapData *pd);
+ friend void qt_gl_hibernate_pixmaps();
+#endif
+
friend class QGLPixmapGLPaintDevice;
friend class QMeeGoPixmapData;
friend class QMeeGoLivePixmapData;
diff --git a/src/opengl/qpixmapdata_poolgl.cpp b/src/opengl/qpixmapdata_poolgl.cpp
new file mode 100644
index 0000000..8ae90e9
--- /dev/null
+++ b/src/opengl/qpixmapdata_poolgl.cpp
@@ -0,0 +1,921 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtOpenGL module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qpixmap.h"
+#include "qglframebufferobject.h"
+
+#include <private/qpaintengine_raster_p.h>
+
+#include "qpixmapdata_gl_p.h"
+
+#include <private/qgl_p.h>
+#include <private/qdrawhelper_p.h>
+#include <private/qimage_p.h>
+
+#include <private/qpaintengineex_opengl2_p.h>
+
+#include <qdesktopwidget.h>
+#include <qfile.h>
+#include <qimagereader.h>
+#include <qbuffer.h>
+
+#include "qgltexturepool_p.h"
+
+QT_BEGIN_NAMESPACE
+
+Q_OPENGL_EXPORT extern QGLWidget* qt_gl_share_widget();
+
+static inline int areaDiff(const QSize &size, const QGLFramebufferObject *fbo)
+{
+ return qAbs(size.width() * size.height() - fbo->width() * fbo->height());
+}
+
+extern int qt_next_power_of_two(int v);
+
+static inline QSize maybeRoundToNextPowerOfTwo(const QSize &sz)
+{
+#ifdef QT_OPENGL_ES_2
+ QSize rounded(qt_next_power_of_two(sz.width()), qt_next_power_of_two(sz.height()));
+ if (rounded.width() * rounded.height() < 1.20 * sz.width() * sz.height())
+ return rounded;
+#endif
+ return sz;
+}
+
+
+QGLFramebufferObject *QGLFramebufferObjectPool::acquire(const QSize &requestSize, const QGLFramebufferObjectFormat &requestFormat, bool strictSize)
+{
+ QGLFramebufferObject *chosen = 0;
+ QGLFramebufferObject *candidate = 0;
+ for (int i = 0; !chosen && i < m_fbos.size(); ++i) {
+ QGLFramebufferObject *fbo = m_fbos.at(i);
+
+ if (strictSize) {
+ if (fbo->size() == requestSize && fbo->format() == requestFormat) {
+ chosen = fbo;
+ break;
+ } else {
+ continue;
+ }
+ }
+
+ if (fbo->format() == requestFormat) {
+ // choose the fbo with a matching format and the closest size
+ if (!candidate || areaDiff(requestSize, candidate) > areaDiff(requestSize, fbo))
+ candidate = fbo;
+ }
+
+ if (candidate) {
+ m_fbos.removeOne(candidate);
+
+ const QSize fboSize = candidate->size();
+ QSize sz = fboSize;
+
+ if (sz.width() < requestSize.width())
+ sz.setWidth(qMax(requestSize.width(), qRound(sz.width() * 1.5)));
+ if (sz.height() < requestSize.height())
+ sz.setHeight(qMax(requestSize.height(), qRound(sz.height() * 1.5)));
+
+ // wasting too much space?
+ if (sz.width() * sz.height() > requestSize.width() * requestSize.height() * 4)
+ sz = requestSize;
+
+ if (sz != fboSize) {
+ delete candidate;
+ candidate = new QGLFramebufferObject(maybeRoundToNextPowerOfTwo(sz), requestFormat);
+ }
+
+ chosen = candidate;
+ }
+ }
+
+ if (!chosen) {
+ if (strictSize)
+ chosen = new QGLFramebufferObject(requestSize, requestFormat);
+ else
+ chosen = new QGLFramebufferObject(maybeRoundToNextPowerOfTwo(requestSize), requestFormat);
+ }
+
+ if (!chosen->isValid()) {
+ delete chosen;
+ chosen = 0;
+ }
+
+ return chosen;
+}
+
+void QGLFramebufferObjectPool::release(QGLFramebufferObject *fbo)
+{
+ if (fbo)
+ m_fbos << fbo;
+}
+
+
+QPaintEngine* QGLPixmapGLPaintDevice::paintEngine() const
+{
+ return data->paintEngine();
+}
+
+void QGLPixmapGLPaintDevice::beginPaint()
+{
+ if (!data->isValid())
+ return;
+
+ // QGLPaintDevice::beginPaint will store the current binding and replace
+ // it with m_thisFBO:
+ m_thisFBO = data->m_renderFbo->handle();
+ QGLPaintDevice::beginPaint();
+
+ Q_ASSERT(data->paintEngine()->type() == QPaintEngine::OpenGL2);
+
+ // QPixmap::fill() is deferred until now, where we actually need to do the fill:
+ if (data->needsFill()) {
+ const QColor &c = data->fillColor();
+ float alpha = c.alphaF();
+ glDisable(GL_SCISSOR_TEST);
+ glClearColor(c.redF() * alpha, c.greenF() * alpha, c.blueF() * alpha, alpha);
+ glClear(GL_COLOR_BUFFER_BIT);
+ }
+ else if (!data->isUninitialized()) {
+ // If the pixmap (GL Texture) has valid content (it has been
+ // uploaded from an image or rendered into before), we need to
+ // copy it from the texture to the render FBO.
+
+ glDisable(GL_DEPTH_TEST);
+ glDisable(GL_SCISSOR_TEST);
+ glDisable(GL_BLEND);
+
+#if !defined(QT_OPENGL_ES_2)
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(0, data->width(), data->height(), 0, -999999, 999999);
+#endif
+
+ glViewport(0, 0, data->width(), data->height());
+
+ // Pass false to bind so it doesn't copy the FBO into the texture!
+ context()->drawTexture(QRect(0, 0, data->width(), data->height()), data->bind(false));
+ }
+}
+
+void QGLPixmapGLPaintDevice::endPaint()
+{
+ if (!data->isValid())
+ return;
+
+ data->copyBackFromRenderFbo(false);
+
+ // Base's endPaint will restore the previous FBO binding
+ QGLPaintDevice::endPaint();
+
+ qgl_fbo_pool()->release(data->m_renderFbo);
+ data->m_renderFbo = 0;
+}
+
+QGLContext* QGLPixmapGLPaintDevice::context() const
+{
+ data->ensureCreated();
+ return data->m_ctx;
+}
+
+QSize QGLPixmapGLPaintDevice::size() const
+{
+ return data->size();
+}
+
+bool QGLPixmapGLPaintDevice::alphaRequested() const
+{
+ return data->m_hasAlpha;
+}
+
+void QGLPixmapGLPaintDevice::setPixmapData(QGLPixmapData* d)
+{
+ data = d;
+}
+
+int qt_gl_pixmap_serial = 0;
+
+QGLPixmapData::QGLPixmapData(PixelType type)
+ : QPixmapData(type, OpenGLClass)
+ , m_renderFbo(0)
+ , m_engine(0)
+ , m_ctx(0)
+ , m_dirty(false)
+ , m_hasFillColor(false)
+ , m_hasAlpha(false)
+ , inLRU(false)
+ , failedToAlloc(false)
+ , inTexturePool(false)
+{
+ setSerialNumber(++qt_gl_pixmap_serial);
+ m_glDevice.setPixmapData(this);
+
+ qt_gl_register_pixmap(this);
+}
+
+QGLPixmapData::~QGLPixmapData()
+{
+ delete m_engine;
+
+ destroyTexture();
+ qt_gl_unregister_pixmap(this);
+}
+
+void QGLPixmapData::destroyTexture()
+{
+ if (inTexturePool) {
+ QGLTexturePool *pool = QGLTexturePool::instance();
+ if (m_texture.id)
+ pool->releaseTexture(this, m_texture.id);
+ } else {
+ if (m_texture.id) {
+ QGLWidget *shareWidget = qt_gl_share_widget();
+ if (shareWidget) {
+ QGLShareContextScope ctx(shareWidget->context());
+ glDeleteTextures(1, &m_texture.id);
+ }
+ }
+ }
+ m_texture.id = 0;
+ inTexturePool = false;
+}
+
+QPixmapData *QGLPixmapData::createCompatiblePixmapData() const
+{
+ return new QGLPixmapData(pixelType());
+}
+
+bool QGLPixmapData::isValid() const
+{
+ return w > 0 && h > 0;
+}
+
+bool QGLPixmapData::isValidContext(const QGLContext *ctx) const
+{
+ if (ctx == m_ctx)
+ return true;
+
+ const QGLContext *share_ctx = qt_gl_share_widget()->context();
+ return ctx == share_ctx || QGLContext::areSharing(ctx, share_ctx);
+}
+
+void QGLPixmapData::resize(int width, int height)
+{
+ if (width == w && height == h)
+ return;
+
+ if (width <= 0 || height <= 0) {
+ width = 0;
+ height = 0;
+ }
+
+ w = width;
+ h = height;
+ is_null = (w <= 0 || h <= 0);
+ d = pixelType() == QPixmapData::PixmapType ? 32 : 1;
+
+ destroyTexture();
+
+ m_source = QVolatileImage();
+ m_dirty = isValid();
+ setSerialNumber(++qt_gl_pixmap_serial);
+}
+
+void QGLPixmapData::ensureCreated() const
+{
+ if (!m_dirty)
+ return;
+
+ m_dirty = false;
+
+ QGLShareContextScope ctx(qt_gl_share_widget()->context());
+ m_ctx = ctx;
+
+ const GLenum internal_format = m_hasAlpha ? GL_RGBA : GL_RGB;
+#ifdef QT_OPENGL_ES_2
+ const GLenum external_format = internal_format;
+#else
+ const GLenum external_format = qt_gl_preferredTextureFormat();
+#endif
+ const GLenum target = GL_TEXTURE_2D;
+
+ GLenum type = GL_UNSIGNED_BYTE;
+ // Avoid conversion when pixmap is created from CFbsBitmap of EColor64K.
+ if (!m_source.isNull() && m_source.format() == QImage::Format_RGB16)
+ type = GL_UNSIGNED_SHORT_5_6_5;
+
+ m_texture.options &= ~QGLContext::MemoryManagedBindOption;
+
+ if (!m_texture.id) {
+ m_texture.id = QGLTexturePool::instance()->createTextureForPixmap(
+ target,
+ 0, internal_format,
+ w, h,
+ external_format,
+ type,
+ const_cast<QGLPixmapData*>(this));
+ if (!m_texture.id) {
+ failedToAlloc = true;
+ return;
+ }
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+
+ inTexturePool = true;
+ } else if (inTexturePool) {
+ glBindTexture(target, m_texture.id);
+ QGLTexturePool::instance()->useTexture(const_cast<QGLPixmapData*>(this));
+ }
+
+ if (!m_source.isNull() && m_texture.id) {
+ if (external_format == GL_RGB) {
+ m_source.beginDataAccess();
+ QImage tx;
+ if (type == GL_UNSIGNED_BYTE)
+ tx = m_source.imageRef().convertToFormat(QImage::Format_RGB888).mirrored(false, true);
+ else if (type == GL_UNSIGNED_SHORT_5_6_5)
+ tx = m_source.imageRef().mirrored(false, true);
+ m_source.endDataAccess(true);
+
+ glBindTexture(target, m_texture.id);
+ if (!tx.isNull())
+ glTexSubImage2D(target, 0, 0, 0, w, h, external_format,
+ type, tx.constBits());
+ else
+ qWarning("QGLPixmapData: Failed to create GL_RGB image of size %dx%d", w, h);
+ } else {
+ // do byte swizzling ARGB -> RGBA
+ m_source.beginDataAccess();
+ const QImage tx = ctx->d_func()->convertToGLFormat(m_source.imageRef(), true, external_format);
+ m_source.endDataAccess(true);
+ glBindTexture(target, m_texture.id);
+ if (!tx.isNull())
+ glTexSubImage2D(target, 0, 0, 0, w, h, external_format,
+ type, tx.constBits());
+ else
+ qWarning("QGLPixmapData: Failed to create GL_RGBA image of size %dx%d", w, h);
+ }
+
+ if (useFramebufferObjects())
+ m_source = QVolatileImage();
+ }
+}
+
+
+void QGLPixmapData::fromImage(const QImage &image,
+ Qt::ImageConversionFlags flags)
+{
+ QImage img = image;
+ createPixmapForImage(img, flags, false);
+}
+
+void QGLPixmapData::fromImageReader(QImageReader *imageReader,
+ Qt::ImageConversionFlags flags)
+{
+ QImage image = imageReader->read();
+ if (image.isNull())
+ return;
+
+ createPixmapForImage(image, flags, true);
+}
+
+bool QGLPixmapData::fromFile(const QString &filename, const char *format,
+ Qt::ImageConversionFlags flags)
+{
+ if (pixelType() == QPixmapData::BitmapType)
+ return QPixmapData::fromFile(filename, format, flags);
+ QFile file(filename);
+ if (file.open(QIODevice::ReadOnly)) {
+ QByteArray data = file.peek(64);
+ bool alpha;
+ if (m_texture.canBindCompressedTexture
+ (data.constData(), data.size(), format, &alpha)) {
+ resize(0, 0);
+ data = file.readAll();
+ file.close();
+ QGLShareContextScope ctx(qt_gl_share_widget()->context());
+ QSize size = m_texture.bindCompressedTexture
+ (data.constData(), data.size(), format);
+ if (!size.isEmpty()) {
+ w = size.width();
+ h = size.height();
+ is_null = false;
+ d = 32;
+ m_hasAlpha = alpha;
+ m_source = QVolatileImage();
+ m_dirty = isValid();
+ return true;
+ }
+ return false;
+ }
+ }
+
+ QImage image = QImageReader(filename, format).read();
+ if (image.isNull())
+ return false;
+
+ createPixmapForImage(image, flags, true);
+
+ return !isNull();
+}
+
+bool QGLPixmapData::fromData(const uchar *buffer, uint len, const char *format,
+ Qt::ImageConversionFlags flags)
+{
+ bool alpha;
+ const char *buf = reinterpret_cast<const char *>(buffer);
+ if (m_texture.canBindCompressedTexture(buf, int(len), format, &alpha)) {
+ resize(0, 0);
+ QGLShareContextScope ctx(qt_gl_share_widget()->context());
+ QSize size = m_texture.bindCompressedTexture(buf, int(len), format);
+ if (!size.isEmpty()) {
+ w = size.width();
+ h = size.height();
+ is_null = false;
+ d = 32;
+ m_hasAlpha = alpha;
+ m_source = QVolatileImage();
+ m_dirty = isValid();
+ return true;
+ }
+ }
+
+ QByteArray a = QByteArray::fromRawData(reinterpret_cast<const char *>(buffer), len);
+ QBuffer b(&a);
+ b.open(QIODevice::ReadOnly);
+ QImage image = QImageReader(&b, format).read();
+ if (image.isNull())
+ return false;
+
+ createPixmapForImage(image, flags, true);
+
+ return !isNull();
+}
+
+QImage::Format QGLPixmapData::idealFormat(QImage &image, Qt::ImageConversionFlags flags)
+{
+ QImage::Format format = QImage::Format_RGB32;
+ if (qApp->desktop()->depth() == 16)
+ format = QImage::Format_RGB16;
+
+ if (image.hasAlphaChannel()
+ && ((flags & Qt::NoOpaqueDetection)
+ || const_cast<QImage &>(image).data_ptr()->checkForAlphaPixels()))
+ format = QImage::Format_ARGB32_Premultiplied;
+
+ return format;
+}
+
+void QGLPixmapData::createPixmapForImage(QImage &image, Qt::ImageConversionFlags flags, bool inPlace)
+{
+ if (image.size() == QSize(w, h))
+ setSerialNumber(++qt_gl_pixmap_serial);
+
+ resize(image.width(), image.height());
+
+ if (pixelType() == BitmapType) {
+ QImage convertedImage = image.convertToFormat(QImage::Format_MonoLSB);
+ if (image.format() == QImage::Format_MonoLSB)
+ convertedImage.detach();
+
+ m_source = QVolatileImage(convertedImage);
+
+ } else {
+ QImage::Format format = idealFormat(image, flags);
+
+ if (inPlace && image.data_ptr()->convertInPlace(format, flags)) {
+ m_source = QVolatileImage(image);
+ } else {
+ QImage convertedImage = image.convertToFormat(format);
+
+ // convertToFormat won't detach the image if format stays the same.
+ if (image.format() == format)
+ convertedImage.detach();
+
+ m_source = QVolatileImage(convertedImage);
+ }
+ }
+
+ m_dirty = true;
+ m_hasFillColor = false;
+
+ m_hasAlpha = m_source.hasAlphaChannel();
+ w = image.width();
+ h = image.height();
+ is_null = (w <= 0 || h <= 0);
+ d = m_source.depth();
+
+ destroyTexture();
+}
+
+bool QGLPixmapData::scroll(int dx, int dy, const QRect &rect)
+{
+ Q_UNUSED(dx);
+ Q_UNUSED(dy);
+ Q_UNUSED(rect);
+ return false;
+}
+
+void QGLPixmapData::copy(const QPixmapData *data, const QRect &rect)
+{
+ if (data->classId() != QPixmapData::OpenGLClass || !static_cast<const QGLPixmapData *>(data)->useFramebufferObjects()) {
+ QPixmapData::copy(data, rect);
+ return;
+ }
+
+ const QGLPixmapData *other = static_cast<const QGLPixmapData *>(data);
+ if (other->m_renderFbo) {
+ QGLShareContextScope ctx(qt_gl_share_widget()->context());
+
+ resize(rect.width(), rect.height());
+ m_hasAlpha = other->m_hasAlpha;
+ ensureCreated();
+
+ if (!ctx->d_ptr->fbo)
+ glGenFramebuffers(1, &ctx->d_ptr->fbo);
+
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER_EXT, ctx->d_ptr->fbo);
+ glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
+ GL_TEXTURE_2D, m_texture.id, 0);
+
+ if (!other->m_renderFbo->isBound())
+ glBindFramebuffer(GL_READ_FRAMEBUFFER_EXT, other->m_renderFbo->handle());
+
+ glDisable(GL_SCISSOR_TEST);
+ if (ctx->d_ptr->active_engine && ctx->d_ptr->active_engine->type() == QPaintEngine::OpenGL2)
+ static_cast<QGL2PaintEngineEx *>(ctx->d_ptr->active_engine)->invalidateState();
+
+ glBlitFramebufferEXT(rect.x(), rect.y(), rect.x() + rect.width(), rect.y() + rect.height(),
+ 0, 0, w, h,
+ GL_COLOR_BUFFER_BIT,
+ GL_NEAREST);
+
+ glBindFramebuffer(GL_FRAMEBUFFER_EXT, ctx->d_ptr->current_fbo);
+ } else {
+ QPixmapData::copy(data, rect);
+ }
+}
+
+void QGLPixmapData::fill(const QColor &color)
+{
+ if (!isValid())
+ return;
+
+ bool hasAlpha = color.alpha() != 255;
+ if (hasAlpha && !m_hasAlpha) {
+ if (m_texture.id) {
+ destroyTexture();
+ m_dirty = true;
+ }
+ m_hasAlpha = color.alpha() != 255;
+ }
+
+ if (useFramebufferObjects()) {
+ m_source = QVolatileImage();
+ m_hasFillColor = true;
+ m_fillColor = color;
+ } else {
+ forceToImage();
+
+ if (m_source.depth() == 32) {
+ m_source.fill(PREMUL(color.rgba()));
+
+ } else if (m_source.depth() == 1) {
+ if (color == Qt::color1)
+ m_source.fill(1);
+ else
+ m_source.fill(0);
+ }
+ }
+}
+
+bool QGLPixmapData::hasAlphaChannel() const
+{
+ return m_hasAlpha;
+}
+
+QImage QGLPixmapData::fillImage(const QColor &color) const
+{
+ QImage img;
+ if (pixelType() == BitmapType) {
+ img = QImage(w, h, QImage::Format_MonoLSB);
+
+ img.setColorCount(2);
+ img.setColor(0, QColor(Qt::color0).rgba());
+ img.setColor(1, QColor(Qt::color1).rgba());
+
+ if (color == Qt::color1)
+ img.fill(1);
+ else
+ img.fill(0);
+ } else {
+ img = QImage(w, h,
+ m_hasAlpha
+ ? QImage::Format_ARGB32_Premultiplied
+ : QImage::Format_RGB32);
+ img.fill(PREMUL(color.rgba()));
+ }
+ return img;
+}
+
+extern QImage qt_gl_read_texture(const QSize &size, bool alpha_format, bool include_alpha);
+
+QImage QGLPixmapData::toImage() const
+{
+ if (!isValid())
+ return QImage();
+
+ if (m_renderFbo) {
+ copyBackFromRenderFbo(true);
+ } else if (!m_source.isNull()) {
+ // QVolatileImage::toImage() will make a copy always so no check
+ // for active painting is needed.
+ QImage img = m_source.toImage();
+ if (img.format() == QImage::Format_MonoLSB) {
+ img.setColorCount(2);
+ img.setColor(0, QColor(Qt::color0).rgba());
+ img.setColor(1, QColor(Qt::color1).rgba());
+ }
+ return img;
+ } else if (m_dirty || m_hasFillColor) {
+ return fillImage(m_fillColor);
+ } else {
+ ensureCreated();
+ }
+
+ QGLShareContextScope ctx(qt_gl_share_widget()->context());
+ glBindTexture(GL_TEXTURE_2D, m_texture.id);
+ return qt_gl_read_texture(QSize(w, h), true, true);
+}
+
+struct TextureBuffer
+{
+ QGLFramebufferObject *fbo;
+ QGL2PaintEngineEx *engine;
+};
+
+Q_GLOBAL_STATIC(QGLFramebufferObjectPool, _qgl_fbo_pool)
+QGLFramebufferObjectPool* qgl_fbo_pool()
+{
+ return _qgl_fbo_pool();
+}
+
+void QGLPixmapData::copyBackFromRenderFbo(bool keepCurrentFboBound) const
+{
+ if (!isValid())
+ return;
+
+ m_hasFillColor = false;
+
+ const QGLContext *share_ctx = qt_gl_share_widget()->context();
+ QGLShareContextScope ctx(share_ctx);
+
+ ensureCreated();
+
+ if (!ctx->d_ptr->fbo)
+ glGenFramebuffers(1, &ctx->d_ptr->fbo);
+
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER_EXT, ctx->d_ptr->fbo);
+ glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
+ GL_TEXTURE_2D, m_texture.id, 0);
+
+ const int x0 = 0;
+ const int x1 = w;
+ const int y0 = 0;
+ const int y1 = h;
+
+ if (!m_renderFbo->isBound())
+ glBindFramebuffer(GL_READ_FRAMEBUFFER_EXT, m_renderFbo->handle());
+
+ glDisable(GL_SCISSOR_TEST);
+
+ glBlitFramebufferEXT(x0, y0, x1, y1,
+ x0, y0, x1, y1,
+ GL_COLOR_BUFFER_BIT,
+ GL_NEAREST);
+
+ if (keepCurrentFboBound) {
+ glBindFramebuffer(GL_FRAMEBUFFER_EXT, ctx->d_ptr->current_fbo);
+ } else {
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER_EXT, m_renderFbo->handle());
+ ctx->d_ptr->current_fbo = m_renderFbo->handle();
+ }
+}
+
+bool QGLPixmapData::useFramebufferObjects() const
+{
+#ifdef Q_OS_SYMBIAN
+ // We don't want to use FBOs on Symbian
+ return false;
+#else
+ return QGLFramebufferObject::hasOpenGLFramebufferObjects()
+ && QGLFramebufferObject::hasOpenGLFramebufferBlit()
+ && qt_gl_preferGL2Engine()
+ && (w * h > 32*32); // avoid overhead of FBOs for small pixmaps
+#endif
+}
+
+QPaintEngine* QGLPixmapData::paintEngine() const
+{
+ if (!isValid())
+ return 0;
+
+ if (m_renderFbo)
+ return m_engine;
+
+ if (useFramebufferObjects()) {
+ extern QGLWidget* qt_gl_share_widget();
+
+ if (!QGLContext::currentContext())
+ qt_gl_share_widget()->makeCurrent();
+ QGLShareContextScope ctx(qt_gl_share_widget()->context());
+
+ QGLFramebufferObjectFormat format;
+ format.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
+ format.setSamples(4);
+ format.setInternalTextureFormat(GLenum(m_hasAlpha ? GL_RGBA : GL_RGB));
+
+ m_renderFbo = qgl_fbo_pool()->acquire(size(), format);
+
+ if (m_renderFbo) {
+ if (!m_engine)
+ m_engine = new QGL2PaintEngineEx;
+ return m_engine;
+ }
+
+ qWarning() << "Failed to create pixmap texture buffer of size " << size() << ", falling back to raster paint engine";
+ }
+
+ // If the application wants to paint into the QPixmap, we first
+ // force it to QImage format and then paint into that.
+ // This is simpler than juggling multiple GL contexts.
+ const_cast<QGLPixmapData *>(this)->forceToImage();
+
+ if (m_hasFillColor) {
+ m_source.fill(PREMUL(m_fillColor.rgba()));
+ m_hasFillColor = false;
+ }
+ 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
+// a multisample FBO).
+GLuint QGLPixmapData::bind(bool copyBack) const
+{
+ if (m_renderFbo && copyBack) {
+ copyBackFromRenderFbo(true);
+ } else {
+ ensureCreated();
+ }
+
+ GLuint id = m_texture.id;
+ glBindTexture(GL_TEXTURE_2D, id);
+
+ if (m_hasFillColor) {
+ if (!useFramebufferObjects()) {
+ m_source = QVolatileImage(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.constBits());
+ }
+
+ return id;
+}
+
+QGLTexture* QGLPixmapData::texture() const
+{
+ return &m_texture;
+}
+
+void QGLPixmapData::detachTextureFromPool()
+{
+ if (inTexturePool) {
+ QGLTexturePool::instance()->detachTexture(this);
+ inTexturePool = false;
+ }
+}
+
+void QGLPixmapData::hibernate()
+{
+ // If the texture was imported (e.g, from an SgImage under Symbian),
+ // then we cannot copy it back to main memory for storage.
+ if (m_texture.id && m_source.isNull())
+ return;
+
+ forceToImage();
+ destroyTexture();
+}
+
+void QGLPixmapData::reclaimTexture()
+{
+ if (!inTexturePool)
+ return;
+ forceToImage();
+ destroyTexture();
+}
+
+Q_GUI_EXPORT int qt_defaultDpiX();
+Q_GUI_EXPORT int qt_defaultDpiY();
+
+int QGLPixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const
+{
+ if (w == 0)
+ return 0;
+
+ switch (metric) {
+ case QPaintDevice::PdmWidth:
+ return w;
+ case QPaintDevice::PdmHeight:
+ return h;
+ case QPaintDevice::PdmNumColors:
+ return 0;
+ case QPaintDevice::PdmDepth:
+ return d;
+ case QPaintDevice::PdmWidthMM:
+ return qRound(w * 25.4 / qt_defaultDpiX());
+ case QPaintDevice::PdmHeightMM:
+ return qRound(h * 25.4 / qt_defaultDpiY());
+ case QPaintDevice::PdmDpiX:
+ case QPaintDevice::PdmPhysicalDpiX:
+ return qt_defaultDpiX();
+ case QPaintDevice::PdmDpiY:
+ case QPaintDevice::PdmPhysicalDpiY:
+ return qt_defaultDpiY();
+ default:
+ qWarning("QGLPixmapData::metric(): Invalid metric");
+ return 0;
+ }
+}
+
+// Force the pixmap data to be backed by some valid data.
+void QGLPixmapData::forceToImage()
+{
+ if (!isValid())
+ return;
+
+ if (m_source.isNull()) {
+ QImage::Format format = QImage::Format_ARGB32_Premultiplied;
+ if (pixelType() == BitmapType)
+ format = QImage::Format_MonoLSB;
+ m_source = QVolatileImage(w, h, format);
+ }
+
+ m_dirty = true;
+}
+
+QGLPaintDevice *QGLPixmapData::glDevice() const
+{
+ return &m_glDevice;
+}
+
+QT_END_NAMESPACE
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index 0bffbda..11a9eb0 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -181,16 +181,14 @@ QGLGraphicsSystem::QGLGraphicsSystem(bool useX11GL)
//
// QGLWindowSurface
//
-
class QGLGlobalShareWidget
{
public:
- QGLGlobalShareWidget() : widget(0), initializing(false) {}
+ QGLGlobalShareWidget() : firstPixmap(0), widgetRefCount(0), widget(0), initializing(false) {}
QGLWidget *shareWidget() {
if (!initializing && !widget && !cleanedUp) {
initializing = true;
-
widget = new QGLWidget(QGLFormat(QGL::SingleBuffer | QGL::NoDepthBuffer | QGL::NoStencilBuffer));
widget->resize(1, 1);
@@ -226,6 +224,9 @@ public:
static bool cleanedUp;
+ QGLPixmapData *firstPixmap;
+ int widgetRefCount;
+
private:
QGLWidget *widget;
bool initializing;
@@ -256,6 +257,43 @@ void qt_destroy_gl_share_widget()
_qt_gl_share_widget()->destroy();
}
+#ifdef QGL_USE_TEXTURE_POOL
+void qt_gl_register_pixmap(QGLPixmapData *pd)
+{
+ QGLGlobalShareWidget *shared = _qt_gl_share_widget();
+ pd->next = shared->firstPixmap;
+ pd->prev = 0;
+ if (shared->firstPixmap)
+ shared->firstPixmap->prev = pd;
+ shared->firstPixmap = pd;
+}
+
+void qt_gl_unregister_pixmap(QGLPixmapData *pd)
+{
+ if (pd->next)
+ pd->next->prev = pd->prev;
+ if (pd->prev) {
+ pd->prev->next = pd->next;
+ } else {
+ QGLGlobalShareWidget *shared = _qt_gl_share_widget();
+ if (shared)
+ shared->firstPixmap = pd->next;
+ }
+}
+
+void qt_gl_hibernate_pixmaps()
+{
+ QGLGlobalShareWidget *shared = _qt_gl_share_widget();
+
+ // Scan all QGLPixmapData objects in the system and hibernate them.
+ QGLPixmapData *pd = shared->firstPixmap;
+ while (pd != 0) {
+ pd->hibernate();
+ pd = pd->next;
+ }
+}
+#endif
+
struct QGLWindowSurfacePrivate
{
QGLFramebufferObject *fbo;
@@ -347,6 +385,27 @@ QGLWindowSurface::~QGLWindowSurface()
delete d_ptr->pb;
delete d_ptr->fbo;
delete d_ptr;
+
+ if (QGLGlobalShareWidget::cleanedUp)
+ return;
+
+ --(_qt_gl_share_widget()->widgetRefCount);
+
+#ifdef QGL_USE_TEXTURE_POOL
+ if (_qt_gl_share_widget()->widgetRefCount <= 0) {
+ // All of the widget window surfaces have been destroyed
+ // but we still have GL pixmaps active. Ask them to hibernate
+ // to free up GPU resources until a widget is shown again.
+ // This may eventually cause the EGLContext to be destroyed
+ // because nothing in the system needs a context, which will
+ // free up even more GPU resources.
+ qt_gl_hibernate_pixmaps();
+
+ // Destroy the context if necessary.
+ if (!qt_gl_share_widget()->context()->isSharing())
+ qt_destroy_gl_share_widget();
+ }
+#endif
}
void QGLWindowSurface::deleted(QObject *object)
@@ -394,6 +453,9 @@ void QGLWindowSurface::hijackWindow(QWidget *widget)
ctx->create(qt_gl_share_widget()->context());
+ if (widget != qt_gl_share_widget())
+ ++(_qt_gl_share_widget()->widgetRefCount);
+
#ifndef QT_NO_EGL
static bool checkedForNOKSwapRegion = false;
static bool haveNOKSwapRegion = false;
@@ -405,9 +467,9 @@ void QGLWindowSurface::hijackWindow(QWidget *widget)
if (haveNOKSwapRegion)
qDebug() << "Found EGL_NOK_swap_region2 extension. Using partial updates.";
}
-
- if (ctx->d_func()->eglContext->configAttrib(EGL_SWAP_BEHAVIOR) != EGL_BUFFER_PRESERVED &&
- ! haveNOKSwapRegion)
+ bool swapBehaviourPreserved = (ctx->d_func()->eglContext->configAttrib(EGL_SWAP_BEHAVIOR)
+ || (ctx->d_func()->eglContext->configAttrib(EGL_SURFACE_TYPE)&EGL_SWAP_BEHAVIOR_PRESERVED_BIT));
+ if (!swapBehaviourPreserved && !haveNOKSwapRegion)
setPartialUpdateSupport(false); // Force full-screen updates
else
setPartialUpdateSupport(true);
@@ -421,7 +483,9 @@ void QGLWindowSurface::hijackWindow(QWidget *widget)
voidPtr = &widgetPrivate->extraData()->glContext;
d_ptr->contexts << ctxPtr;
+#ifndef Q_OS_SYMBIAN
qDebug() << "hijackWindow() context created for" << widget << d_ptr->contexts.size();
+#endif
}
QGLContext *QGLWindowSurface::context() const
@@ -908,8 +972,9 @@ void QGLWindowSurface::updateGeometry() {
if (d_ptr->destructive_swap_buffers)
initializeOffscreenTexture(surfSize);
#endif
-
- qDebug() << "QGLWindowSurface: Using plain widget as window surface" << this;;
+#ifndef Q_OS_SYMBIAN
+ qDebug() << "QGLWindowSurface: Using plain widget as window surface" << this;
+#endif
d_ptr->ctx = ctx;
d_ptr->ctx->d_ptr->internal_context = true;
}
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index 22cbbf5..44dceea 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -2333,6 +2333,7 @@ bool QVGPaintEngine::isDefaultClipRect(const QRect& rect)
void QVGPaintEngine::clipEnabledChanged()
{
#if defined(QVG_SCISSOR_CLIP)
+ vgSeti(VG_MASKING, VG_FALSE); // disable mask fallback
updateScissor();
#else
Q_D(QVGPaintEngine);
@@ -3134,9 +3135,13 @@ void QVGPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF
if (pm.size().width() <= screenSize.width()
&& pm.size().height() <= screenSize.height())
vgpd->failedToAlloc = false;
- }
- drawImage(r, *(pd->buffer()), sr, Qt::AutoColor);
+ vgpd->source.beginDataAccess();
+ drawImage(r, vgpd->source.imageRef(), sr, Qt::AutoColor);
+ vgpd->source.endDataAccess(true);
+ } else {
+ drawImage(r, *(pd->buffer()), sr, Qt::AutoColor);
+ }
}
void QVGPaintEngine::drawPixmap(const QPointF &pos, const QPixmap &pm)
@@ -3162,9 +3167,13 @@ void QVGPaintEngine::drawPixmap(const QPointF &pos, const QPixmap &pm)
if (pm.size().width() <= screenSize.width()
&& pm.size().height() <= screenSize.height())
vgpd->failedToAlloc = false;
- }
- drawImage(pos, *(pd->buffer()));
+ vgpd->source.beginDataAccess();
+ drawImage(pos, vgpd->source.imageRef());
+ vgpd->source.endDataAccess();
+ } else {
+ drawImage(pos, *(pd->buffer()));
+ }
}
void QVGPaintEngine::drawImage
@@ -3172,6 +3181,8 @@ void QVGPaintEngine::drawImage
Qt::ImageConversionFlags flags)
{
Q_D(QVGPaintEngine);
+ if (image.isNull())
+ return;
VGImage vgImg;
if (d->simpleTransform || d->opacity == 1.0f)
vgImg = toVGImageSubRect(image, sr.toRect(), flags);
@@ -3217,6 +3228,8 @@ void QVGPaintEngine::drawImage
void QVGPaintEngine::drawImage(const QPointF &pos, const QImage &image)
{
Q_D(QVGPaintEngine);
+ if (image.isNull())
+ return;
VGImage vgImg;
if (canVgWritePixels(image)) {
// Optimization for straight blits, no blending
@@ -4010,6 +4023,8 @@ VGImageFormat qt_vg_image_to_vg_format(QImage::Format format)
switch (format) {
case QImage::Format_MonoLSB:
return VG_BW_1;
+ case QImage::Format_Indexed8:
+ return VG_sL_8;
case QImage::Format_ARGB32_Premultiplied:
return VG_sARGB_8888_PRE;
case QImage::Format_RGB32:
@@ -4020,7 +4035,8 @@ VGImageFormat qt_vg_image_to_vg_format(QImage::Format format)
return VG_sRGB_565;
case QImage::Format_ARGB4444_Premultiplied:
return VG_sARGB_4444;
- default: break;
+ default:
+ break;
}
return VG_sARGB_8888; // XXX
}
diff --git a/src/openvg/qpaintengine_vg_p.h b/src/openvg/qpaintengine_vg_p.h
index 85583cc..1e9103b 100644
--- a/src/openvg/qpaintengine_vg_p.h
+++ b/src/openvg/qpaintengine_vg_p.h
@@ -58,7 +58,7 @@
QT_BEGIN_NAMESPACE
-class QFixedPoint;
+struct QFixedPoint;
class QVGPaintEnginePrivate;
class QPixmapData;
class QVGEGLWindowSurfacePrivate;
diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp
index 732b484..3f67c79 100644
--- a/src/openvg/qpixmapdata_vg.cpp
+++ b/src/openvg/qpixmapdata_vg.cpp
@@ -50,6 +50,7 @@
#include <QBuffer>
#include <QImageReader>
#include <QtGui/private/qimage_p.h>
+#include <QtGui/private/qnativeimagehandleprovider_p.h>
QT_BEGIN_NAMESPACE
@@ -66,11 +67,15 @@ QVGPixmapData::QVGPixmapData(PixelType type)
inImagePool = false;
inLRU = false;
failedToAlloc = false;
+#if defined(Q_OS_SYMBIAN)
+ nativeImageHandleProvider = 0;
+ nativeImageHandle = 0;
+#endif
#if !defined(QT_NO_EGL)
context = 0;
qt_vg_register_pixmap(this);
#endif
- setSerialNumber(++qt_vg_pixmap_serial);
+ updateSerial();
}
QVGPixmapData::~QVGPixmapData()
@@ -98,6 +103,10 @@ void QVGPixmapData::destroyImages()
vgImage = VG_INVALID_HANDLE;
vgImageOpacity = VG_INVALID_HANDLE;
inImagePool = false;
+
+#if defined(Q_OS_SYMBIAN)
+ releaseNativeImageHandle();
+#endif
}
void QVGPixmapData::destroyImageAndContext()
@@ -105,6 +114,8 @@ void QVGPixmapData::destroyImageAndContext()
if (vgImage != VG_INVALID_HANDLE) {
// We need to have a context current to destroy the image.
#if !defined(QT_NO_EGL)
+ if (!context)
+ context = qt_vg_create_context(0, QInternal::Pixmap);
if (context->isCurrent()) {
destroyImages();
} else {
@@ -118,6 +129,10 @@ void QVGPixmapData::destroyImageAndContext()
#else
destroyImages();
#endif
+ } else {
+#if defined(Q_OS_SYMBIAN)
+ releaseNativeImageHandle();
+#endif
}
#if !defined(QT_NO_EGL)
if (context) {
@@ -138,25 +153,31 @@ bool QVGPixmapData::isValid() const
return (w > 0 && h > 0);
}
+void QVGPixmapData::updateSerial()
+{
+ setSerialNumber(++qt_vg_pixmap_serial);
+}
+
void QVGPixmapData::resize(int wid, int ht)
{
- if (w == wid && h == ht)
+ if (w == wid && h == ht) {
+ updateSerial();
return;
+ }
w = wid;
h = ht;
d = 32; // We always use ARGB_Premultiplied for VG pixmaps.
is_null = (w <= 0 || h <= 0);
- source = QImage();
+ source = QVolatileImage();
recreate = true;
- setSerialNumber(++qt_vg_pixmap_serial);
+ updateSerial();
}
-void QVGPixmapData::fromImage
- (const QImage &image, Qt::ImageConversionFlags flags)
+void QVGPixmapData::fromImage(const QImage &image, Qt::ImageConversionFlags flags)
{
- if(image.isNull())
+ if (image.isNull())
return;
QImage img = image;
@@ -200,33 +221,34 @@ bool QVGPixmapData::fromData(const uchar *buffer, uint len, const char *format,
return !isNull();
}
-/*!
- out-of-place conversion (inPlace == false) will always detach()
- */
-void QVGPixmapData::createPixmapForImage(QImage &image, Qt::ImageConversionFlags flags, bool inPlace)
+QImage::Format QVGPixmapData::idealFormat(QImage *image, Qt::ImageConversionFlags flags) const
{
- if (image.size() == QSize(w, h))
- setSerialNumber(++qt_vg_pixmap_serial);
- else
- resize(image.width(), image.height());
-
QImage::Format format = sourceFormat();
- int d = image.depth();
- if (d == 1 || d == 16 || d == 24 || (d == 32 && !image.hasAlphaChannel()))
+ int d = image->depth();
+ if (d == 1 || d == 16 || d == 24 || (d == 32 && !image->hasAlphaChannel()))
format = QImage::Format_RGB32;
- else if (!(flags & Qt::NoOpaqueDetection) && const_cast<QImage &>(image).data_ptr()->checkForAlphaPixels())
+ else if (!(flags & Qt::NoOpaqueDetection) && image->data_ptr()->checkForAlphaPixels())
format = sourceFormat();
else
- format = image.hasAlphaChannel() ? sourceFormat() : QImage::Format_RGB32;
+ format = image->hasAlphaChannel() ? sourceFormat() : QImage::Format_RGB32;
+ return format;
+}
+
+void QVGPixmapData::createPixmapForImage(QImage &image, Qt::ImageConversionFlags flags, bool inPlace)
+{
+ resize(image.width(), image.height());
+
+ QImage::Format format = idealFormat(&image, flags);
if (inPlace && image.data_ptr()->convertInPlace(format, flags)) {
- source = image;
+ source = QVolatileImage(image);
} else {
- source = image.convertToFormat(format);
-
- // convertToFormat won't detach the image if format stays the same.
- if (image.format() == format)
- source.detach();
+ QImage convertedImage = image.convertToFormat(format);
+ // convertToFormat won't detach the image if format stays the
+ // same. Detaching is needed to prevent issues with painting
+ // onto this QPixmap later on.
+ convertedImage.detach();
+ source = QVolatileImage(convertedImage);
}
recreate = true;
@@ -236,27 +258,23 @@ void QVGPixmapData::fill(const QColor &color)
{
if (!isValid())
return;
-
- if (source.isNull())
- source = QImage(w, h, sourceFormat());
-
+ forceToImage();
if (source.depth() == 1) {
// Pick the best approximate color in the image's colortable.
int gray = qGray(color.rgba());
- if (qAbs(qGray(source.color(0)) - gray) < qAbs(qGray(source.color(1)) - gray))
+ if (qAbs(qGray(source.imageRef().color(0)) - gray)
+ < qAbs(qGray(source.imageRef().color(1)) - gray))
source.fill(0);
else
source.fill(1);
} else {
source.fill(PREMUL(color.rgba()));
}
-
- // Re-upload the image to VG the next time toVGImage() is called.
- recreate = true;
}
bool QVGPixmapData::hasAlphaChannel() const
{
+ ensureReadback(true);
if (!source.isNull())
return source.hasAlphaChannel();
else
@@ -265,27 +283,52 @@ bool QVGPixmapData::hasAlphaChannel() const
void QVGPixmapData::setAlphaChannel(const QPixmap &alphaChannel)
{
+ if (!isValid())
+ return;
forceToImage();
- source.setAlphaChannel(alphaChannel.toImage());
+ source.setAlphaChannel(alphaChannel);
}
QImage QVGPixmapData::toImage() const
{
if (!isValid())
return QImage();
-
+ ensureReadback(true);
if (source.isNull()) {
- source = QImage(w, h, sourceFormat());
+ source = QVolatileImage(w, h, sourceFormat());
recreate = true;
}
+ return source.toImage();
+}
- return source;
+void QVGPixmapData::copy(const QPixmapData *data, const QRect &rect)
+{
+ // toImage() is potentially expensive with QVolatileImage so provide a
+ // more efficient implementation of copy() that does not rely on it.
+ if (!data) {
+ return;
+ }
+ if (data->classId() != OpenVGClass) {
+ fromImage(data->toImage(rect), Qt::NoOpaqueDetection);
+ return;
+ }
+ const QVGPixmapData *pd = static_cast<const QVGPixmapData *>(data);
+ QRect r = rect;
+ if (r.isNull() || r.contains(QRect(0, 0, pd->w, pd->h))) {
+ r = QRect(0, 0, pd->w, pd->h);
+ }
+ resize(r.width(), r.height());
+ recreate = true;
+ if (!pd->source.isNull()) {
+ source = QVolatileImage(r.width(), r.height(), pd->source.format());
+ source.copyFrom(&pd->source, r);
+ }
}
QImage *QVGPixmapData::buffer()
{
- forceToImage();
- return &source;
+ // Cannot be safely implemented and QVGPixmapData is not (must not be) RasterClass anyway.
+ return 0;
}
QPaintEngine* QVGPixmapData::paintEngine() const
@@ -313,6 +356,12 @@ VGImage QVGPixmapData::toVGImage()
else if (recreate)
cachedOpacity = -1.0f; // Force opacity image to be refreshed later.
+#if defined(Q_OS_SYMBIAN)
+ if (recreate && nativeImageHandleProvider && !nativeImageHandle) {
+ createFromNativeImageHandleProvider();
+ }
+#endif
+
if (vgImage == VG_INVALID_HANDLE) {
vgImage = QVGImagePool::instance()->createImageForPixmap
(qt_vg_image_to_vg_format(source.format()), w, h, VG_IMAGE_QUALITY_FASTER, this);
@@ -329,10 +378,12 @@ VGImage QVGPixmapData::toVGImage()
}
if (!source.isNull() && recreate) {
+ source.beginDataAccess();
vgImageSubData
(vgImage,
source.constBits(), source.bytesPerLine(),
qt_vg_image_to_vg_format(source.format()), 0, 0, w, h);
+ source.endDataAccess(true);
}
recreate = false;
@@ -395,9 +446,16 @@ void QVGPixmapData::detachImageFromPool()
void QVGPixmapData::hibernate()
{
- // If the image was imported (e.g, from an SgImage under Symbian),
- // then we cannot copy it back to main memory for storage.
- if (vgImage != VG_INVALID_HANDLE && source.isNull())
+ // If the image was imported (e.g, from an SgImage under Symbian), then
+ // skip the hibernation, there is no sense in copying it back to main
+ // memory because the data is most likely shared between several processes.
+ bool skipHibernate = (vgImage != VG_INVALID_HANDLE && source.isNull());
+#if defined(Q_OS_SYMBIAN)
+ // However we have to proceed normally if the image was retrieved via
+ // a handle provider.
+ skipHibernate &= !nativeImageHandleProvider;
+#endif
+ if (skipHibernate)
return;
forceToImage();
@@ -442,18 +500,47 @@ int QVGPixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const
}
}
-// Force the pixmap data to be in QImage format.
+// Ensures that the pixmap is backed by some valid data and forces the data to
+// be re-uploaded to the VGImage when toVGImage() is called next time.
void QVGPixmapData::forceToImage()
{
if (!isValid())
return;
+ ensureReadback(false);
+
if (source.isNull())
- source = QImage(w, h, sourceFormat());
+ source = QVolatileImage(w, h, sourceFormat());
recreate = true;
}
+void QVGPixmapData::ensureReadback(bool readOnly) const
+{
+ if (vgImage != VG_INVALID_HANDLE && source.isNull()) {
+ source = QVolatileImage(w, h, sourceFormat());
+ source.beginDataAccess();
+ vgGetImageSubData(vgImage, source.bits(), source.bytesPerLine(),
+ qt_vg_image_to_vg_format(source.format()),
+ 0, 0, w, h);
+ source.endDataAccess();
+ if (readOnly) {
+ recreate = false;
+ } else {
+ // Once we did a readback, the original VGImage must be destroyed
+ // because it may be shared (e.g. created via SgImage) and a subsequent
+ // upload of the image data may produce unexpected results.
+ const_cast<QVGPixmapData *>(this)->destroyImages();
+#if defined(Q_OS_SYMBIAN)
+ // There is now an own copy of the data so drop the handle provider,
+ // otherwise toVGImage() would request the handle again, which is wrong.
+ nativeImageHandleProvider = 0;
+#endif
+ recreate = true;
+ }
+ }
+}
+
QImage::Format QVGPixmapData::sourceFormat() const
{
return QImage::Format_ARGB32_Premultiplied;
diff --git a/src/openvg/qpixmapdata_vg_p.h b/src/openvg/qpixmapdata_vg_p.h
index 58e69db..15ff889 100644
--- a/src/openvg/qpixmapdata_vg_p.h
+++ b/src/openvg/qpixmapdata_vg_p.h
@@ -54,7 +54,8 @@
//
#include <QtGui/private/qpixmap_raster_p.h>
-#include <private/qvg_p.h>
+#include <QtGui/private/qvolatileimage_p.h>
+#include "qvg_p.h"
#if defined(Q_OS_SYMBIAN)
class RSGImage;
@@ -75,6 +76,8 @@ void qt_vg_unregister_pixmap(QVGPixmapData *pd);
void qt_vg_hibernate_pixmaps(QVGSharedContext *context);
#endif
+class QNativeImageHandleProvider;
+
class Q_OPENVG_EXPORT QVGPixmapData : public QPixmapData
{
public:
@@ -99,6 +102,7 @@ public:
bool hasAlphaChannel() const;
void setAlphaChannel(const QPixmap &alphaChannel);
QImage toImage() const;
+ void copy(const QPixmapData *data, const QRect &rect);
QImage *buffer();
QPaintEngine* paintEngine() const;
@@ -124,11 +128,21 @@ public:
// VGImage objects to reuse storage.
virtual void reclaimImages();
+ // If vgImage is valid but source is null, copies pixel data from GPU back
+ // into main memory and destroys vgImage. For a normal pixmap this function
+ // does nothing, however if the pixmap was created directly from a VGImage
+ // (e.g. via SgImage on Symbian) then by doing the readback this ensures
+ // that QImage-based functions can operate too.
+ virtual void ensureReadback(bool readOnly) const;
+
QSize size() const { return QSize(w, h); }
#if defined(Q_OS_SYMBIAN)
void* toNativeType(NativeType type);
void fromNativeType(void* pixmap, NativeType type);
+ bool initFromNativeImageHandle(void *handle, const QString &type);
+ void createFromNativeImageHandleProvider();
+ void releaseNativeImageHandle();
#endif
protected:
@@ -161,15 +175,23 @@ protected:
VGImage vgImage;
VGImage vgImageOpacity;
qreal cachedOpacity;
- mutable QImage source;
+ mutable QVolatileImage source;
mutable bool recreate;
bool inImagePool;
#if !defined(QT_NO_EGL)
mutable QEglContext *context;
#endif
+#if defined(Q_OS_SYMBIAN)
+ mutable QNativeImageHandleProvider *nativeImageHandleProvider;
+ void *nativeImageHandle;
+ QString nativeImageType;
+#endif
+
void forceToImage();
QImage::Format sourceFormat() const;
+ QImage::Format idealFormat(QImage *image, Qt::ImageConversionFlags flags) const;
+ void updateSerial();
void destroyImageAndContext();
void destroyImages();
diff --git a/src/openvg/qvg_symbian.cpp b/src/openvg/qvg_symbian.cpp
index 2ea38c1..0d2ed9e 100644
--- a/src/openvg/qvg_symbian.cpp
+++ b/src/openvg/qvg_symbian.cpp
@@ -41,10 +41,10 @@
#include "qpixmapdata_vg_p.h"
#include "qvgfontglyphcache_p.h"
+#include <QtGui/private/qnativeimagehandleprovider_p.h>
#include <private/qt_s60_p.h>
#include <fbs.h>
-#include <bitdev.h>
#ifdef QT_SYMBIAN_SUPPORTS_SGIMAGE
# include <sgresource/sgimage.h>
@@ -75,33 +75,6 @@ VGImage QVG::vgCreateEGLImageTargetKHR(VGeglImageKHR eglImage)
extern int qt_vg_pixmap_serial;
-static CFbsBitmap* createBlitCopy(CFbsBitmap* bitmap)
-{
- CFbsBitmap *copy = q_check_ptr(new CFbsBitmap);
- if(!copy)
- return 0;
-
- if (copy->Create(bitmap->SizeInPixels(), bitmap->DisplayMode()) != KErrNone) {
- delete copy;
- copy = 0;
-
- return 0;
- }
-
- CFbsBitmapDevice* bitmapDevice = 0;
- CFbsBitGc *bitmapGc = 0;
- QT_TRAP_THROWING(bitmapDevice = CFbsBitmapDevice::NewL(copy));
- QT_TRAP_THROWING(bitmapGc = CFbsBitGc::NewL());
- bitmapGc->Activate(bitmapDevice);
-
- bitmapGc->BitBlt(TPoint(), bitmap);
-
- delete bitmapGc;
- delete bitmapDevice;
-
- return copy;
-}
-
#ifdef QT_SYMBIAN_SUPPORTS_SGIMAGE
static VGImage sgImageToVGImage(QEglContext *context, const RSgImage &sgImage)
{
@@ -136,7 +109,59 @@ void QVGPixmapData::cleanup()
{
is_null = w = h = 0;
recreate = false;
- source = QImage();
+ source = QVolatileImage();
+}
+
+bool QVGPixmapData::initFromNativeImageHandle(void *handle, const QString &type)
+{
+ if (type == QLatin1String("RSgImage")) {
+ fromNativeType(handle, QPixmapData::SgImage);
+ return true;
+ } else if (type == QLatin1String("CFbsBitmap")) {
+ fromNativeType(handle, QPixmapData::FbsBitmap);
+ return true;
+ }
+ return false;
+}
+
+void QVGPixmapData::createFromNativeImageHandleProvider()
+{
+ void *handle = 0;
+ QString type;
+ nativeImageHandleProvider->get(&handle, &type);
+ if (handle) {
+ if (initFromNativeImageHandle(handle, type)) {
+ nativeImageHandle = handle;
+ nativeImageType = type;
+ } else {
+ qWarning("QVGPixmapData: Unknown native image type '%s'", qPrintable(type));
+ }
+ } else {
+ qWarning("QVGPixmapData: Native handle is null");
+ }
+}
+
+void QVGPixmapData::releaseNativeImageHandle()
+{
+ if (nativeImageHandleProvider && nativeImageHandle) {
+ nativeImageHandleProvider->release(nativeImageHandle, nativeImageType);
+ nativeImageHandle = 0;
+ nativeImageType = QString();
+ }
+}
+
+static inline bool conversionLessFormat(QImage::Format format)
+{
+ switch (format) {
+ case QImage::Format_RGB16: // EColor64K
+ case QImage::Format_RGB32: // EColor16MU
+ case QImage::Format_ARGB32: // EColor16MA
+ case QImage::Format_ARGB32_Premultiplied: // EColor16MAP
+ case QImage::Format_Indexed8: // EGray256, EColor256
+ return true;
+ default:
+ return false;
+ }
}
void QVGPixmapData::fromNativeType(void* pixmap, NativeType type)
@@ -155,55 +180,37 @@ void QVGPixmapData::fromNativeType(void* pixmap, NativeType type)
}
is_null = (w <= 0 || h <= 0);
- source = QImage(); // vgGetImageSubData() some day?
+ source = QVolatileImage(); // readback will be done later, only when needed
recreate = false;
prevSize = QSize(w, h);
- //setSerialNumber(++qt_vg_pixmap_serial);
+ updateSerial();
#endif
- } else if (type == QPixmapData::FbsBitmap) {
- CFbsBitmap *bitmap = reinterpret_cast<CFbsBitmap*>(pixmap);
-
- bool deleteSourceBitmap = false;
-#ifdef Q_SYMBIAN_HAS_EXTENDED_BITMAP_TYPE
-
- // Rasterize extended bitmaps
-
- TUid extendedBitmapType = bitmap->ExtendedBitmapType();
- if (extendedBitmapType != KNullUid) {
- bitmap = createBlitCopy(bitmap);
- deleteSourceBitmap = true;
+ } else if (type == QPixmapData::FbsBitmap && pixmap) {
+ CFbsBitmap *bitmap = reinterpret_cast<CFbsBitmap *>(pixmap);
+ QSize size(bitmap->SizeInPixels().iWidth, bitmap->SizeInPixels().iHeight);
+ resize(size.width(), size.height());
+ source = QVolatileImage(bitmap); // duplicates only, if possible
+ if (source.isNull())
+ return;
+ if (!conversionLessFormat(source.format())) {
+ // Here we may need to copy if the formats do not match.
+ // (e.g. for display modes other than EColor16MAP and EColor16MU)
+ source.beginDataAccess();
+ QImage::Format format = idealFormat(&source.imageRef(), Qt::AutoColor);
+ source.endDataAccess(true);
+ source.ensureFormat(format);
}
-#endif
-
- if (bitmap->IsCompressedInRAM()) {
- bitmap = createBlitCopy(bitmap);
- deleteSourceBitmap = true;
- }
-
- TDisplayMode displayMode = bitmap->DisplayMode();
- QImage::Format format = qt_TDisplayMode2Format(displayMode);
-
- TSize size = bitmap->SizeInPixels();
- int bytesPerLine = bitmap->ScanLineLength(size.iWidth, displayMode);
-
- bitmap->BeginDataAccess();
- uchar *bytes = (uchar*)bitmap->DataAddress();
- QImage img = QImage(bytes, size.iWidth, size.iHeight, bytesPerLine, format);
- img = img.copy();
- bitmap->EndDataAccess();
-
- if(displayMode == EGray2) {
- //Symbian thinks set pixels are white/transparent, Qt thinks they are foreground/solid
- //So invert mono bitmaps so that masks work correctly.
- img.invertPixels();
- } else if(displayMode == EColor16M) {
- img = img.rgbSwapped(); // EColor16M is BGR
- }
-
- fromImage(img, Qt::AutoColor);
-
- if(deleteSourceBitmap)
- delete bitmap;
+ recreate = true;
+ } else if (type == QPixmapData::VolatileImage && pixmap) {
+ QVolatileImage *img = static_cast<QVolatileImage *>(pixmap);
+ resize(img->width(), img->height());
+ source = *img;
+ recreate = true;
+ } else if (type == QPixmapData::NativeImageHandleProvider && pixmap) {
+ destroyImages();
+ nativeImageHandleProvider = static_cast<QNativeImageHandleProvider *>(pixmap);
+ // Cannot defer the retrieval, we need at least the size right away.
+ createFromNativeImageHandleProvider();
}
}
@@ -270,26 +277,13 @@ void* QVGPixmapData::toNativeType(NativeType type)
driver.Close();
return reinterpret_cast<void*>(sgImage.take());
#endif
- } else if (type == QPixmapData::FbsBitmap) {
- CFbsBitmap *bitmap = q_check_ptr(new CFbsBitmap);
-
- if (bitmap) {
- if (bitmap->Create(TSize(source.width(), source.height()),
- EColor16MAP) == KErrNone) {
- const uchar *sptr = const_cast<const QImage&>(source).bits();
- bitmap->BeginDataAccess();
-
- uchar *dptr = (uchar*)bitmap->DataAddress();
- Mem::Copy(dptr, sptr, source.byteCount());
-
- bitmap->EndDataAccess();
- } else {
- delete bitmap;
- bitmap = 0;
- }
+ } else if (type == QPixmapData::FbsBitmap && isValid()) {
+ ensureReadback(true);
+ if (source.isNull()) {
+ source = QVolatileImage(w, h, sourceFormat());
}
-
- return reinterpret_cast<void*>(bitmap);
+ // Just duplicate the bitmap handle, no data copying happens.
+ return source.duplicateNativeImage();
}
return 0;
}
diff --git a/src/openvg/qvgfontglyphcache_p.h b/src/openvg/qvgfontglyphcache_p.h
index 9a105ec..ce12301 100644
--- a/src/openvg/qvgfontglyphcache_p.h
+++ b/src/openvg/qvgfontglyphcache_p.h
@@ -56,7 +56,7 @@
#include <QtCore/qvarlengtharray.h>
#include <QtGui/private/qfontengine_p.h>
-#include <qvg_p.h>
+#include "qvg_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/openvg/qvgimagepool.cpp b/src/openvg/qvgimagepool.cpp
index a2b1c4e..7a7ec78 100644
--- a/src/openvg/qvgimagepool.cpp
+++ b/src/openvg/qvgimagepool.cpp
@@ -175,8 +175,19 @@ bool QVGImagePool::reclaimSpace(VGImageFormat format,
void QVGImagePool::hibernate()
{
- // Nothing to do here at the moment since the pool does not
- // retain VGImage's after they have been released.
+ Q_D(QVGImagePool);
+ QVGPixmapData *pd = d->lruLast;
+ while (pd) {
+ QVGPixmapData *prevLRU = pd->prevLRU;
+ pd->inImagePool = false;
+ pd->inLRU = false;
+ pd->nextLRU = 0;
+ pd->prevLRU = 0;
+ pd->hibernate();
+ pd = prevLRU;
+ }
+ d->lruFirst = 0;
+ d->lruLast = 0;
}
void QVGImagePool::moveToHeadOfLRU(QVGPixmapData *data)
diff --git a/src/openvg/qwindowsurface_vgegl.cpp b/src/openvg/qwindowsurface_vgegl.cpp
index ca80886..866453f 100644
--- a/src/openvg/qwindowsurface_vgegl.cpp
+++ b/src/openvg/qwindowsurface_vgegl.cpp
@@ -768,6 +768,11 @@ bool QVGEGLWindowSurfaceDirect::scroll(QWidget *widget, const QRegion& area, int
context->lazyDoneCurrent();
return true;
}
+#else
+ Q_UNUSED(widget);
+ Q_UNUSED(area);
+ Q_UNUSED(dx);
+ Q_UNUSED(dy);
#endif
return false;
}
diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp
index fc480c2..f367c26 100644
--- a/src/plugins/bearer/symbian/symbianengine.cpp
+++ b/src/plugins/bearer/symbian/symbianengine.cpp
@@ -150,16 +150,15 @@ SymbianEngine::~SymbianEngine()
iConnectionMonitor.CancelNotifications();
iConnectionMonitor.Close();
-
-#ifdef SNAP_FUNCTIONALITY_AVAILABLE
- iCmManager.Close();
-#endif
-
- // CCommsDatabase destructor uses cleanup stack. Since QNetworkConfigurationManager
+
+ // CCommsDatabase destructor and RCmManager.Close() use cleanup stack. Since QNetworkConfigurationManager
// is a global static, but the time we are here, E32Main() has been exited already and
// the thread's default cleanup stack has been deleted. Without this line, a
// 'E32USER-CBase 69' -panic will occur.
CTrapCleanup* cleanup = CTrapCleanup::New();
+#ifdef SNAP_FUNCTIONALITY_AVAILABLE
+ iCmManager.Close();
+#endif
delete ipCommsDB;
delete cleanup;
}
@@ -829,6 +828,7 @@ void SymbianEngine::updateStatesToSnaps()
discovered = true;
}
}
+ snapConfigLocker.unlock();
if (active) {
changeConfigurationStateTo(ptr, QNetworkConfiguration::Active);
} else if (discovered) {
diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
index a70d232..c904c3c 100644
--- a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
+++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
@@ -59,10 +59,16 @@
#include "qmeegographicssystem.h"
#include "qmeegoextensions.h"
+#include <QTimer>
+
bool QMeeGoGraphicsSystem::surfaceWasCreated = false;
QHash <Qt::HANDLE, QPixmap*> QMeeGoGraphicsSystem::liveTexturePixmaps;
+QList<QMeeGoSwitchCallback> QMeeGoGraphicsSystem::switchCallbacks;
+
+QMeeGoGraphicsSystem::SwitchPolicy QMeeGoGraphicsSystem::switchPolicy = QMeeGoGraphicsSystem::AutomaticSwitch;
+
QMeeGoGraphicsSystem::QMeeGoGraphicsSystem()
{
qDebug("Using the meego graphics system");
@@ -74,6 +80,115 @@ QMeeGoGraphicsSystem::~QMeeGoGraphicsSystem()
qt_destroy_gl_share_widget();
}
+class QMeeGoGraphicsSystemSwitchHandler : public QObject
+{
+ Q_OBJECT
+public:
+ QMeeGoGraphicsSystemSwitchHandler();
+
+ void addWidget(QWidget *widget);
+ bool eventFilter(QObject *, QEvent *);
+
+ void handleMapNotify();
+
+private slots:
+ void removeWidget(QObject *object);
+ void switchToRaster();
+ void switchToMeeGo();
+
+private:
+ int visibleWidgets() const;
+
+private:
+ QList<QWidget *> m_widgets;
+};
+
+typedef bool(*QX11FilterFunction)(XEvent *event);
+Q_GUI_EXPORT void qt_installX11EventFilter(QX11FilterFunction func);
+
+static bool x11EventFilter(XEvent *event);
+
+QMeeGoGraphicsSystemSwitchHandler::QMeeGoGraphicsSystemSwitchHandler()
+{
+ qt_installX11EventFilter(x11EventFilter);
+}
+
+void QMeeGoGraphicsSystemSwitchHandler::addWidget(QWidget *widget)
+{
+ if (widget != qt_gl_share_widget() && !m_widgets.contains(widget)) {
+ widget->installEventFilter(this);
+ connect(widget, SIGNAL(destroyed(QObject *)), this, SLOT(removeWidget(QObject *)));
+ m_widgets << widget;
+ }
+}
+
+void QMeeGoGraphicsSystemSwitchHandler::handleMapNotify()
+{
+ if (m_widgets.isEmpty() && QMeeGoGraphicsSystem::switchPolicy == QMeeGoGraphicsSystem::AutomaticSwitch)
+ QTimer::singleShot(0, this, SLOT(switchToMeeGo()));
+}
+
+void QMeeGoGraphicsSystemSwitchHandler::removeWidget(QObject *object)
+{
+ m_widgets.removeOne(static_cast<QWidget *>(object));
+ if (m_widgets.isEmpty() && QMeeGoGraphicsSystem::switchPolicy == QMeeGoGraphicsSystem::AutomaticSwitch)
+ QTimer::singleShot(0, this, SLOT(switchToRaster()));
+}
+
+void QMeeGoGraphicsSystemSwitchHandler::switchToRaster()
+{
+ QMeeGoGraphicsSystem::switchToRaster();
+}
+
+void QMeeGoGraphicsSystemSwitchHandler::switchToMeeGo()
+{
+ QMeeGoGraphicsSystem::switchToMeeGo();
+}
+
+int QMeeGoGraphicsSystemSwitchHandler::visibleWidgets() const
+{
+ int count = 0;
+ for (int i = 0; i < m_widgets.size(); ++i)
+ count += m_widgets.at(i)->isVisible() && !(m_widgets.at(i)->windowState() & Qt::WindowMinimized);
+ return count;
+}
+
+bool QMeeGoGraphicsSystemSwitchHandler::eventFilter(QObject *object, QEvent *event)
+{
+ if (event->type() == QEvent::WindowStateChange
+ && QMeeGoGraphicsSystem::switchPolicy == QMeeGoGraphicsSystem::AutomaticSwitch)
+ {
+ QWindowStateChangeEvent *change = static_cast<QWindowStateChangeEvent *>(event);
+ QWidget *widget = static_cast<QWidget *>(object);
+
+ Qt::WindowStates current = widget->windowState();
+ Qt::WindowStates old = change->oldState();
+
+ // did minimized flag change?
+ if ((current ^ old) & Qt::WindowMinimized) {
+ if (current & Qt::WindowMinimized) {
+ if (visibleWidgets() == 0)
+ QMeeGoGraphicsSystem::switchToRaster();
+ } else {
+ if (visibleWidgets() == 1)
+ QMeeGoGraphicsSystem::switchToMeeGo();
+ }
+ }
+ }
+
+ // resume processing of event
+ return false;
+}
+
+Q_GLOBAL_STATIC(QMeeGoGraphicsSystemSwitchHandler, switch_handler)
+
+bool x11EventFilter(XEvent *event)
+{
+ if (event->type == MapNotify)
+ switch_handler()->handleMapNotify();
+ return false;
+}
+
QWindowSurface* QMeeGoGraphicsSystem::createWindowSurface(QWidget *widget) const
{
QGLWidget *shareWidget = qt_gl_share_widget();
@@ -83,6 +198,9 @@ QWindowSurface* QMeeGoGraphicsSystem::createWindowSurface(QWidget *widget) const
QGLShareContextScope ctx(shareWidget->context());
+ if (QApplicationPrivate::instance()->graphics_system_name == QLatin1String("runtime"))
+ switch_handler()->addWidget(widget);
+
QMeeGoGraphicsSystem::surfaceWasCreated = true;
QWindowSurface *surface = new QGLWindowSurface(widget);
return surface;
@@ -171,7 +289,7 @@ QPixmapData *QMeeGoGraphicsSystem::pixmapDataFromEGLSharedImage(Qt::HANDLE handl
return QMeeGoGraphicsSystem::wrapPixmapData(pmd);
} else {
QRasterPixmapData *pmd = new QRasterPixmapData(QPixmapData::PixmapType);
- pmd->fromImage(softImage, Qt::NoOpaqueDetection);
+ pmd->fromImage(softImage, Qt::NoFormatConversion);
// Make sure that the image was not converted in any way
if (pmd->buffer()->data_ptr()->data !=
@@ -203,18 +321,7 @@ QPixmapData *QMeeGoGraphicsSystem::pixmapDataWithGLTexture(int w, int h)
bool QMeeGoGraphicsSystem::meeGoRunning()
{
- if (! QApplicationPrivate::instance()) {
- qWarning("Application not running just yet... hard to know what system running!");
- return false;
- }
-
- QString name = QApplicationPrivate::instance()->graphics_system_name;
- if (name == "runtime") {
- QRuntimeGraphicsSystem *rsystem = (QRuntimeGraphicsSystem *) QApplicationPrivate::instance()->graphics_system;
- name = rsystem->graphicsSystemName();
- }
-
- return (name == "meego");
+ return runningGraphicsSystemName() == "meego";
}
QPixmapData* QMeeGoGraphicsSystem::pixmapDataWithNewLiveTexture(int w, int h, QImage::Format format)
@@ -259,6 +366,69 @@ void QMeeGoGraphicsSystem::destroyFenceSync(void *fenceSync)
QMeeGoExtensions::eglDestroySyncKHR(QEgl::display(), fenceSync);
}
+QString QMeeGoGraphicsSystem::runningGraphicsSystemName()
+{
+ if (!QApplicationPrivate::instance()) {
+ qWarning("Querying graphics system but application not running yet!");
+ return QString();
+ }
+
+ QString name = QApplicationPrivate::instance()->graphics_system_name;
+ if (name == QLatin1String("runtime")) {
+ QRuntimeGraphicsSystem *rsystem = (QRuntimeGraphicsSystem *) QApplicationPrivate::instance()->graphics_system;
+ name = rsystem->graphicsSystemName();
+ }
+
+ return name;
+}
+
+void QMeeGoGraphicsSystem::switchToMeeGo()
+{
+ if (switchPolicy == NoSwitch || meeGoRunning())
+ return;
+
+ if (QApplicationPrivate::instance()->graphics_system_name != QLatin1String("runtime"))
+ qWarning("Can't switch to meego - switching only supported with 'runtime' graphics system.");
+ else {
+ triggerSwitchCallbacks(0, "meego");
+
+ QApplication *app = static_cast<QApplication *>(QCoreApplication::instance());
+ app->setGraphicsSystem(QLatin1String("meego"));
+
+ triggerSwitchCallbacks(1, "meego");
+ }
+}
+
+void QMeeGoGraphicsSystem::switchToRaster()
+{
+ if (switchPolicy == NoSwitch || runningGraphicsSystemName() == QLatin1String("raster"))
+ return;
+
+ if (QApplicationPrivate::instance()->graphics_system_name != QLatin1String("runtime"))
+ qWarning("Can't switch to raster - switching only supported with 'runtime' graphics system.");
+ else {
+ triggerSwitchCallbacks(0, "raster");
+
+ QApplication *app = static_cast<QApplication *>(QCoreApplication::instance());
+ app->setGraphicsSystem(QLatin1String("raster"));
+
+ QMeeGoLivePixmapData::invalidateSurfaces();
+
+ triggerSwitchCallbacks(1, "raster");
+ }
+}
+
+void QMeeGoGraphicsSystem::registerSwitchCallback(QMeeGoSwitchCallback callback)
+{
+ switchCallbacks << callback;
+}
+
+void QMeeGoGraphicsSystem::triggerSwitchCallbacks(int type, const char *name)
+{
+ for (int i = 0; i < switchCallbacks.size(); ++i)
+ switchCallbacks.at(i)(type, name);
+}
+
/* C API */
int qt_meego_image_to_egl_shared_image(const QImage &image)
@@ -335,3 +505,30 @@ void qt_meego_destroy_fence_sync(void* fs)
{
return QMeeGoGraphicsSystem::destroyFenceSync(fs);
}
+
+void qt_meego_invalidate_live_surfaces(void)
+{
+ return QMeeGoLivePixmapData::invalidateSurfaces();
+}
+
+void qt_meego_switch_to_raster(void)
+{
+ QMeeGoGraphicsSystem::switchToRaster();
+}
+
+void qt_meego_switch_to_meego(void)
+{
+ QMeeGoGraphicsSystem::switchToMeeGo();
+}
+
+void qt_meego_register_switch_callback(QMeeGoSwitchCallback callback)
+{
+ QMeeGoGraphicsSystem::registerSwitchCallback(callback);
+}
+
+void qt_meego_set_switch_policy(int policy)
+{
+ QMeeGoGraphicsSystem::switchPolicy = QMeeGoGraphicsSystem::SwitchPolicy(policy);
+}
+
+#include "qmeegographicssystem.moc"
diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.h b/src/plugins/graphicssystems/meego/qmeegographicssystem.h
index 323ce1f..3528425 100644
--- a/src/plugins/graphicssystems/meego/qmeegographicssystem.h
+++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.h
@@ -47,9 +47,13 @@
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
+extern "C" typedef void (*QMeeGoSwitchCallback)(int type, const char *name);
+
class QMeeGoGraphicsSystem : public QGraphicsSystem
{
public:
+ enum SwitchPolicy { AutomaticSwitch, ManualSwitch, NoSwitch };
+
QMeeGoGraphicsSystem();
~QMeeGoGraphicsSystem();
@@ -76,13 +80,23 @@ public:
static void* createFenceSync();
static void destroyFenceSync(void* fenceSync);
+ static void switchToRaster();
+ static void switchToMeeGo();
+ static QString runningGraphicsSystemName();
+
+ static void registerSwitchCallback(QMeeGoSwitchCallback callback);
+
+ static SwitchPolicy switchPolicy;
+
private:
static bool meeGoRunning();
static EGLSurface getSurfaceForLiveTexturePixmap(QPixmap *pixmap);
static void destroySurfaceForLiveTexturePixmap(QPixmapData* pmd);
+ static void triggerSwitchCallbacks(int type, const char *name);
static bool surfaceWasCreated;
- static QHash <Qt::HANDLE, QPixmap*> liveTexturePixmaps;
+ static QHash<Qt::HANDLE, QPixmap*> liveTexturePixmaps;
+ static QList<QMeeGoSwitchCallback> switchCallbacks;
};
/* C api */
@@ -95,7 +109,7 @@ extern "C" {
Q_DECL_EXPORT bool qt_meego_destroy_egl_shared_image(Qt::HANDLE handle);
Q_DECL_EXPORT void qt_meego_set_surface_fixed_size(int width, int height);
Q_DECL_EXPORT void qt_meego_set_surface_scaling(int x, int y, int width, int height);
- Q_DECL_EXPORT void qt_meego_set_translucent(bool translucent);
+ Q_DECL_EXPORT void qt_meego_set_translucent(bool translucent);
Q_DECL_EXPORT QPixmapData* qt_meego_pixmapdata_with_new_live_texture(int w, int h, QImage::Format format);
Q_DECL_EXPORT QPixmapData* qt_meego_pixmapdata_from_live_texture_handle(Qt::HANDLE handle);
Q_DECL_EXPORT QImage* qt_meego_live_texture_lock(QPixmap *pixmap, void *fenceSync);
@@ -103,6 +117,11 @@ extern "C" {
Q_DECL_EXPORT Qt::HANDLE qt_meego_live_texture_get_handle(QPixmap *pixmap);
Q_DECL_EXPORT void* qt_meego_create_fence_sync(void);
Q_DECL_EXPORT void qt_meego_destroy_fence_sync(void* fs);
+ Q_DECL_EXPORT void qt_meego_invalidate_live_surfaces(void);
+ Q_DECL_EXPORT void qt_meego_switch_to_raster(void);
+ Q_DECL_EXPORT void qt_meego_switch_to_meego(void);
+ Q_DECL_EXPORT void qt_meego_register_switch_callback(QMeeGoSwitchCallback callback);
+ Q_DECL_EXPORT void qt_meego_set_switch_policy(int policy);
}
#endif
diff --git a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp
index e4f1900..0970b89 100644
--- a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp
+++ b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp
@@ -49,6 +49,8 @@
#include <private/qpixmap_x11_p.h>
#include <stdio.h>
+static QMeeGoLivePixmapDataList all_live_pixmaps;
+
static EGLint lock_attribs[] = {
EGL_MAP_PRESERVE_PIXELS_KHR, EGL_TRUE,
EGL_LOCK_USAGE_HINT_KHR, EGL_READ_SURFACE_BIT_KHR | EGL_WRITE_SURFACE_BIT_KHR,
@@ -118,21 +120,29 @@ QMeeGoLivePixmapData::QMeeGoLivePixmapData(int w, int h, QImage::Format format)
backingX11Pixmap = new QPixmap(pmd);
initializeThroughEGLImage();
+
+ pos = all_live_pixmaps.insert(all_live_pixmaps.begin(), this);
}
QMeeGoLivePixmapData::QMeeGoLivePixmapData(Qt::HANDLE h) : QGLPixmapData(QPixmapData::PixmapType)
{
backingX11Pixmap = new QPixmap(QPixmap::fromX11Pixmap(h));
initializeThroughEGLImage();
+
+ pos = all_live_pixmaps.insert(all_live_pixmaps.begin(), this);
}
QMeeGoLivePixmapData::~QMeeGoLivePixmapData()
{
delete backingX11Pixmap;
+ all_live_pixmaps.erase(pos);
}
void QMeeGoLivePixmapData::initializeThroughEGLImage()
{
+ if (texture()->id != 0)
+ return;
+
QGLShareContextScope ctx(qt_gl_share_widget()->context());
QMeeGoExtensions::ensureInitialized();
@@ -209,7 +219,7 @@ QImage* QMeeGoLivePixmapData::lock(EGLSyncKHR fenceSync)
return &lockedImage;
}
- lockedImage = QImage((uchar *) data, width(), height(), format);
+ lockedImage = QImage((uchar *) data, width(), height(), pitch, format);
return &lockedImage;
}
@@ -245,6 +255,8 @@ bool QMeeGoLivePixmapData::scroll(int dx, int dy, const QRect &rect)
EGLSurface QMeeGoLivePixmapData::getSurfaceForBackingPixmap()
{
+ initializeThroughEGLImage();
+
// This code is a crative remix of the stuff that can be found in the
// Qt's TFP implementation in /src/opengl/qgl_x11egl.cpp ::bindiTextureFromNativePixmap
QX11PixmapData *pixmapData = static_cast<QX11PixmapData*>(backingX11Pixmap->data_ptr().data());
@@ -290,3 +302,12 @@ void QMeeGoLivePixmapData::destroySurfaceForPixmapData(QPixmapData* pmd)
pixmapData->gl_surface = 0;
}
}
+
+void QMeeGoLivePixmapData::invalidateSurfaces()
+{
+ foreach (QMeeGoLivePixmapData *data, all_live_pixmaps) {
+ QX11PixmapData *pixmapData = static_cast<QX11PixmapData*>(data->backingX11Pixmap->data_ptr().data());
+ *data->texture() = QGLTexture();
+ pixmapData->gl_surface = 0;
+ }
+}
diff --git a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h
index 484028e..616b33c 100644
--- a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h
+++ b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h
@@ -42,9 +42,13 @@
#ifndef MLIVEPIXMAPDATA_H
#define MLIVEPIXMAPDATA_H
+#include <QLinkedList>
#include <private/qpixmapdata_gl_p.h>
#include "qmeegoextensions.h"
+class QMeeGoLivePixmapData;
+typedef QLinkedList<QMeeGoLivePixmapData *> QMeeGoLivePixmapDataList;
+
class QMeeGoLivePixmapData : public QGLPixmapData
{
public:
@@ -66,6 +70,9 @@ public:
QPixmap *backingX11Pixmap;
QImage lockedImage;
+ QMeeGoLivePixmapDataList::Iterator pos;
+
+ static void invalidateSurfaces();
};
#endif
diff --git a/src/plugins/graphicssystems/openvg/qgraphicssystem_vg.cpp b/src/plugins/graphicssystems/openvg/qgraphicssystem_vg.cpp
index 0c107b5..4b4f677 100644
--- a/src/plugins/graphicssystems/openvg/qgraphicssystem_vg.cpp
+++ b/src/plugins/graphicssystems/openvg/qgraphicssystem_vg.cpp
@@ -42,7 +42,8 @@
#include "qgraphicssystem_vg_p.h"
#include <QtOpenVG/private/qpixmapdata_vg_p.h>
#include <QtOpenVG/private/qwindowsurface_vg_p.h>
-#if defined(Q_OS_SYMBIAN) && !defined(Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE)
+#include <QtOpenVG/private/qvgimagepool_p.h>
+#if defined(Q_OS_SYMBIAN)
#include <QtGui/private/qwidget_p.h>
#endif
#include <QtGui/private/qapplication_p.h>
@@ -69,12 +70,19 @@ QPixmapData *QVGGraphicsSystem::createPixmapData(QPixmapData::PixelType type) co
QWindowSurface *QVGGraphicsSystem::createWindowSurface(QWidget *widget) const
{
-#if defined(Q_OS_SYMBIAN) && !defined(Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE)
- QWidgetPrivate *d = qt_widget_private(widget);
- if (!d->isOpaque && widget->testAttribute(Qt::WA_TranslucentBackground))
- return d->createDefaultWindowSurface_sys();
+#if defined(Q_OS_SYMBIAN)
+ if (!QApplicationPrivate::instance()->useTranslucentEGLSurfaces) {
+ QWidgetPrivate *d = qt_widget_private(widget);
+ if (!d->isOpaque && widget->testAttribute(Qt::WA_TranslucentBackground))
+ return d->createDefaultWindowSurface_sys();
+ }
#endif
return new QVGWindowSurface(widget);
}
+void QVGGraphicsSystem::releaseCachedResources()
+{
+ QVGImagePool::instance()->hibernate();
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/graphicssystems/openvg/qgraphicssystem_vg_p.h b/src/plugins/graphicssystems/openvg/qgraphicssystem_vg_p.h
index d1bce28..9c9b3e2 100644
--- a/src/plugins/graphicssystems/openvg/qgraphicssystem_vg_p.h
+++ b/src/plugins/graphicssystems/openvg/qgraphicssystem_vg_p.h
@@ -64,6 +64,8 @@ public:
QPixmapData *createPixmapData(QPixmapData::PixelType type) const;
QWindowSurface *createWindowSurface(QWidget *widget) const;
+
+ void releaseCachedResources();
};
QT_END_NAMESPACE
diff --git a/src/plugins/qpluginbase.pri b/src/plugins/qpluginbase.pri
index 7cbffe0..6c33e92 100644
--- a/src/plugins/qpluginbase.pri
+++ b/src/plugins/qpluginbase.pri
@@ -1,6 +1,6 @@
TEMPLATE = lib
isEmpty(QT_MAJOR_VERSION) {
- VERSION=4.7.2
+ VERSION=4.7.4
} else {
VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
}
diff --git a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri
index 494c64c..b7a87f3 100644
--- a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri
+++ b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri
@@ -1,6 +1,12 @@
# We just want to include the sqlite3 binaries for Symbian for platforms that do not have them.
!symbian-abld:!symbian-sbsv2 {
!symbian_no_export_sqlite:!exists($${EPOCROOT}epoc32/release/armv5/lib/sqlite3.dso) {
+ contains(QMAKE_HOST.os,Windows) {
+ # Trick on Windows to do a touch on the file, since copy keeps the timestamp.
+ copyWithTouch = copy /y /b NUL+
+ } else {
+ copyWithTouch = "$$QMAKE_COPY "
+ }
symbian_sqlite3_zip_file = $$PWD/SQLite3_v9.2.zip
# The QMAKE_COPY section is to update timestamp on the file.
@@ -10,7 +16,7 @@
symbian_sqlite3_header.CONFIG = combine no_link
symbian_sqlite3_header.dependency_type = TYPE_C
symbian_sqlite3_header.commands = $$QMAKE_UNZIP -j ${QMAKE_FILE_NAME} epoc32/include/stdapis/${QMAKE_FILE_OUT_BASE}.h \
- && $$QMAKE_COPY ${QMAKE_FILE_OUT_BASE}.h ${QMAKE_FILE_OUT}.tmp \
+ && $${copyWithTouch}${QMAKE_FILE_OUT_BASE}.h ${QMAKE_FILE_OUT}.tmp \
&& $$QMAKE_DEL_FILE ${QMAKE_FILE_OUT_BASE}.h \
&& $$QMAKE_MOVE ${QMAKE_FILE_OUT}.tmp ${QMAKE_FILE_OUT}
silent:symbian_sqlite3_header.commands = @echo unzipping $@ && $$symbian_sqlite3_header.commands
@@ -22,12 +28,18 @@
!isEmpty(OBJECTS_DIR):symbian_sqlite3_dso.output = $$OBJECTS_DIR/$$symbian_sqlite3_dso.output
symbian_sqlite3_dso.CONFIG = combine no_link target_predeps
symbian_sqlite3_dso.commands = $$QMAKE_UNZIP -j ${QMAKE_FILE_NAME} epoc32/release/armv5/lib/${QMAKE_FILE_OUT_BASE}.dso \
- && $$QMAKE_COPY ${QMAKE_FILE_OUT_BASE}.dso ${QMAKE_FILE_OUT}.tmp \
+ && $${copyWithTouch}${QMAKE_FILE_OUT_BASE}.dso ${QMAKE_FILE_OUT}.tmp \
&& $$QMAKE_DEL_FILE ${QMAKE_FILE_OUT_BASE}.dso \
&& $$QMAKE_MOVE ${QMAKE_FILE_OUT}.tmp ${QMAKE_FILE_OUT}
silent:symbian_sqlite3_dso.commands = @echo unzipping $@ && $$symbian_sqlite3_dso.commands
QMAKE_EXTRA_COMPILERS += symbian_sqlite3_dso
+ # Workaround for the fact that make doesn't understand that sqlite3.dso
+ # is the same as $OBJECTS_DIR/sqlite3.dso
+ symbian_sqlite3_dso_standalone.target = sqlite3.dso
+ symbian_sqlite3_dso_standalone.depends = $$symbian_sqlite3_dso.output
+ QMAKE_EXTRA_TARGETS += symbian_sqlite3_dso_standalone
+
symbian_sqlite3_ver_dso.input = symbian_sqlite3_zip_file
symbian_sqlite3_ver_dso.output = sqlite3{00060003}.dso
!isEmpty(OBJECTS_DIR):symbian_sqlite3_ver_dso.output = $$OBJECTS_DIR/$$symbian_sqlite3_ver_dso.output
diff --git a/src/qbase.pri b/src/qbase.pri
index 75da3dc..5d78336 100644
--- a/src/qbase.pri
+++ b/src/qbase.pri
@@ -4,7 +4,7 @@ INCLUDEPATH *= $$QMAKE_INCDIR_QT/$$TARGET #just for today to have some compat
isEmpty(QT_ARCH):!isEmpty(ARCH):QT_ARCH=$$ARCH #another compat that will rot for change #215700
TEMPLATE = lib
isEmpty(QT_MAJOR_VERSION) {
- VERSION=4.7.2
+ VERSION=4.7.4
} else {
VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
}
diff --git a/src/s60installs/bwins/QtDeclarativeu.def b/src/s60installs/bwins/QtDeclarativeu.def
index 7d0a83e..5490f0d 100644
--- a/src/s60installs/bwins/QtDeclarativeu.def
+++ b/src/s60installs/bwins/QtDeclarativeu.def
@@ -3,7 +3,7 @@ EXPORTS
?setStored@QMetaPropertyBuilder@@QAEX_N@Z @ 2 NONAME ABSENT ; void QMetaPropertyBuilder::setStored(bool)
?trUtf8@QDeclarativeExpression@@SA?AVQString@@PBD0H@Z @ 3 NONAME ; class QString QDeclarativeExpression::trUtf8(char const *, char const *, int)
?qt_metacast@QDeclarativeComponent@@UAEPAXPBD@Z @ 4 NONAME ; void * QDeclarativeComponent::qt_metacast(char const *)
- ?name@QDeclarativeDebugService@@QBE?AVQString@@XZ @ 5 NONAME ABSENT ; class QString QDeclarativeDebugService::name(void) const
+ ?name@QDeclarativeDebugService@@QBE?AVQString@@XZ @ 5 NONAME ; class QString QDeclarativeDebugService::name(void) const
?debugId@QDeclarativeDebugObjectReference@@QBEHXZ @ 6 NONAME ABSENT ; int QDeclarativeDebugObjectReference::debugId(void) const
?addPluginPath@QDeclarativeEngine@@QAEXABVQString@@@Z @ 7 NONAME ; void QDeclarativeEngine::addPluginPath(class QString const &)
?name@QMetaPropertyBuilder@@QBE?AVQByteArray@@XZ @ 8 NONAME ABSENT ; class QByteArray QMetaPropertyBuilder::name(void) const
@@ -11,7 +11,7 @@ EXPORTS
?propertyOffset@QDeclarativeOpenMetaObjectType@@QBEHXZ @ 10 NONAME ABSENT ; int QDeclarativeOpenMetaObjectType::propertyOffset(void) const
??0QDeclarativeText@@QAE@PAVQDeclarativeItem@@@Z @ 11 NONAME ABSENT ; QDeclarativeText::QDeclarativeText(class QDeclarativeItem *)
?propertyTypeName@QDeclarativeProperty@@QBEPBDXZ @ 12 NONAME ; char const * QDeclarativeProperty::propertyTypeName(void) const
- ?getStaticMetaObject@QDeclarativeDebugService@@SAABUQMetaObject@@XZ @ 13 NONAME ABSENT ; struct QMetaObject const & QDeclarativeDebugService::getStaticMetaObject(void)
+ ?getStaticMetaObject@QDeclarativeDebugService@@SAABUQMetaObject@@XZ @ 13 NONAME ; struct QMetaObject const & QDeclarativeDebugService::getStaticMetaObject(void)
?setLeft@QDeclarativeAnchors@@QAEXABVQDeclarativeAnchorLine@@@Z @ 14 NONAME ABSENT ; void QDeclarativeAnchors::setLeft(class QDeclarativeAnchorLine const &)
?qt_metacall@QDeclarativeExpression@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 15 NONAME ; int QDeclarativeExpression::qt_metacall(enum QMetaObject::Call, int, void * *)
?staticMetaObject@QDeclarativePen@@2UQMetaObject@@B @ 16 NONAME ABSENT ; struct QMetaObject const QDeclarativePen::staticMetaObject
@@ -145,7 +145,7 @@ EXPORTS
?isConnected@QDeclarativeDebugClient@@QBE_NXZ @ 144 NONAME ABSENT ; bool QDeclarativeDebugClient::isConnected(void) const
?enabled@QDeclarativeBinding@@QBE_NXZ @ 145 NONAME ABSENT ; bool QDeclarativeBinding::enabled(void) const
?setSource@QDeclarativeView@@QAEXABVQUrl@@@Z @ 146 NONAME ; void QDeclarativeView::setSource(class QUrl const &)
- ??_EQDeclarativeDebugService@@UAE@I@Z @ 147 NONAME ABSENT ; QDeclarativeDebugService::~QDeclarativeDebugService(unsigned int)
+ ??_EQDeclarativeDebugService@@UAE@I@Z @ 147 NONAME ; QDeclarativeDebugService::~QDeclarativeDebugService(unsigned int)
??0QDeclarativeDomDynamicProperty@@QAE@ABV0@@Z @ 148 NONAME ABSENT ; QDeclarativeDomDynamicProperty::QDeclarativeDomDynamicProperty(class QDeclarativeDomDynamicProperty const &)
?className@QDeclarativeDebugObjectReference@@QBE?AVQString@@XZ @ 149 NONAME ABSENT ; class QString QDeclarativeDebugObjectReference::className(void) const
?indexOfSlot@QMetaObjectBuilder@@QAEHABVQByteArray@@@Z @ 150 NONAME ABSENT ; int QMetaObjectBuilder::indexOfSlot(class QByteArray const &)
@@ -294,7 +294,7 @@ EXPORTS
?attachedPropertiesType@QDeclarativeType@@QBEPBUQMetaObject@@XZ @ 293 NONAME ABSENT ; struct QMetaObject const * QDeclarativeType::attachedPropertiesType(void) const
?setName@QDeclarativeState@@QAEXABVQString@@@Z @ 294 NONAME ; void QDeclarativeState::setName(class QString const &)
?setReversed@QDeclarativeTransition@@QAEX_N@Z @ 295 NONAME ; void QDeclarativeTransition::setReversed(bool)
- ?idForObject@QDeclarativeDebugService@@SAHPAVQObject@@@Z @ 296 NONAME ABSENT ; int QDeclarativeDebugService::idForObject(class QObject *)
+ ?idForObject@QDeclarativeDebugService@@SAHPAVQObject@@@Z @ 296 NONAME ; int QDeclarativeDebugService::idForObject(class QObject *)
?qt_metacall@QDeclarativeDebugWatch@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 297 NONAME ABSENT ; int QDeclarativeDebugWatch::qt_metacall(enum QMetaObject::Call, int, void * *)
?fromState@QDeclarativeTransition@@QBE?AVQString@@XZ @ 298 NONAME ; class QString QDeclarativeTransition::fromState(void) const
??1QDeclarativeExpression@@UAE@XZ @ 299 NONAME ; QDeclarativeExpression::~QDeclarativeExpression(void)
@@ -332,7 +332,7 @@ EXPORTS
??0QDeclarativeCustomParserNode@@QAE@ABV0@@Z @ 331 NONAME ; QDeclarativeCustomParserNode::QDeclarativeCustomParserNode(class QDeclarativeCustomParserNode const &)
??1QDeclarativeImageProvider@@UAE@XZ @ 332 NONAME ; QDeclarativeImageProvider::~QDeclarativeImageProvider(void)
?sync@QDeclarativeListModel@@QAEXXZ @ 333 NONAME ABSENT ; void QDeclarativeListModel::sync(void)
- ?objectForId@QDeclarativeDebugService@@SAPAVQObject@@H@Z @ 334 NONAME ABSENT ; class QObject * QDeclarativeDebugService::objectForId(int)
+ ?objectForId@QDeclarativeDebugService@@SAPAVQObject@@H@Z @ 334 NONAME ; class QObject * QDeclarativeDebugService::objectForId(int)
?hasFocus@QDeclarativeItem@@QBE_NXZ @ 335 NONAME ; bool QDeclarativeItem::hasFocus(void) const
??1QDeclarativeExtensionPlugin@@UAE@XZ @ 336 NONAME ; QDeclarativeExtensionPlugin::~QDeclarativeExtensionPlugin(void)
?qt_metacall@QDeclarativeBehavior@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 337 NONAME ABSENT ; int QDeclarativeBehavior::qt_metacall(enum QMetaObject::Call, int, void * *)
@@ -482,7 +482,7 @@ EXPORTS
?pluginPathList@QDeclarativeEngine@@QBE?AVQStringList@@XZ @ 481 NONAME ; class QStringList QDeclarativeEngine::pluginPathList(void) const
?parentContext@QDeclarativeContext@@QBEPAV1@XZ @ 482 NONAME ; class QDeclarativeContext * QDeclarativeContext::parentContext(void) const
?leftMarginChanged@QDeclarativeAnchors@@IAEXXZ @ 483 NONAME ABSENT ; void QDeclarativeAnchors::leftMarginChanged(void)
- ?staticMetaObject@QDeclarativeDebugService@@2UQMetaObject@@B @ 484 NONAME ABSENT ; struct QMetaObject const QDeclarativeDebugService::staticMetaObject
+ ?staticMetaObject@QDeclarativeDebugService@@2UQMetaObject@@B @ 484 NONAME ; struct QMetaObject const QDeclarativeDebugService::staticMetaObject
?topMargin@QDeclarativeAnchors@@QBEMXZ @ 485 NONAME ABSENT ; float QDeclarativeAnchors::topMargin(void) const
??0QDeclarativeDebugExpressionQuery@@AAE@PAVQObject@@@Z @ 486 NONAME ABSENT ; QDeclarativeDebugExpressionQuery::QDeclarativeDebugExpressionQuery(class QObject *)
??0QPacket@@IAE@ABVQByteArray@@@Z @ 487 NONAME ; QPacket::QPacket(class QByteArray const &)
@@ -559,7 +559,7 @@ EXPORTS
?metaObject@QDeclarativeEngine@@UBEPBUQMetaObject@@XZ @ 558 NONAME ; struct QMetaObject const * QDeclarativeEngine::metaObject(void) const
??_EQDeclarativeDebugContextReference@@QAE@I@Z @ 559 NONAME ABSENT ; QDeclarativeDebugContextReference::~QDeclarativeDebugContextReference(unsigned int)
?propertyWrite@QDeclarativeOpenMetaObject@@MAEXH@Z @ 560 NONAME ABSENT ; void QDeclarativeOpenMetaObject::propertyWrite(int)
- ?qt_metacall@QDeclarativeDebugService@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 561 NONAME ABSENT ; int QDeclarativeDebugService::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?qt_metacall@QDeclarativeDebugService@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 561 NONAME ; int QDeclarativeDebugService::qt_metacall(enum QMetaObject::Call, int, void * *)
?setVerticalCenterOffset@QDeclarativeAnchors@@QAEXM@Z @ 562 NONAME ABSENT ; void QDeclarativeAnchors::setVerticalCenterOffset(float)
??1QDeclarativeDebugWatch@@UAE@XZ @ 563 NONAME ABSENT ; QDeclarativeDebugWatch::~QDeclarativeDebugWatch(void)
??1QPacketAutoSend@@UAE@XZ @ 564 NONAME ABSENT ; QPacketAutoSend::~QPacketAutoSend(void)
@@ -641,7 +641,7 @@ EXPORTS
?d_func@QDeclarativeItem@@AAEPAVQDeclarativeItemPrivate@@XZ @ 640 NONAME ; class QDeclarativeItemPrivate * QDeclarativeItem::d_func(void)
?binding@QDeclarativeDomValueBinding@@QBE?AVQString@@XZ @ 641 NONAME ABSENT ; class QString QDeclarativeDomValueBinding::binding(void) const
?updateAutoState@QDeclarativeStateGroup@@AAE_NXZ @ 642 NONAME ; bool QDeclarativeStateGroup::updateAutoState(void)
- ?tr@QDeclarativeDebugService@@SA?AVQString@@PBD0@Z @ 643 NONAME ABSENT ; class QString QDeclarativeDebugService::tr(char const *, char const *)
+ ?tr@QDeclarativeDebugService@@SA?AVQString@@PBD0@Z @ 643 NONAME ; class QString QDeclarativeDebugService::tr(char const *, char const *)
?tr@QDeclarativeComponent@@SA?AVQString@@PBD0H@Z @ 644 NONAME ; class QString QDeclarativeComponent::tr(char const *, char const *, int)
??1QDeclarativeProperty@@QAE@XZ @ 645 NONAME ; QDeclarativeProperty::~QDeclarativeProperty(void)
?fontChanged@QDeclarativeText@@IAEXABVQFont@@@Z @ 646 NONAME ABSENT ; void QDeclarativeText::fontChanged(class QFont const &)
@@ -667,14 +667,14 @@ EXPORTS
?getStaticMetaObject@QDeclarativeListModel@@SAABUQMetaObject@@XZ @ 666 NONAME ABSENT ; struct QMetaObject const & QDeclarativeListModel::getStaticMetaObject(void)
?setStdCppSet@QMetaPropertyBuilder@@QAEX_N@Z @ 667 NONAME ABSENT ; void QMetaPropertyBuilder::setStdCppSet(bool)
??0QDeclarativeItemPrivate@@QAE@XZ @ 668 NONAME ; QDeclarativeItemPrivate::QDeclarativeItemPrivate(void)
- ??0QDeclarativeDebugService@@QAE@ABVQString@@PAVQObject@@@Z @ 669 NONAME ABSENT ; QDeclarativeDebugService::QDeclarativeDebugService(class QString const &, class QObject *)
+ ??0QDeclarativeDebugService@@QAE@ABVQString@@PAVQObject@@@Z @ 669 NONAME ; QDeclarativeDebugService::QDeclarativeDebugService(class QString const &, class QObject *)
?load@QDeclarativePixmap@@QAEXPAVQDeclarativeEngine@@ABVQUrl@@_N@Z @ 670 NONAME ABSENT ; void QDeclarativePixmap::load(class QDeclarativeEngine *, class QUrl const &, bool)
??_EQPacketAutoSend@@UAE@I@Z @ 671 NONAME ABSENT ; QPacketAutoSend::~QPacketAutoSend(unsigned int)
?saveValueType@QDeclarativePropertyPrivate@@SA?AVQByteArray@@PBUQMetaObject@@H0H@Z @ 672 NONAME ABSENT ; class QByteArray QDeclarativePropertyPrivate::saveValueType(struct QMetaObject const *, int, struct QMetaObject const *, int)
?resetHeight@QDeclarativeItem@@QAEXXZ @ 673 NONAME ; void QDeclarativeItem::resetHeight(void)
?setVAlign@QDeclarativeText@@QAEXW4VAlignment@1@@Z @ 674 NONAME ABSENT ; void QDeclarativeText::setVAlign(enum QDeclarativeText::VAlignment)
- ??1QDeclarativeDebugService@@UAE@XZ @ 675 NONAME ABSENT ; QDeclarativeDebugService::~QDeclarativeDebugService(void)
- ?trUtf8@QDeclarativeDebugService@@SA?AVQString@@PBD0H@Z @ 676 NONAME ABSENT ; class QString QDeclarativeDebugService::trUtf8(char const *, char const *, int)
+ ??1QDeclarativeDebugService@@UAE@XZ @ 675 NONAME ; QDeclarativeDebugService::~QDeclarativeDebugService(void)
+ ?trUtf8@QDeclarativeDebugService@@SA?AVQString@@PBD0H@Z @ 676 NONAME ; class QString QDeclarativeDebugService::trUtf8(char const *, char const *, int)
?elideMode@QDeclarativeText@@QBE?AW4TextElideMode@1@XZ @ 677 NONAME ABSENT ; enum QDeclarativeText::TextElideMode QDeclarativeText::elideMode(void) const
?baseUrl@QDeclarativeContext@@QBE?AVQUrl@@XZ @ 678 NONAME ; class QUrl QDeclarativeContext::baseUrl(void) const
?qt_metacall@QDeclarativeDebugRootContextQuery@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 679 NONAME ABSENT ; int QDeclarativeDebugRootContextQuery::qt_metacall(enum QMetaObject::Call, int, void * *)
@@ -849,7 +849,7 @@ EXPORTS
??1QDeclarativeBehavior@@UAE@XZ @ 848 NONAME ABSENT ; QDeclarativeBehavior::~QDeclarativeBehavior(void)
?qmlInfo@@YA?AVQDeclarativeInfo@@PBVQObject@@@Z @ 849 NONAME ; class QDeclarativeInfo qmlInfo(class QObject const *)
?qt_metacall@QDeclarativeDebugClient@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 850 NONAME ABSENT ; int QDeclarativeDebugClient::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?d_func@QDeclarativeDebugService@@ABEPBVQDeclarativeDebugServicePrivate@@XZ @ 851 NONAME ABSENT ; class QDeclarativeDebugServicePrivate const * QDeclarativeDebugService::d_func(void) const
+ ?d_func@QDeclarativeDebugService@@ABEPBVQDeclarativeDebugServicePrivate@@XZ @ 851 NONAME ; class QDeclarativeDebugServicePrivate const * QDeclarativeDebugService::d_func(void) const
??1QDeclarativeDebugQuery@@UAE@XZ @ 852 NONAME ABSENT ; QDeclarativeDebugQuery::~QDeclarativeDebugQuery(void)
?data_append@QDeclarativeItemPrivate@@SAXPAV?$QDeclarativeListProperty@VQObject@@@@PAVQObject@@@Z @ 853 NONAME ; void QDeclarativeItemPrivate::data_append(class QDeclarativeListProperty<class QObject> *, class QObject *)
?tr@QDeclarativeState@@SA?AVQString@@PBD0@Z @ 854 NONAME ; class QString QDeclarativeState::tr(char const *, char const *)
@@ -1120,7 +1120,7 @@ EXPORTS
?expression@QDeclarativeDebugExpressionQuery@@QBE?AVQVariant@@XZ @ 1119 NONAME ABSENT ; class QVariant QDeclarativeDebugExpressionQuery::expression(void) const
??4QDeclarativeDomList@@QAEAAV0@ABV0@@Z @ 1120 NONAME ABSENT ; class QDeclarativeDomList & QDeclarativeDomList::operator=(class QDeclarativeDomList const &)
?qt_metacall@QDeclarativeComponent@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1121 NONAME ; int QDeclarativeComponent::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?tr@QDeclarativeDebugService@@SA?AVQString@@PBD0H@Z @ 1122 NONAME ABSENT ; class QString QDeclarativeDebugService::tr(char const *, char const *, int)
+ ?tr@QDeclarativeDebugService@@SA?AVQString@@PBD0H@Z @ 1122 NONAME ; class QString QDeclarativeDebugService::tr(char const *, char const *, int)
?staticMetaObject@QDeclarativeEngine@@2UQMetaObject@@B @ 1123 NONAME ; struct QMetaObject const QDeclarativeEngine::staticMetaObject
?staticMetaObject@QDeclarativeStateOperation@@2UQMetaObject@@B @ 1124 NONAME ; struct QMetaObject const QDeclarativeStateOperation::staticMetaObject
?actions@QDeclarativeStateOperation@@UAE?AV?$QList@VQDeclarativeAction@@@@XZ @ 1125 NONAME ; class QList<class QDeclarativeAction> QDeclarativeStateOperation::actions(void)
@@ -1145,7 +1145,7 @@ EXPORTS
?sourceFile@QDeclarativeExpression@@QBE?AVQString@@XZ @ 1144 NONAME ; class QString QDeclarativeExpression::sourceFile(void) const
??_EQDeclarativeAnchors@@UAE@I@Z @ 1145 NONAME ABSENT ; QDeclarativeAnchors::~QDeclarativeAnchors(unsigned int)
?removeNotifySignal@QMetaPropertyBuilder@@QAEXXZ @ 1146 NONAME ABSENT ; void QMetaPropertyBuilder::removeNotifySignal(void)
- ?trUtf8@QDeclarativeDebugService@@SA?AVQString@@PBD0@Z @ 1147 NONAME ABSENT ; class QString QDeclarativeDebugService::trUtf8(char const *, char const *)
+ ?trUtf8@QDeclarativeDebugService@@SA?AVQString@@PBD0@Z @ 1147 NONAME ; class QString QDeclarativeDebugService::trUtf8(char const *, char const *)
?setImportPathList@QDeclarativeEngine@@QAEXABVQStringList@@@Z @ 1148 NONAME ; void QDeclarativeEngine::setImportPathList(class QStringList const &)
?enabledChanged@QDeclarativeDebugService@@MAEX_N@Z @ 1149 NONAME ABSENT ; void QDeclarativeDebugService::enabledChanged(bool)
?addWatch@QDeclarativeEngineDebug@@QAEPAVQDeclarativeDebugWatch@@ABVQDeclarativeDebugObjectReference@@PAVQObject@@@Z @ 1150 NONAME ABSENT ; class QDeclarativeDebugWatch * QDeclarativeEngineDebug::addWatch(class QDeclarativeDebugObjectReference const &, class QObject *)
@@ -1176,7 +1176,7 @@ EXPORTS
?paint@QDeclarativeRectangle@@UAEXPAVQPainter@@PBVQStyleOptionGraphicsItem@@PAVQWidget@@@Z @ 1175 NONAME ABSENT ; void QDeclarativeRectangle::paint(class QPainter *, class QStyleOptionGraphicsItem const *, class QWidget *)
??6QDeclarativeState@@QAEAAV0@PAVQDeclarativeStateOperation@@@Z @ 1176 NONAME ; class QDeclarativeState & QDeclarativeState::operator<<(class QDeclarativeStateOperation *)
?destroy@QDeclarativeAbstractBinding@@UAEXXZ @ 1177 NONAME ABSENT ; void QDeclarativeAbstractBinding::destroy(void)
- ?qt_metacast@QDeclarativeDebugService@@UAEPAXPBD@Z @ 1178 NONAME ABSENT ; void * QDeclarativeDebugService::qt_metacast(char const *)
+ ?qt_metacast@QDeclarativeDebugService@@UAEPAXPBD@Z @ 1178 NONAME ; void * QDeclarativeDebugService::qt_metacast(char const *)
?qt_metacast@QDeclarativeValueType@@UAEPAXPBD@Z @ 1179 NONAME ABSENT ; void * QDeclarativeValueType::qt_metacast(char const *)
?childAt@QDeclarativeItem@@QBEPAV1@MM@Z @ 1180 NONAME ; class QDeclarativeItem * QDeclarativeItem::childAt(float, float) const
?paintedWidth@QDeclarativeText@@QBEMXZ @ 1181 NONAME ABSENT ; float QDeclarativeText::paintedWidth(void) const
@@ -1297,7 +1297,7 @@ EXPORTS
?value@QDeclarativeOpenMetaObject@@QBE?AVQVariant@@H@Z @ 1296 NONAME ABSENT ; class QVariant QDeclarativeOpenMetaObject::value(int) const
?tr@QDeclarativeDebugRootContextQuery@@SA?AVQString@@PBD0H@Z @ 1297 NONAME ABSENT ; class QString QDeclarativeDebugRootContextQuery::tr(char const *, char const *, int)
?setFromState@QDeclarativeTransition@@QAEXABVQString@@@Z @ 1298 NONAME ; void QDeclarativeTransition::setFromState(class QString const &)
- ?metaObject@QDeclarativeDebugService@@UBEPBUQMetaObject@@XZ @ 1299 NONAME ABSENT ; struct QMetaObject const * QDeclarativeDebugService::metaObject(void) const
+ ?metaObject@QDeclarativeDebugService@@UBEPBUQMetaObject@@XZ @ 1299 NONAME ; struct QMetaObject const * QDeclarativeDebugService::metaObject(void) const
?state@QDeclarativeDebugQuery@@QBE?AW4State@1@XZ @ 1300 NONAME ABSENT ; enum QDeclarativeDebugQuery::State QDeclarativeDebugQuery::state(void) const
?setBottom@QDeclarativeScaleGrid@@QAEXH@Z @ 1301 NONAME ABSENT ; void QDeclarativeScaleGrid::setBottom(int)
?topMarginChanged@QDeclarativeAnchors@@IAEXXZ @ 1302 NONAME ABSENT ; void QDeclarativeAnchors::topMarginChanged(void)
@@ -1305,7 +1305,7 @@ EXPORTS
?position@QDeclarativeDomObject@@QBEHXZ @ 1304 NONAME ABSENT ; int QDeclarativeDomObject::position(void) const
?update@QDeclarativeBinding@@UAEXV?$QFlags@W4WriteFlag@QDeclarativePropertyPrivate@@@@@Z @ 1305 NONAME ABSENT ; void QDeclarativeBinding::update(class QFlags<enum QDeclarativePropertyPrivate::WriteFlag>)
?tr@QDeclarativeBehavior@@SA?AVQString@@PBD0@Z @ 1306 NONAME ABSENT ; class QString QDeclarativeBehavior::tr(char const *, char const *)
- ?isDebuggingEnabled@QDeclarativeDebugService@@SA_NXZ @ 1307 NONAME ABSENT ; bool QDeclarativeDebugService::isDebuggingEnabled(void)
+ ?isDebuggingEnabled@QDeclarativeDebugService@@SA_NXZ @ 1307 NONAME ; bool QDeclarativeDebugService::isDebuggingEnabled(void)
?tr@QDeclarativeText@@SA?AVQString@@PBD0H@Z @ 1308 NONAME ABSENT ; class QString QDeclarativeText::tr(char const *, char const *, int)
?reset@QDeclarativeProperty@@QBE_NXZ @ 1309 NONAME ; bool QDeclarativeProperty::reset(void) const
?objectDebugId@QDeclarativeDebugWatch@@QBEHXZ @ 1310 NONAME ABSENT ; int QDeclarativeDebugWatch::objectDebugId(void) const
@@ -1344,7 +1344,7 @@ EXPORTS
?maximumPacketSize@QPacketProtocol@@QBEHXZ @ 1343 NONAME ; int QPacketProtocol::maximumPacketSize(void) const
??_EQDeclarativeDebuggerStatus@@UAE@I@Z @ 1344 NONAME ABSENT ; QDeclarativeDebuggerStatus::~QDeclarativeDebuggerStatus(unsigned int)
?error@QDeclarativeCustomParser@@IAEXABVQString@@@Z @ 1345 NONAME ; void QDeclarativeCustomParser::error(class QString const &)
- ?messageReceived@QDeclarativeDebugService@@MAEXABVQByteArray@@@Z @ 1346 NONAME ABSENT ; void QDeclarativeDebugService::messageReceived(class QByteArray const &)
+ ?messageReceived@QDeclarativeDebugService@@MAEXABVQByteArray@@@Z @ 1346 NONAME ; void QDeclarativeDebugService::messageReceived(class QByteArray const &)
??0QDeclarativeParserStatus@@QAE@XZ @ 1347 NONAME ; QDeclarativeParserStatus::QDeclarativeParserStatus(void)
?isNumber@Variant@QDeclarativeParser@@QBE_NXZ @ 1348 NONAME ; bool QDeclarativeParser::Variant::isNumber(void) const
?getStaticMetaObject@QDeclarativeEngineDebug@@SAABUQMetaObject@@XZ @ 1349 NONAME ABSENT ; struct QMetaObject const & QDeclarativeEngineDebug::getStaticMetaObject(void)
@@ -1475,7 +1475,7 @@ EXPORTS
?packetWritten@QPacketProtocol@@IAEXXZ @ 1474 NONAME ; void QPacketProtocol::packetWritten(void)
?getStaticMetaObject@QDeclarativeDebugObjectQuery@@SAABUQMetaObject@@XZ @ 1475 NONAME ABSENT ; struct QMetaObject const & QDeclarativeDebugObjectQuery::getStaticMetaObject(void)
?isSignalProperty@QDeclarativeProperty@@QBE_NXZ @ 1476 NONAME ; bool QDeclarativeProperty::isSignalProperty(void) const
- ?d_func@QDeclarativeDebugService@@AAEPAVQDeclarativeDebugServicePrivate@@XZ @ 1477 NONAME ABSENT ; class QDeclarativeDebugServicePrivate * QDeclarativeDebugService::d_func(void)
+ ?d_func@QDeclarativeDebugService@@AAEPAVQDeclarativeDebugServicePrivate@@XZ @ 1477 NONAME ; class QDeclarativeDebugServicePrivate * QDeclarativeDebugService::d_func(void)
?qmlTypeNames@QDeclarativeMetaType@@SA?AV?$QList@VQByteArray@@@@XZ @ 1478 NONAME ABSENT ; class QList<class QByteArray> QDeclarativeMetaType::qmlTypeNames(void)
?componentComplete@QDeclarativeItem@@MAEXXZ @ 1479 NONAME ; void QDeclarativeItem::componentComplete(void)
?creationContext@QDeclarativeComponent@@QBEPAVQDeclarativeContext@@XZ @ 1480 NONAME ; class QDeclarativeContext * QDeclarativeComponent::creationContext(void) const
@@ -1575,7 +1575,7 @@ EXPORTS
?keyCount@QMetaEnumBuilder@@QBEHXZ @ 1574 NONAME ABSENT ; int QMetaEnumBuilder::keyCount(void) const
??1QDeclarativeDomProperty@@QAE@XZ @ 1575 NONAME ABSENT ; QDeclarativeDomProperty::~QDeclarativeDomProperty(void)
?url@QDeclarativePixmap@@QBEABVQUrl@@XZ @ 1576 NONAME ; class QUrl const & QDeclarativePixmap::url(void) const
- ?sendMessage@QDeclarativeDebugService@@QAEXABVQByteArray@@@Z @ 1577 NONAME ABSENT ; void QDeclarativeDebugService::sendMessage(class QByteArray const &)
+ ?sendMessage@QDeclarativeDebugService@@QAEXABVQByteArray@@@Z @ 1577 NONAME ; void QDeclarativeDebugService::sendMessage(class QByteArray const &)
?context@QDeclarativeScriptString@@QBEPAVQDeclarativeContext@@XZ @ 1578 NONAME ; class QDeclarativeContext * QDeclarativeScriptString::context(void) const
?queryObject@QDeclarativeEngineDebug@@QAEPAVQDeclarativeDebugObjectQuery@@ABVQDeclarativeDebugObjectReference@@PAVQObject@@@Z @ 1579 NONAME ABSENT ; class QDeclarativeDebugObjectQuery * QDeclarativeEngineDebug::queryObject(class QDeclarativeDebugObjectReference const &, class QObject *)
?tr@QDeclarativePropertyMap@@SA?AVQString@@PBD0H@Z @ 1580 NONAME ; class QString QDeclarativePropertyMap::tr(char const *, char const *, int)
@@ -1608,7 +1608,7 @@ EXPORTS
??_EQDeclarativeComponent@@UAE@I@Z @ 1607 NONAME ; QDeclarativeComponent::~QDeclarativeComponent(unsigned int)
?get@QDeclarativeItemPrivate@@SAPAV1@PAVQDeclarativeItem@@@Z @ 1608 NONAME ; class QDeclarativeItemPrivate * QDeclarativeItemPrivate::get(class QDeclarativeItem *)
?staticMetaObject@QDeclarativeView@@2UQMetaObject@@B @ 1609 NONAME ; struct QMetaObject const QDeclarativeView::staticMetaObject
- ?objectToString@QDeclarativeDebugService@@SA?AVQString@@PAVQObject@@@Z @ 1610 NONAME ABSENT ; class QString QDeclarativeDebugService::objectToString(class QObject *)
+ ?objectToString@QDeclarativeDebugService@@SA?AVQString@@PAVQObject@@@Z @ 1610 NONAME ; class QString QDeclarativeDebugService::objectToString(class QObject *)
?defaultValue@QDeclarativeDomDynamicProperty@@QBE?AVQDeclarativeDomProperty@@XZ @ 1611 NONAME ABSENT ; class QDeclarativeDomProperty QDeclarativeDomDynamicProperty::defaultValue(void) const
?relatedMetaObject@QMetaObjectBuilder@@QBEPBUQMetaObject@@H@Z @ 1612 NONAME ABSENT ; struct QMetaObject const * QMetaObjectBuilder::relatedMetaObject(int) const
?addKey@QMetaEnumBuilder@@QAEHABVQByteArray@@H@Z @ 1613 NONAME ABSENT ; int QMetaEnumBuilder::addKey(class QByteArray const &, int)
@@ -1633,7 +1633,7 @@ EXPORTS
?tr@QDeclarativeView@@SA?AVQString@@PBD0@Z @ 1632 NONAME ; class QString QDeclarativeView::tr(char const *, char const *)
?qt_metacall@QPacketProtocol@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1633 NONAME ; int QPacketProtocol::qt_metacall(enum QMetaObject::Call, int, void * *)
??0QDeclarativeItem@@QAE@PAV0@@Z @ 1634 NONAME ; QDeclarativeItem::QDeclarativeItem(class QDeclarativeItem *)
- ?hasDebuggingClient@QDeclarativeDebugService@@SA_NXZ @ 1635 NONAME ABSENT ; bool QDeclarativeDebugService::hasDebuggingClient(void)
+ ?hasDebuggingClient@QDeclarativeDebugService@@SA_NXZ @ 1635 NONAME ; bool QDeclarativeDebugService::hasDebuggingClient(void)
?staticMetaObject@QDeclarativeContext@@2UQMetaObject@@B @ 1636 NONAME ; struct QMetaObject const QDeclarativeContext::staticMetaObject
?setContextForObject@QDeclarativeEngine@@SAXPAVQObject@@PAVQDeclarativeContext@@@Z @ 1637 NONAME ; void QDeclarativeEngine::setContextForObject(class QObject *, class QDeclarativeContext *)
?baselineOffsetChanged@QDeclarativeItem@@IAEXM@Z @ 1638 NONAME ; void QDeclarativeItem::baselineOffsetChanged(float)
@@ -1733,7 +1733,7 @@ EXPORTS
?start@QDeclarativeTimer@@QAEXXZ @ 1732 NONAME ABSENT ; void QDeclarativeTimer::start(void)
?transition@QDeclarativeAbstractAnimation@@UAEXAAV?$QList@VQDeclarativeAction@@@@AAV?$QList@VQDeclarativeProperty@@@@W4TransitionDirection@1@@Z @ 1733 NONAME ABSENT ; void QDeclarativeAbstractAnimation::transition(class QList<class QDeclarativeAction> &, class QList<class QDeclarativeProperty> &, enum QDeclarativeAbstractAnimation::TransitionDirection)
?componentComplete@QDeclarativeAbstractAnimation@@UAEXXZ @ 1734 NONAME ABSENT ; void QDeclarativeAbstractAnimation::componentComplete(void)
- ?statusChanged@QDeclarativeDebugService@@MAEXW4Status@1@@Z @ 1735 NONAME ABSENT ; void QDeclarativeDebugService::statusChanged(enum QDeclarativeDebugService::Status)
+ ?statusChanged@QDeclarativeDebugService@@MAEXW4Status@1@@Z @ 1735 NONAME ; void QDeclarativeDebugService::statusChanged(enum QDeclarativeDebugService::Status)
?runningChanged@QDeclarativeAbstractAnimation@@IAEX_N@Z @ 1736 NONAME ABSENT ; void QDeclarativeAbstractAnimation::runningChanged(bool)
?trUtf8@QDeclarativeAbstractAnimation@@SA?AVQString@@PBD0H@Z @ 1737 NONAME ABSENT ; class QString QDeclarativeAbstractAnimation::trUtf8(char const *, char const *, int)
??_EQDeclarativeBasePositioner@@UAE@I@Z @ 1738 NONAME ABSENT ; QDeclarativeBasePositioner::~QDeclarativeBasePositioner(unsigned int)
@@ -1813,7 +1813,7 @@ EXPORTS
?setTarget@QDeclarativeAbstractAnimation@@EAEXABVQDeclarativeProperty@@@Z @ 1812 NONAME ABSENT ; void QDeclarativeAbstractAnimation::setTarget(class QDeclarativeProperty const &)
?alwaysRunToEnd@QDeclarativeAbstractAnimation@@QBE_NXZ @ 1813 NONAME ABSENT ; bool QDeclarativeAbstractAnimation::alwaysRunToEnd(void) const
?tr@QDeclarativeTimer@@SA?AVQString@@PBD0H@Z @ 1814 NONAME ABSENT ; class QString QDeclarativeTimer::tr(char const *, char const *, int)
- ?status@QDeclarativeDebugService@@QBE?AW4Status@1@XZ @ 1815 NONAME ABSENT ; enum QDeclarativeDebugService::Status QDeclarativeDebugService::status(void) const
+ ?status@QDeclarativeDebugService@@QBE?AW4Status@1@XZ @ 1815 NONAME ; enum QDeclarativeDebugService::Status QDeclarativeDebugService::status(void) const
?intervalChanged@QDeclarativeTimer@@IAEXXZ @ 1816 NONAME ABSENT ; void QDeclarativeTimer::intervalChanged(void)
?isPaused@QDeclarativeAbstractAnimation@@QBE_NXZ @ 1817 NONAME ABSENT ; bool QDeclarativeAbstractAnimation::isPaused(void) const
?getStaticMetaObject@QDeclarativeAbstractAnimation@@SAABUQMetaObject@@XZ @ 1818 NONAME ABSENT ; struct QMetaObject const & QDeclarativeAbstractAnimation::getStaticMetaObject(void)
@@ -1888,4 +1888,9 @@ EXPORTS
??1QDeclarativeRefCount@@UAE@XZ @ 1887 NONAME ; QDeclarativeRefCount::~QDeclarativeRefCount(void)
?addref@QDeclarativeRefCount@@QAEXXZ @ 1888 NONAME ; void QDeclarativeRefCount::addref(void)
?release@QDeclarativeRefCount@@QAEXXZ @ 1889 NONAME ; void QDeclarativeRefCount::release(void)
+ ?resolveLayoutMirror@QDeclarativeItemPrivate@@QAEXXZ @ 1890 NONAME ; void QDeclarativeItemPrivate::resolveLayoutMirror(void)
+ ?mirrorChange@QDeclarativeItemPrivate@@UAEXXZ @ 1891 NONAME ; void QDeclarativeItemPrivate::mirrorChange(void)
+ ?setLayoutMirror@QDeclarativeItemPrivate@@QAEX_N@Z @ 1892 NONAME ; void QDeclarativeItemPrivate::setLayoutMirror(bool)
+ ?setImplicitLayoutMirror@QDeclarativeItemPrivate@@QAEX_N0@Z @ 1893 NONAME ; void QDeclarativeItemPrivate::setImplicitLayoutMirror(bool, bool)
+ ?isMirrored@QDeclarativeItemPrivate@@QBE_NXZ @ 1894 NONAME ; bool QDeclarativeItemPrivate::isMirrored(void) const
diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index a41f784..26a0761 100644
--- a/src/s60installs/bwins/QtGuiu.def
+++ b/src/s60installs/bwins/QtGuiu.def
@@ -12952,4 +12952,33 @@ EXPORTS
?isWordSelectionEnabled@QTextControl@@QBE_NXZ @ 12951 NONAME ; bool QTextControl::isWordSelectionEnabled(void) const
?assignedInputContext@QWidgetPrivate@@QBEPAVQInputContext@@XZ @ 12952 NONAME ; class QInputContext * QWidgetPrivate::assignedInputContext(void) const
?updateMicroFocus@QLineControl@@IAEXXZ @ 12953 NONAME ; void QLineControl::updateMicroFocus(void)
+ ?beginDataAccess@QVolatileImage@@QBEXXZ @ 12954 NONAME ; void QVolatileImage::beginDataAccess(void) const
+ ??1QVolatileImage@@QAE@XZ @ 12955 NONAME ; QVolatileImage::~QVolatileImage(void)
+ ??0QVolatileImage@@QAE@HHW4Format@QImage@@@Z @ 12956 NONAME ; QVolatileImage::QVolatileImage(int, int, enum QImage::Format)
+ ?ensureFormat@QVolatileImage@@QAE_NW4Format@QImage@@@Z @ 12957 NONAME ; bool QVolatileImage::ensureFormat(enum QImage::Format)
+ ?fill@QVolatileImage@@QAEXI@Z @ 12958 NONAME ; void QVolatileImage::fill(unsigned int)
+ ?isNull@QVolatileImage@@QBE_NXZ @ 12959 NONAME ; bool QVolatileImage::isNull(void) const
+ ?toImage@QVolatileImage@@QBE?AVQImage@@XZ @ 12960 NONAME ; class QImage QVolatileImage::toImage(void) const
+ ??0QVolatileImage@@QAE@ABVQImage@@@Z @ 12961 NONAME ; QVolatileImage::QVolatileImage(class QImage const &)
+ ?format@QVolatileImage@@QBE?AW4Format@QImage@@XZ @ 12962 NONAME ; enum QImage::Format QVolatileImage::format(void) const
+ ?endDataAccess@QVolatileImage@@QBEX_N@Z @ 12963 NONAME ; void QVolatileImage::endDataAccess(bool) const
+ ?constBits@QVolatileImage@@QBEPBEXZ @ 12964 NONAME ; unsigned char const * QVolatileImage::constBits(void) const
+ ?height@QVolatileImage@@QBEHXZ @ 12965 NONAME ; int QVolatileImage::height(void) const
+ ?duplicateNativeImage@QVolatileImage@@QBEPAXXZ @ 12966 NONAME ; void * QVolatileImage::duplicateNativeImage(void) const
+ ?bits@QVolatileImage@@QAEPAEXZ @ 12967 NONAME ; unsigned char * QVolatileImage::bits(void)
+ ?paintEngine@QVolatileImage@@QAEPAVQPaintEngine@@XZ @ 12968 NONAME ; class QPaintEngine * QVolatileImage::paintEngine(void)
+ ?bytesPerLine@QVolatileImage@@QBEHXZ @ 12969 NONAME ; int QVolatileImage::bytesPerLine(void) const
+ ?width@QVolatileImage@@QBEHXZ @ 12970 NONAME ; int QVolatileImage::width(void) const
+ ?copyFrom@QVolatileImage@@QAEXPAV1@ABVQRect@@@Z @ 12971 NONAME ; void QVolatileImage::copyFrom(class QVolatileImage *, class QRect const &)
+ ?imageRef@QVolatileImage@@QAEAAVQImage@@XZ @ 12972 NONAME ; class QImage & QVolatileImage::imageRef(void)
+ ??0QVolatileImage@@QAE@PAX0@Z @ 12973 NONAME ; QVolatileImage::QVolatileImage(void *, void *)
+ ??4QVolatileImage@@QAEAAV0@ABV0@@Z @ 12974 NONAME ; class QVolatileImage & QVolatileImage::operator=(class QVolatileImage const &)
+ ??0QVolatileImage@@QAE@XZ @ 12975 NONAME ; QVolatileImage::QVolatileImage(void)
+ ?hasAlphaChannel@QVolatileImage@@QBE_NXZ @ 12976 NONAME ; bool QVolatileImage::hasAlphaChannel(void) const
+ ?setAlphaChannel@QVolatileImage@@QAEXABVQPixmap@@@Z @ 12977 NONAME ; void QVolatileImage::setAlphaChannel(class QPixmap const &)
+ ?byteCount@QVolatileImage@@QBEHXZ @ 12978 NONAME ; int QVolatileImage::byteCount(void) const
+ ??0QVolatileImage@@QAE@ABV0@@Z @ 12979 NONAME ; QVolatileImage::QVolatileImage(class QVolatileImage const &)
+ ?depth@QVolatileImage@@QBEHXZ @ 12980 NONAME ; int QVolatileImage::depth(void) const
+ ?releaseCachedResources@QGraphicsSystem@@UAEXXZ @ 12981 NONAME ; void QGraphicsSystem::releaseCachedResources(void)
+ ?qt_s60_setPartialScreenInputMode@@YAX_N@Z @ 12982 NONAME ; void qt_s60_setPartialScreenInputMode(bool)
diff --git a/src/s60installs/bwins/QtOpenGLu.def b/src/s60installs/bwins/QtOpenGLu.def
index 3eb1512..f52932c 100644
--- a/src/s60installs/bwins/QtOpenGLu.def
+++ b/src/s60installs/bwins/QtOpenGLu.def
@@ -711,4 +711,12 @@ EXPORTS
?createPixmapForImage@QGLPixmapData@@AAEXAAVQImage@@V?$QFlags@W4ImageConversionFlag@Qt@@@@_N@Z @ 710 NONAME ; void QGLPixmapData::createPixmapForImage(class QImage &, class QFlags<enum Qt::ImageConversionFlag>, bool)
?fromImageReader@QGLPixmapData@@UAEXPAVQImageReader@@V?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 711 NONAME ; void QGLPixmapData::fromImageReader(class QImageReader *, class QFlags<enum Qt::ImageConversionFlag>)
?setContext@QGLTextureGlyphCache@@QAEXPAVQGLContext@@@Z @ 712 NONAME ; void QGLTextureGlyphCache::setContext(class QGLContext *)
+ ?hibernate@QGLPixmapData@@QAEXXZ @ 713 NONAME ; void QGLPixmapData::hibernate(void)
+ ?detachTextureFromPool@QGLPixmapData@@QAEXXZ @ 714 NONAME ; void QGLPixmapData::detachTextureFromPool(void)
+ ?reclaimTexture@QGLPixmapData@@QAEXXZ @ 715 NONAME ; void QGLPixmapData::reclaimTexture(void)
+ ?destroyTexture@QGLPixmapData@@QAEXXZ @ 716 NONAME ; void QGLPixmapData::destroyTexture(void)
+ ?releaseCachedResources@QGLGraphicsSystem@@UAEXXZ @ 717 NONAME ; void QGLGraphicsSystem::releaseCachedResources(void)
+ ?serialNumber@QGLTextureGlyphCache@@QBEHXZ @ 718 NONAME ; int QGLTextureGlyphCache::serialNumber(void) const
+ ?forceToImage@QGLPixmapData@@QAEXXZ @ 719 NONAME ; void QGLPixmapData::forceToImage(void)
+ ?idealFormat@QGLPixmapData@@QAE?AW4Format@QImage@@AAV3@V?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 720 NONAME ; enum QImage::Format QGLPixmapData::idealFormat(class QImage &, class QFlags<enum Qt::ImageConversionFlag>)
diff --git a/src/s60installs/bwins/QtOpenVGu.def b/src/s60installs/bwins/QtOpenVGu.def
index 87b9c7f..18f576b 100644
--- a/src/s60installs/bwins/QtOpenVGu.def
+++ b/src/s60installs/bwins/QtOpenVGu.def
@@ -176,4 +176,11 @@ EXPORTS
?fromData@QVGPixmapData@@UAE_NPBEIPBDV?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 175 NONAME ; bool QVGPixmapData::fromData(unsigned char const *, unsigned int, char const *, class QFlags<enum Qt::ImageConversionFlag>)
?fromImageReader@QVGPixmapData@@UAEXPAVQImageReader@@V?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 176 NONAME ; void QVGPixmapData::fromImageReader(class QImageReader *, class QFlags<enum Qt::ImageConversionFlag>)
?canVgWritePixels@QVGPaintEngine@@ABE_NABVQImage@@@Z @ 177 NONAME ; bool QVGPaintEngine::canVgWritePixels(class QImage const &) const
+ ?updateSerial@QVGPixmapData@@IAEXXZ @ 178 NONAME ; void QVGPixmapData::updateSerial(void)
+ ?copy@QVGPixmapData@@UAEXPBVQPixmapData@@ABVQRect@@@Z @ 179 NONAME ; void QVGPixmapData::copy(class QPixmapData const *, class QRect const &)
+ ?idealFormat@QVGPixmapData@@IBE?AW4Format@QImage@@PAV3@V?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 180 NONAME ; enum QImage::Format QVGPixmapData::idealFormat(class QImage *, class QFlags<enum Qt::ImageConversionFlag>) const
+ ?ensureReadback@QVGPixmapData@@UBEX_N@Z @ 181 NONAME ; void QVGPixmapData::ensureReadback(bool) const
+ ?initFromNativeImageHandle@QVGPixmapData@@QAE_NPAXABVQString@@@Z @ 182 NONAME ; bool QVGPixmapData::initFromNativeImageHandle(void *, class QString const &)
+ ?createFromNativeImageHandleProvider@QVGPixmapData@@QAEXXZ @ 183 NONAME ; void QVGPixmapData::createFromNativeImageHandleProvider(void)
+ ?releaseNativeImageHandle@QVGPixmapData@@QAEXXZ @ 184 NONAME ; void QVGPixmapData::releaseNativeImageHandle(void)
diff --git a/src/s60installs/eabi/QtDeclarativeu.def b/src/s60installs/eabi/QtDeclarativeu.def
index 95180d4..2849068 100644
--- a/src/s60installs/eabi/QtDeclarativeu.def
+++ b/src/s60installs/eabi/QtDeclarativeu.def
@@ -761,20 +761,20 @@ EXPORTS
_ZN24QDeclarativeCustomParser5errorERK28QDeclarativeCustomParserNodeRK7QString @ 760 NONAME
_ZN24QDeclarativeCustomParser5errorERK32QDeclarativeCustomParserPropertyRK7QString @ 761 NONAME
_ZN24QDeclarativeCustomParser5errorERK7QString @ 762 NONAME
- _ZN24QDeclarativeDebugService11idForObjectEP7QObject @ 763 NONAME ABSENT
- _ZN24QDeclarativeDebugService11objectForIdEi @ 764 NONAME ABSENT
- _ZN24QDeclarativeDebugService11qt_metacallEN11QMetaObject4CallEiPPv @ 765 NONAME ABSENT
- _ZN24QDeclarativeDebugService11qt_metacastEPKc @ 766 NONAME ABSENT
- _ZN24QDeclarativeDebugService11sendMessageERK10QByteArray @ 767 NONAME ABSENT
+ _ZN24QDeclarativeDebugService11idForObjectEP7QObject @ 763 NONAME
+ _ZN24QDeclarativeDebugService11objectForIdEi @ 764 NONAME
+ _ZN24QDeclarativeDebugService11qt_metacallEN11QMetaObject4CallEiPPv @ 765 NONAME
+ _ZN24QDeclarativeDebugService11qt_metacastEPKc @ 766 NONAME
+ _ZN24QDeclarativeDebugService11sendMessageERK10QByteArray @ 767 NONAME
_ZN24QDeclarativeDebugService14enabledChangedEb @ 768 NONAME ABSENT
- _ZN24QDeclarativeDebugService14objectToStringEP7QObject @ 769 NONAME ABSENT
- _ZN24QDeclarativeDebugService15messageReceivedERK10QByteArray @ 770 NONAME ABSENT
- _ZN24QDeclarativeDebugService16staticMetaObjectE @ 771 NONAME DATA 16 ABSENT
- _ZN24QDeclarativeDebugService18hasDebuggingClientEv @ 772 NONAME ABSENT
- _ZN24QDeclarativeDebugService18isDebuggingEnabledEv @ 773 NONAME ABSENT
- _ZN24QDeclarativeDebugService19getStaticMetaObjectEv @ 774 NONAME ABSENT
- _ZN24QDeclarativeDebugServiceC1ERK7QStringP7QObject @ 775 NONAME ABSENT
- _ZN24QDeclarativeDebugServiceC2ERK7QStringP7QObject @ 776 NONAME ABSENT
+ _ZN24QDeclarativeDebugService14objectToStringEP7QObject @ 769 NONAME
+ _ZN24QDeclarativeDebugService15messageReceivedERK10QByteArray @ 770 NONAME
+ _ZN24QDeclarativeDebugService16staticMetaObjectE @ 771 NONAME DATA 16
+ _ZN24QDeclarativeDebugService18hasDebuggingClientEv @ 772 NONAME
+ _ZN24QDeclarativeDebugService18isDebuggingEnabledEv @ 773 NONAME
+ _ZN24QDeclarativeDebugService19getStaticMetaObjectEv @ 774 NONAME
+ _ZN24QDeclarativeDebugServiceC1ERK7QStringP7QObject @ 775 NONAME
+ _ZN24QDeclarativeDebugServiceC2ERK7QStringP7QObject @ 776 NONAME
_ZN24QDeclarativeDomComponentC1ERKS_ @ 777 NONAME ABSENT
_ZN24QDeclarativeDomComponentC1Ev @ 778 NONAME ABSENT
_ZN24QDeclarativeDomComponentC2ERKS_ @ 779 NONAME ABSENT
@@ -1425,8 +1425,8 @@ EXPORTS
_ZNK23QDeclarativePropertyMapixERK7QString @ 1424 NONAME
_ZNK24QDeclarativeCustomParser11resolveTypeERK10QByteArray @ 1425 NONAME
_ZNK24QDeclarativeCustomParser12evaluateEnumERK10QByteArray @ 1426 NONAME
- _ZNK24QDeclarativeDebugService10metaObjectEv @ 1427 NONAME ABSENT
- _ZNK24QDeclarativeDebugService4nameEv @ 1428 NONAME ABSENT
+ _ZNK24QDeclarativeDebugService10metaObjectEv @ 1427 NONAME
+ _ZNK24QDeclarativeDebugService4nameEv @ 1428 NONAME
_ZNK24QDeclarativeDebugService9isEnabledEv @ 1429 NONAME ABSENT
_ZNK24QDeclarativeDomComponent13componentRootEv @ 1430 NONAME ABSENT
_ZNK24QDeclarativeScriptString11scopeObjectEv @ 1431 NONAME
@@ -1554,7 +1554,7 @@ EXPORTS
_ZTI23QDeclarativeItemPrivate @ 1553 NONAME
_ZTI23QDeclarativePropertyMap @ 1554 NONAME
_ZTI24QDeclarativeCustomParser @ 1555 NONAME
- _ZTI24QDeclarativeDebugService @ 1556 NONAME ABSENT
+ _ZTI24QDeclarativeDebugService @ 1556 NONAME
_ZTI24QDeclarativeParserStatus @ 1557 NONAME
_ZTI25QDeclarativeImageProvider @ 1558 NONAME
_ZTI26QDeclarativeDebuggerStatus @ 1559 NONAME ABSENT
@@ -1604,7 +1604,7 @@ EXPORTS
_ZTV23QDeclarativeItemPrivate @ 1603 NONAME
_ZTV23QDeclarativePropertyMap @ 1604 NONAME
_ZTV24QDeclarativeCustomParser @ 1605 NONAME
- _ZTV24QDeclarativeDebugService @ 1606 NONAME ABSENT
+ _ZTV24QDeclarativeDebugService @ 1606 NONAME
_ZTV24QDeclarativeParserStatus @ 1607 NONAME
_ZTV25QDeclarativeImageProvider @ 1608 NONAME
_ZTV26QDeclarativeDebuggerStatus @ 1609 NONAME ABSENT
@@ -1777,10 +1777,10 @@ EXPORTS
_ZN23QDeclarativeDebugClientD1Ev @ 1776 NONAME ABSENT
_ZN23QDeclarativeDebugClientD2Ev @ 1777 NONAME ABSENT
_ZN23QDeclarativeEngineDebug13statusChangedENS_6StatusE @ 1778 NONAME ABSENT
- _ZN24QDeclarativeDebugService13statusChangedENS_6StatusE @ 1779 NONAME ABSENT
- _ZN24QDeclarativeDebugServiceD0Ev @ 1780 NONAME ABSENT
- _ZN24QDeclarativeDebugServiceD1Ev @ 1781 NONAME ABSENT
- _ZN24QDeclarativeDebugServiceD2Ev @ 1782 NONAME ABSENT
+ _ZN24QDeclarativeDebugService13statusChangedENS_6StatusE @ 1779 NONAME
+ _ZN24QDeclarativeDebugServiceD0Ev @ 1780 NONAME
+ _ZN24QDeclarativeDebugServiceD1Ev @ 1781 NONAME
+ _ZN24QDeclarativeDebugServiceD2Ev @ 1782 NONAME
_ZN26QDeclarativeBasePositioner10addChangedEv @ 1783 NONAME ABSENT
_ZN26QDeclarativeBasePositioner10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 1784 NONAME ABSENT
_ZN26QDeclarativeBasePositioner10setSpacingEi @ 1785 NONAME ABSENT
@@ -1851,7 +1851,7 @@ EXPORTS
_ZNK17QDeclarativeTimer9isRunningEv @ 1850 NONAME ABSENT
_ZNK23QDeclarativeDebugClient6statusEv @ 1851 NONAME ABSENT
_ZNK23QDeclarativeEngineDebug6statusEv @ 1852 NONAME ABSENT
- _ZNK24QDeclarativeDebugService6statusEv @ 1853 NONAME ABSENT
+ _ZNK24QDeclarativeDebugService6statusEv @ 1853 NONAME
_ZNK26QDeclarativeBasePositioner10metaObjectEv @ 1854 NONAME ABSENT
_ZNK26QDeclarativeBasePositioner3addEv @ 1855 NONAME ABSENT
_ZNK26QDeclarativeBasePositioner4moveEv @ 1856 NONAME ABSENT
@@ -1930,4 +1930,7 @@ EXPORTS
_ZN20QDeclarativeRefCountD2Ev @ 1929 NONAME
_ZTI20QDeclarativeRefCount @ 1930 NONAME
_ZTV20QDeclarativeRefCount @ 1931 NONAME
+ _ZN23QDeclarativeItemPrivate15setLayoutMirrorEb @ 1932 NONAME
+ _ZN23QDeclarativeItemPrivate19resolveLayoutMirrorEv @ 1933 NONAME
+ _ZN23QDeclarativeItemPrivate23setImplicitLayoutMirrorEbb @ 1934 NONAME
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index 2de88f2..b6a24ab 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -12147,4 +12147,39 @@ EXPORTS
_ZNK12QTextControl22isWordSelectionEnabledEv @ 12146 NONAME
_ZN12QLineControl16updateMicroFocusEv @ 12147 NONAME
_ZNK14QWidgetPrivate20assignedInputContextEv @ 12148 NONAME
+ _ZN14QVolatileImage11paintEngineEv @ 12149 NONAME
+ _ZN14QVolatileImage12ensureFormatEN6QImage6FormatE @ 12150 NONAME
+ _ZN14QVolatileImage15setAlphaChannelERK7QPixmap @ 12151 NONAME
+ _ZN14QVolatileImage4bitsEv @ 12152 NONAME
+ _ZN14QVolatileImage4fillEj @ 12153 NONAME
+ _ZN14QVolatileImage8copyFromEPS_RK5QRect @ 12154 NONAME
+ _ZN14QVolatileImage8imageRefEv @ 12155 NONAME
+ _ZN14QVolatileImageC1EPvS0_ @ 12156 NONAME
+ _ZN14QVolatileImageC1ERK6QImage @ 12157 NONAME
+ _ZN14QVolatileImageC1ERKS_ @ 12158 NONAME
+ _ZN14QVolatileImageC1EiiN6QImage6FormatE @ 12159 NONAME
+ _ZN14QVolatileImageC1Ev @ 12160 NONAME
+ _ZN14QVolatileImageC2EPvS0_ @ 12161 NONAME
+ _ZN14QVolatileImageC2ERK6QImage @ 12162 NONAME
+ _ZN14QVolatileImageC2ERKS_ @ 12163 NONAME
+ _ZN14QVolatileImageC2EiiN6QImage6FormatE @ 12164 NONAME
+ _ZN14QVolatileImageC2Ev @ 12165 NONAME
+ _ZN14QVolatileImageD1Ev @ 12166 NONAME
+ _ZN14QVolatileImageD2Ev @ 12167 NONAME
+ _ZN14QVolatileImageaSERKS_ @ 12168 NONAME
+ _ZNK14QVolatileImage12bytesPerLineEv @ 12169 NONAME
+ _ZNK14QVolatileImage13endDataAccessEb @ 12170 NONAME
+ _ZNK14QVolatileImage15beginDataAccessEv @ 12171 NONAME
+ _ZNK14QVolatileImage15hasAlphaChannelEv @ 12172 NONAME
+ _ZNK14QVolatileImage20duplicateNativeImageEv @ 12173 NONAME
+ _ZNK14QVolatileImage5depthEv @ 12174 NONAME
+ _ZNK14QVolatileImage5widthEv @ 12175 NONAME
+ _ZNK14QVolatileImage6formatEv @ 12176 NONAME
+ _ZNK14QVolatileImage6heightEv @ 12177 NONAME
+ _ZNK14QVolatileImage6isNullEv @ 12178 NONAME
+ _ZNK14QVolatileImage7toImageEv @ 12179 NONAME
+ _ZNK14QVolatileImage9byteCountEv @ 12180 NONAME
+ _ZNK14QVolatileImage9constBitsEv @ 12181 NONAME
+ _ZN15QGraphicsSystem22releaseCachedResourcesEv @ 12182 NONAME
+ _Z32qt_s60_setPartialScreenInputModeb @ 12183 NONAME
diff --git a/src/s60installs/eabi/QtOpenGLu.def b/src/s60installs/eabi/QtOpenGLu.def
index 33d40fd..f7a7f71 100644
--- a/src/s60installs/eabi/QtOpenGLu.def
+++ b/src/s60installs/eabi/QtOpenGLu.def
@@ -714,4 +714,11 @@ EXPORTS
_ZN16QGLWindowSurface12swapBehaviorE @ 713 NONAME DATA 4
_ZN20QGLTextureGlyphCache10setContextEP10QGLContext @ 714 NONAME
_ZN20QGLTextureGlyphCache5clearEv @ 715 NONAME
+ _ZN13QGLPixmapData12forceToImageEv @ 716 NONAME
+ _ZN13QGLPixmapData14destroyTextureEv @ 717 NONAME
+ _ZN13QGLPixmapData14reclaimTextureEv @ 718 NONAME
+ _ZN13QGLPixmapData21detachTextureFromPoolEv @ 719 NONAME
+ _ZN13QGLPixmapData9hibernateEv @ 720 NONAME
+ _ZN17QGLGraphicsSystem22releaseCachedResourcesEv @ 721 NONAME
+ _ZN13QGLPixmapData11idealFormatER6QImage6QFlagsIN2Qt19ImageConversionFlagEE @ 722 NONAME
diff --git a/src/s60installs/eabi/QtOpenVGu.def b/src/s60installs/eabi/QtOpenVGu.def
index e1828c1..25c53b8 100644
--- a/src/s60installs/eabi/QtOpenVGu.def
+++ b/src/s60installs/eabi/QtOpenVGu.def
@@ -206,4 +206,11 @@ EXPORTS
_ZN13QVGPixmapData8fromDataEPKhjPKc6QFlagsIN2Qt19ImageConversionFlagEE @ 205 NONAME
_ZN13QVGPixmapData8fromFileERK7QStringPKc6QFlagsIN2Qt19ImageConversionFlagEE @ 206 NONAME
_ZNK14QVGPaintEngine16canVgWritePixelsERK6QImage @ 207 NONAME
+ _ZN13QVGPixmapData12updateSerialEv @ 208 NONAME
+ _ZN13QVGPixmapData4copyEPK11QPixmapDataRK5QRect @ 209 NONAME
+ _ZNK13QVGPixmapData11idealFormatEP6QImage6QFlagsIN2Qt19ImageConversionFlagEE @ 210 NONAME
+ _ZNK13QVGPixmapData14ensureReadbackEb @ 211 NONAME
+ _ZN13QVGPixmapData24releaseNativeImageHandleEv @ 212 NONAME
+ _ZN13QVGPixmapData25initFromNativeImageHandleEPvRK7QString @ 213 NONAME
+ _ZN13QVGPixmapData35createFromNativeImageHandleProviderEv @ 214 NONAME
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index 1e5ce0f..76f1dda 100644
--- a/src/s60installs/s60installs.pro
+++ b/src/s60installs/s60installs.pro
@@ -58,7 +58,7 @@ symbian: {
" \"$$pluginLocations/qts60plugin_5_0$${QT_LIBINFIX}.dll\" - \"c:\\sys\\bin\\qts60plugin_5_0$${QT_LIBINFIX}.dll\"" \
" \"$$bearerPluginLocation/qsymbianbearer$${QT_LIBINFIX}.dll\" - \"c:\\sys\\bin\\qsymbianbearer$${QT_LIBINFIX}.dll\"" \
"ENDIF" \
- " \"$$bearerStubZ\" - \"c:$$replace(QT_PLUGINS_BASE_DIR,/,\\)\\bearer\\qsymbianbearer$${QT_LIBINFIX}.qtplugin\"
+ " \"$$bearerStubZ\" - \"c:$$replace(QT_PLUGINS_BASE_DIR,/,\\)\\bearer\\qsymbianbearer$${QT_LIBINFIX}.qtplugin\""
} else {
# No need to deploy plugins for older platform versions when building on Symbian3 or later
qts60plugindeployment = \
diff --git a/src/s60main/s60main.pro b/src/s60main/s60main.pro
index 8ab3bd3..1e3e06a 100644
--- a/src/s60main/s60main.pro
+++ b/src/s60main/s60main.pro
@@ -30,7 +30,7 @@ symbian {
# Having MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA will cause s60main.lib be unlinkable
# against GCCE apps, so remove it
MMP_RULES -= $$MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA
- linux-armcc:QMAKE_CXXFLAGS *= --export_all_vtbl
+ symbian-armcc:QMAKE_CXXFLAGS *= --export_all_vtbl
# Flag if exports are not frozen to avoid lookup of qtcore allocator creation function by ordinal
contains(CONFIG, def_files_disabled): DEFINES += QT_EXPORTS_NOT_FROZEN
diff --git a/src/src.pro b/src/src.pro
index 060f48b..868e22f 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -108,7 +108,7 @@ src_webkit_declarative.target = sub-webkitdeclarative
src_phonon.depends = src_gui
src_multimedia.depends = src_gui
contains(QT_CONFIG, opengl):src_multimedia.depends += src_opengl
- src_tools_activeqt.depends = src_tools_idc src_gui
+ src_activeqt.depends = src_tools_idc src_gui
src_declarative.depends = src_gui src_script src_network
src_plugins.depends = src_gui src_sql src_svg
contains(QT_CONFIG, multimedia):src_plugins.depends += src_multimedia
diff --git a/tests/auto/declarative/qdeclarativeanchors/data/fill.qml b/tests/auto/declarative/qdeclarativeanchors/data/fill.qml
index 50fbbe0..ff19675 100644
--- a/tests/auto/declarative/qdeclarativeanchors/data/fill.qml
+++ b/tests/auto/declarative/qdeclarativeanchors/data/fill.qml
@@ -6,9 +6,9 @@ Rectangle {
objectName: "filler"
width: 50; height: 50; color: "blue"
anchors.fill: parent;
- anchors.leftMargin: 10;
- anchors.rightMargin: 20;
- anchors.topMargin: 30;
- anchors.bottomMargin: 40;
+ anchors.leftMargin: 10;
+ anchors.rightMargin: 20;
+ anchors.topMargin: 30;
+ anchors.bottomMargin: 40;
}
}
diff --git a/tests/auto/declarative/qdeclarativeanchors/data/margins.qml b/tests/auto/declarative/qdeclarativeanchors/data/margins.qml
index dace9c0..685346a 100644
--- a/tests/auto/declarative/qdeclarativeanchors/data/margins.qml
+++ b/tests/auto/declarative/qdeclarativeanchors/data/margins.qml
@@ -6,8 +6,8 @@ Rectangle {
objectName: "filler"
width: 50; height: 50; color: "blue"
anchors.fill: parent;
- anchors.margins: 10
- anchors.leftMargin: 5
- anchors.topMargin: 6
+ anchors.margins: 10
+ anchors.leftMargin: 5
+ anchors.topMargin: 6
}
}
diff --git a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
index e880857..0442350 100644
--- a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
+++ b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
@@ -65,13 +65,10 @@ class tst_qdeclarativeanchors : public QObject
public:
tst_qdeclarativeanchors() {}
- template<typename T>
- T *findItem(QGraphicsObject *parent, const QString &id);
- QGraphicsObject *findObject(QGraphicsObject *parent, const QString &objectName);
-
private slots:
void basicAnchors();
void basicAnchorsQGraphicsWidget();
+ void basicAnchorsRTL();
void loops();
void illegalSets();
void illegalSets_data();
@@ -82,16 +79,20 @@ private slots:
void nullItem_data();
void crash1();
void centerIn();
+ void centerInRTL();
void hvCenter();
+ void hvCenterRTL();
void fill();
+ void fillRTL();
void margins();
+ void marginsRTL();
};
/*
Find an item with the specified id.
*/
template<typename T>
-T *tst_qdeclarativeanchors::findItem(QGraphicsObject *parent, const QString &objectName)
+T *findItem(QGraphicsObject *parent, const QString &objectName)
{
const QMetaObject &mo = T::staticMetaObject;
QList<QGraphicsItem *> children = parent->childItems();
@@ -110,7 +111,7 @@ T *tst_qdeclarativeanchors::findItem(QGraphicsObject *parent, const QString &obj
return 0;
}
-QGraphicsObject *tst_qdeclarativeanchors::findObject(QGraphicsObject *parent, const QString &objectName)
+QGraphicsObject *findObject(QGraphicsObject *parent, const QString &objectName)
{
QList<QGraphicsItem *> children = parent->childItems();
for (int i = 0; i < children.count(); ++i) {
@@ -263,6 +264,105 @@ void tst_qdeclarativeanchors::basicAnchorsQGraphicsWidget()
delete view;
}
+QDeclarativeItem* childItem(QDeclarativeItem *parentItem, const char * itemString) {
+ return findItem<QDeclarativeItem>(parentItem, QLatin1String(itemString));
+}
+
+qreal offsetMasterRTL(QDeclarativeItem *rootItem, const char * itemString) {
+ QDeclarativeItem* masterItem = findItem<QDeclarativeItem>(rootItem, QLatin1String("masterRect"));
+ return masterItem->width()+2*masterItem->x()-findItem<QDeclarativeItem>(rootItem, QLatin1String(itemString))->width();
+}
+
+qreal offsetParentRTL(QDeclarativeItem *rootItem, const char * itemString) {
+ return rootItem->width()+2*rootItem->x()-findItem<QDeclarativeItem>(rootItem, QLatin1String(itemString))->width();
+}
+
+void mirrorAnchors(QDeclarativeItem *item) {
+ QDeclarativeItemPrivate *itemPrivate = QDeclarativeItemPrivate::get(item);
+ itemPrivate->setLayoutMirror(true);
+}
+
+void tst_qdeclarativeanchors::basicAnchorsRTL()
+{
+ QDeclarativeView *view = new QDeclarativeView;
+ view->setSource(QUrl::fromLocalFile(SRCDIR "/data/anchors.qml"));
+
+ qApp->processEvents();
+
+ QDeclarativeItem* rootItem = qobject_cast<QDeclarativeItem*>(view->rootObject());
+ foreach(QObject *child, rootItem->children()) {
+ bool mirrored = QDeclarativeItemPrivate::get(qobject_cast<QDeclarativeItem*>(child))->anchors()->property("mirrored").toBool();
+ QCOMPARE(mirrored, false);
+ }
+
+ foreach(QObject *child, rootItem->children())
+ mirrorAnchors(qobject_cast<QDeclarativeItem*>(child));
+
+ foreach(QObject *child, rootItem->children()) {
+ bool mirrored = QDeclarativeItemPrivate::get(qobject_cast<QDeclarativeItem*>(child))->anchors()->property("mirrored").toBool();
+ QCOMPARE(mirrored, true);
+ }
+
+ //sibling horizontal
+ QCOMPARE(childItem(rootItem, "rect1")->x(), offsetMasterRTL(rootItem, "rect1")-26.0);
+ QCOMPARE(childItem(rootItem, "rect2")->x(), offsetMasterRTL(rootItem, "rect2")-122.0);
+ QCOMPARE(childItem(rootItem, "rect3")->x(), offsetMasterRTL(rootItem, "rect3")-74.0);
+ QCOMPARE(childItem(rootItem, "rect4")->x(), offsetMasterRTL(rootItem, "rect4")-16.0);
+ QCOMPARE(childItem(rootItem, "rect5")->x(), offsetMasterRTL(rootItem, "rect5")-112.0);
+ QCOMPARE(childItem(rootItem, "rect6")->x(), offsetMasterRTL(rootItem, "rect6")-64.0);
+
+ //parent horizontal
+ QCOMPARE(childItem(rootItem, "rect7")->x(), offsetParentRTL(rootItem, "rect7")-0.0);
+ QCOMPARE(childItem(rootItem, "rect8")->x(), offsetParentRTL(rootItem, "rect8")-240.0);
+ QCOMPARE(childItem(rootItem, "rect9")->x(), offsetParentRTL(rootItem, "rect9")-120.0);
+ QCOMPARE(childItem(rootItem, "rect10")->x(), offsetParentRTL(rootItem, "rect10")+10.0);
+ QCOMPARE(childItem(rootItem, "rect11")->x(), offsetParentRTL(rootItem, "rect11")-230.0);
+ QCOMPARE(childItem(rootItem, "rect12")->x(), offsetParentRTL(rootItem, "rect12")-110.0);
+
+ //vertical
+ QCOMPARE(childItem(rootItem, "rect13")->y(), 20.0);
+ QCOMPARE(childItem(rootItem, "rect14")->y(), 155.0);
+
+ //stretch
+ QCOMPARE(childItem(rootItem, "rect15")->x(), offsetMasterRTL(rootItem, "rect15")-26.0);
+ QCOMPARE(childItem(rootItem, "rect15")->width(), 96.0);
+ QCOMPARE(childItem(rootItem, "rect16")->x(), offsetMasterRTL(rootItem, "rect16")-26.0);
+ QCOMPARE(childItem(rootItem, "rect16")->width(), 192.0);
+ QCOMPARE(childItem(rootItem, "rect17")->x(), offsetMasterRTL(rootItem, "rect17")+70.0);
+ QCOMPARE(childItem(rootItem, "rect17")->width(), 192.0);
+
+ //vertical stretch
+ QCOMPARE(childItem(rootItem, "rect18")->y(), 20.0);
+ QCOMPARE(childItem(rootItem, "rect18")->height(), 40.0);
+
+ //more parent horizontal
+ QCOMPARE(childItem(rootItem, "rect19")->x(), offsetParentRTL(rootItem, "rect19")-115.0);
+ QCOMPARE(childItem(rootItem, "rect20")->x(), offsetParentRTL(rootItem, "rect20")-235.0);
+ QCOMPARE(childItem(rootItem, "rect21")->x(), offsetParentRTL(rootItem, "rect21")+5.0);
+
+ //centerIn
+ QCOMPARE(childItem(rootItem, "rect22")->x(), offsetMasterRTL(rootItem, "rect22")-69.0);
+ QCOMPARE(childItem(rootItem, "rect22")->y(), 5.0);
+
+ //margins
+ QCOMPARE(childItem(rootItem, "rect23")->x(), offsetMasterRTL(rootItem, "rect23")-31.0);
+ QCOMPARE(childItem(rootItem, "rect23")->y(), 5.0);
+ QCOMPARE(childItem(rootItem, "rect23")->width(), 86.0);
+ QCOMPARE(childItem(rootItem, "rect23")->height(), 10.0);
+
+ // offsets
+ QCOMPARE(childItem(rootItem, "rect24")->x(), offsetMasterRTL(rootItem, "rect24")-26.0);
+ QCOMPARE(childItem(rootItem, "rect25")->y(), 60.0);
+ QCOMPARE(childItem(rootItem, "rect26")->y(), 5.0);
+
+ //baseline
+ QDeclarativeText *text1 = findItem<QDeclarativeText>(rootItem, QLatin1String("text1"));
+ QDeclarativeText *text2 = findItem<QDeclarativeText>(rootItem, QLatin1String("text2"));
+ QCOMPARE(text1->y(), text2->y());
+
+ delete view;
+}
+
// mostly testing that we don't crash
void tst_qdeclarativeanchors::loops()
{
@@ -514,6 +614,31 @@ void tst_qdeclarativeanchors::fill()
delete view;
}
+void tst_qdeclarativeanchors::fillRTL()
+{
+ QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/fill.qml"));
+
+ qApp->processEvents();
+ QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("filler"));
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ mirrorAnchors(rect);
+
+ QCOMPARE(rect->x(), 0.0 + 20.0);
+ QCOMPARE(rect->y(), 0.0 + 30.0);
+ QCOMPARE(rect->width(), 200.0 - 10.0 - 20.0);
+ QCOMPARE(rect->height(), 200.0 - 30.0 - 40.0);
+ //Alter Offsets (tests QTBUG-6631)
+ rectPrivate->anchors()->setLeftMargin(20.0);
+ rectPrivate->anchors()->setRightMargin(0.0);
+ rectPrivate->anchors()->setBottomMargin(0.0);
+ rectPrivate->anchors()->setTopMargin(10.0);
+ QCOMPARE(rect->x(), 0.0 + 0.0);
+ QCOMPARE(rect->y(), 0.0 + 10.0);
+ QCOMPARE(rect->width(), 200.0 - 20.0);
+ QCOMPARE(rect->height(), 200.0 - 10.0);
+
+ delete view;
+}
void tst_qdeclarativeanchors::centerIn()
{
QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/centerin.qml"));
@@ -521,6 +646,7 @@ void tst_qdeclarativeanchors::centerIn()
qApp->processEvents();
QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("centered"));
QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
QCOMPARE(rect->x(), 75.0 + 10);
QCOMPARE(rect->y(), 75.0 + 30);
//Alter Offsets (tests QTBUG-6631)
@@ -532,6 +658,27 @@ void tst_qdeclarativeanchors::centerIn()
delete view;
}
+
+void tst_qdeclarativeanchors::centerInRTL()
+{
+ QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/centerin.qml"));
+
+ qApp->processEvents();
+ QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("centered"));
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ mirrorAnchors(rect);
+
+ QCOMPARE(rect->x(), 75.0 - 10);
+ QCOMPARE(rect->y(), 75.0 + 30);
+ //Alter Offsets (tests QTBUG-6631)
+ rectPrivate->anchors()->setHorizontalCenterOffset(-20.0);
+ rectPrivate->anchors()->setVerticalCenterOffset(-10.0);
+ QCOMPARE(rect->x(), 75.0 + 20.0);
+ QCOMPARE(rect->y(), 75.0 - 10.0);
+
+ delete view;
+}
+
void tst_qdeclarativeanchors::hvCenter()
{
QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/hvCenter.qml"));
@@ -539,12 +686,39 @@ void tst_qdeclarativeanchors::hvCenter()
qApp->processEvents();
QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("centered"));
QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
// test QTBUG-10999
QCOMPARE(rect->x(), 10.0);
QCOMPARE(rect->y(), 19.0);
+
+ rectPrivate->anchors()->setHorizontalCenterOffset(-5.0);
+ rectPrivate->anchors()->setVerticalCenterOffset(5.0);
+ QCOMPARE(rect->x(), 10.0 - 5.0);
+ QCOMPARE(rect->y(), 19.0 + 5.0);
+
delete view;
}
+void tst_qdeclarativeanchors::hvCenterRTL()
+{
+ QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/hvCenter.qml"));
+
+ qApp->processEvents();
+ QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("centered"));
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ mirrorAnchors(rect);
+
+ // test QTBUG-10999
+ QCOMPARE(rect->x(), 10.0);
+ QCOMPARE(rect->y(), 19.0);
+
+ rectPrivate->anchors()->setHorizontalCenterOffset(-5.0);
+ rectPrivate->anchors()->setVerticalCenterOffset(5.0);
+ QCOMPARE(rect->x(), 10.0 + 5.0);
+ QCOMPARE(rect->y(), 19.0 + 5.0);
+
+ delete view;
+}
void tst_qdeclarativeanchors::margins()
{
QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/margins.qml"));
@@ -568,6 +742,31 @@ void tst_qdeclarativeanchors::margins()
delete view;
}
+void tst_qdeclarativeanchors::marginsRTL()
+{
+ QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/margins.qml"));
+
+ QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("filler"));
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ mirrorAnchors(rect);
+
+ QCOMPARE(rect->x(), 10.0);
+ QCOMPARE(rect->y(), 6.0);
+ QCOMPARE(rect->width(), 200.0 - 5.0 - 10.0);
+ QCOMPARE(rect->height(), 200.0 - 6.0 - 10.0);
+
+ rectPrivate->anchors()->setTopMargin(0.0);
+ rectPrivate->anchors()->setMargins(20.0);
+
+ QCOMPARE(rect->x(), 20.0);
+ QCOMPARE(rect->y(), 20.0);
+ QCOMPARE(rect->width(), 200.0 - 5.0 - 20.0);
+ QCOMPARE(rect->height(), 200.0 - 20.0 - 20.0);
+
+ delete view;
+}
+
+
QTEST_MAIN(tst_qdeclarativeanchors)
#include "tst_qdeclarativeanchors.moc"
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp b/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp
index 104ee15..7d1b807 100644
--- a/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp
+++ b/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp
@@ -46,6 +46,7 @@
#include <private/qdeclarativeimage_p.h>
#include <private/qdeclarativeanimatedimage_p.h>
#include <QSignalSpy>
+#include <QtDeclarative/qdeclarativecontext.h>
#include "../shared/testhttpserver.h"
#include "../../../shared/util.h"
@@ -76,6 +77,7 @@ private slots:
void sourceSizeReadOnly();
void invalidSource();
void qtbug_16520();
+ void progressAndStatusChanges();
private:
QPixmap grabScene(QGraphicsScene *scene, int width, int height);
@@ -333,6 +335,53 @@ void tst_qdeclarativeanimatedimage::qtbug_16520()
delete anim;
}
+void tst_qdeclarativeanimatedimage::progressAndStatusChanges()
+{
+ TestHTTPServer server(14449);
+ QVERIFY(server.isValid());
+ server.serveDirectory(SRCDIR "/data");
+
+ QDeclarativeEngine engine;
+ QString componentStr = "import QtQuick 1.0\nAnimatedImage { source: srcImage }";
+ QDeclarativeContext *ctxt = engine.rootContext();
+ ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/stickman.gif"));
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QVERIFY(obj != 0);
+ QVERIFY(obj->status() == QDeclarativeImage::Ready);
+ QTRY_VERIFY(obj->progress() == 1.0);
+
+ QSignalSpy sourceSpy(obj, SIGNAL(sourceChanged(const QUrl &)));
+ QSignalSpy progressSpy(obj, SIGNAL(progressChanged(qreal)));
+ QSignalSpy statusSpy(obj, SIGNAL(statusChanged(QDeclarativeImageBase::Status)));
+
+ // Loading local file
+ ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.gif"));
+ QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready);
+ QTRY_VERIFY(obj->progress() == 1.0);
+ QTRY_COMPARE(sourceSpy.count(), 1);
+ QTRY_COMPARE(progressSpy.count(), 0);
+ QTRY_COMPARE(statusSpy.count(), 0);
+
+ // Loading remote file
+ ctxt->setContextProperty("srcImage", "http://127.0.0.1:14449/stickman.gif");
+ QTRY_VERIFY(obj->status() == QDeclarativeImage::Loading);
+ QTRY_VERIFY(obj->progress() == 0.0);
+ QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready);
+ QTRY_VERIFY(obj->progress() == 1.0);
+ QTRY_COMPARE(sourceSpy.count(), 2);
+ QTRY_VERIFY(progressSpy.count() > 1);
+ QTRY_COMPARE(statusSpy.count(), 2);
+
+ ctxt->setContextProperty("srcImage", "");
+ QTRY_VERIFY(obj->status() == QDeclarativeImage::Null);
+ QTRY_VERIFY(obj->progress() == 0.0);
+ QTRY_COMPARE(sourceSpy.count(), 3);
+ QTRY_VERIFY(progressSpy.count() > 2);
+ QTRY_COMPARE(statusSpy.count(), 3);
+}
+
QTEST_MAIN(tst_qdeclarativeanimatedimage)
#include "tst_qdeclarativeanimatedimage.moc"
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/writeAttachedProperty.qml b/tests/auto/declarative/qdeclarativeecmascript/data/writeAttachedProperty.qml
new file mode 100644
index 0000000..31bf69d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/writeAttachedProperty.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+QtObject {
+ function writeValue2() { MyQmlObject.value2 = 9 }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
index 40b0e1b..48466d5 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
+++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
@@ -639,15 +639,29 @@ void tst_qdeclarativeecmascript::overrideExtensionProperties()
void tst_qdeclarativeecmascript::attachedProperties()
{
- QDeclarativeComponent component(&engine, TEST_FILE("attachedProperty.qml"));
- QObject *object = component.create();
- QVERIFY(object != 0);
- QCOMPARE(object->property("a").toInt(), 19);
- QCOMPARE(object->property("b").toInt(), 19);
- QCOMPARE(object->property("c").toInt(), 19);
- QCOMPARE(object->property("d").toInt(), 19);
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("attachedProperty.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(object->property("a").toInt(), 19);
+ QCOMPARE(object->property("b").toInt(), 19);
+ QCOMPARE(object->property("c").toInt(), 19);
+ QCOMPARE(object->property("d").toInt(), 19);
+ }
- // ### Need to test attached property assignment
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("writeAttachedProperty.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QMetaObject::invokeMethod(object, "writeValue2");
+
+ MyQmlAttachedObject *attached =
+ qobject_cast<MyQmlAttachedObject *>(qmlAttachedPropertiesObject<MyQmlObject>(object));
+ QVERIFY(attached != 0);
+
+ QCOMPARE(attached->value2(), 9);
+ }
}
void tst_qdeclarativeecmascript::enums()
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/disabledcontent.qml b/tests/auto/declarative/qdeclarativeflickable/data/disabledcontent.qml
new file mode 100644
index 0000000..dcbb20b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeflickable/data/disabledcontent.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+Flickable {
+ width: 100; height: 100
+ contentWidth: 200; contentHeight: 300
+
+ QGraphicsWidget { width: 200; height: 300; enabled: false }
+}
diff --git a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
index 736f8f4..d499edf 100644
--- a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
+++ b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
@@ -69,6 +69,7 @@ private slots:
void maximumFlickVelocity();
void flickDeceleration();
void pressDelay();
+ void disabledContent();
void nestedPressDelay();
void flickableDirection();
void qgraphicswidget();
@@ -247,6 +248,44 @@ void tst_qdeclarativeflickable::pressDelay()
QCOMPARE(spy.count(),1);
}
+// QT-4677
+void tst_qdeclarativeflickable::disabledContent()
+{
+ QDeclarativeView *canvas = new QDeclarativeView;
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/disabledcontent.qml"));
+ canvas->show();
+ canvas->setFocus();
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeFlickable *flickable = qobject_cast<QDeclarativeFlickable*>(canvas->rootObject());
+ QVERIFY(flickable != 0);
+
+ QVERIFY(flickable->contentX() == 0);
+ QVERIFY(flickable->contentY() == 0);
+
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(50, 50)));
+ {
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(70,70)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ }
+ {
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(90,90)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ }
+ {
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(100,100)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ }
+
+ QVERIFY(flickable->contentX() < 0);
+ QVERIFY(flickable->contentY() < 0);
+
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(90, 90)));
+
+ delete canvas;
+}
+
+
// QTBUG-17361
void tst_qdeclarativeflickable::nestedPressDelay()
{
@@ -267,8 +306,8 @@ void tst_qdeclarativeflickable::nestedPressDelay()
QVERIFY(outer->property("pressed").toBool() == false);
// The outer pressDelay will prevail (50ms, vs. 10sec)
- QTest::qWait(300);
- QVERIFY(outer->property("pressed").toBool() == true);
+ // QTRY_VERIFY() has 5sec timeout, so will timeout well within 10sec.
+ QTRY_VERIFY(outer->property("pressed").toBool() == true);
QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(150, 150)));
diff --git a/tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp b/tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp
index a62ea31..ffd5d38 100644
--- a/tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp
+++ b/tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp
@@ -62,14 +62,24 @@ class tst_qdeclarativefolderlistmodel : public QObject
{
Q_OBJECT
public:
- tst_qdeclarativefolderlistmodel() {}
+ tst_qdeclarativefolderlistmodel() : removeStart(0), removeEnd(0) {}
+
+public slots:
+ void removed(const QModelIndex &, int start, int end) {
+ removeStart = start;
+ removeEnd = end;
+ }
private slots:
void basicProperties();
+ void refresh();
private:
void checkNoErrors(const QDeclarativeComponent& component);
QDeclarativeEngine engine;
+
+ int removeStart;
+ int removeEnd;
};
void tst_qdeclarativefolderlistmodel::checkNoErrors(const QDeclarativeComponent& component)
@@ -115,6 +125,28 @@ void tst_qdeclarativefolderlistmodel::basicProperties()
QCOMPARE(flm->property("folder").toUrl(), QUrl::fromLocalFile(""));
}
+void tst_qdeclarativefolderlistmodel::refresh()
+{
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/basic.qml"));
+ checkNoErrors(component);
+
+ QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
+ QVERIFY(flm != 0);
+
+ flm->setProperty("folder",QUrl::fromLocalFile(SRCDIR "/data"));
+ QTRY_COMPARE(flm->property("count").toInt(),2); // wait for refresh
+
+ int count = flm->rowCount();
+
+ connect(flm, SIGNAL(rowsRemoved(const QModelIndex&,int,int)),
+ this, SLOT(removed(const QModelIndex&,int,int)));
+
+ flm->setProperty("sortReversed", true);
+
+ QCOMPARE(removeStart, 0);
+ QCOMPARE(removeEnd, count-1);
+}
+
QTEST_MAIN(tst_qdeclarativefolderlistmodel)
#include "tst_qdeclarativefolderlistmodel.moc"
diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml b/tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml
index 5719f43..69eaa47 100644
--- a/tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml
+++ b/tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 1.1
Rectangle {
width: 240
@@ -48,6 +48,8 @@ Rectangle {
model: testModel
delegate: myDelegate
highlight: myHighlight
+ flow: (testTopToBottom == true) ? GridView.TopToBottom : GridView.LeftToRight
+ layoutDirection: (testRightToLeft == true) ? Qt.RightToLeft : Qt.LeftToRight
preferredHighlightBegin: 100
preferredHighlightEnd: 100
highlightRangeMode: "StrictlyEnforceRange"
diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview1.qml b/tests/auto/declarative/qdeclarativegridview/data/gridview1.qml
index e4e699c..caa28d6 100644
--- a/tests/auto/declarative/qdeclarativegridview/data/gridview1.qml
+++ b/tests/auto/declarative/qdeclarativegridview/data/gridview1.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.0
+import QtQuick 1.1
Rectangle {
id: root
@@ -55,7 +55,8 @@ Rectangle {
height: 320
cellWidth: 80
cellHeight: 60
- flow: (testTopToBottom == false) ? "LeftToRight" : "TopToBottom"
+ flow: (testTopToBottom == false) ? GridView.LeftToRight : GridView.TopToBottom
+ layoutDirection: (testRightToLeft == true) ? Qt.RightToLeft : Qt.LeftToRight
model: testModel
delegate: myDelegate
header: root.showHeader ? headerFooter : null
diff --git a/tests/auto/declarative/qdeclarativegridview/data/mirroring.qml b/tests/auto/declarative/qdeclarativegridview/data/mirroring.qml
new file mode 100644
index 0000000..54de16b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativegridview/data/mirroring.qml
@@ -0,0 +1,43 @@
+// This example demonstrates how item positioning
+// changes in right-to-left layout direction
+
+import QtQuick 1.1
+
+Rectangle {
+ color: "lightgray"
+ width: 340
+ height: 370
+
+ VisualItemModel {
+ id: itemModel
+ objectName: "itemModel"
+ Rectangle {
+ objectName: "item1"
+ height: 110; width: 120; color: "#FFFEF0"
+ Text { objectName: "text1"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ objectName: "item2"
+ height: 130; width: 150; color: "#F0FFF7"
+ Text { objectName: "text2"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ objectName: "item3"
+ height: 170; width: 190; color: "#F4F0FF"
+ Text { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ }
+
+ GridView {
+ id: view
+ objectName: "view"
+ cellWidth: 190
+ cellHeight: 170
+ anchors.fill: parent
+ anchors.bottomMargin: 30
+ model: itemModel
+ highlightRangeMode: "StrictlyEnforceRange"
+ flow: GridView.TopToBottom
+ flickDeceleration: 2000
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
index 79189a7..c183934 100644
--- a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
+++ b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
@@ -46,6 +46,7 @@
#include <QtDeclarative/qdeclarativecomponent.h>
#include <QtDeclarative/qdeclarativecontext.h>
#include <QtDeclarative/qdeclarativeexpression.h>
+#include <QtDeclarative/private/qdeclarativeitem_p.h>
#include <QtDeclarative/private/qlistmodelinterface_p.h>
#include <QtDeclarative/private/qdeclarativegridview_p.h>
#include <QtDeclarative/private/qdeclarativetext_p.h>
@@ -68,6 +69,7 @@ private slots:
void changed();
void inserted();
void removed();
+ void clear();
void moved();
void changeFlow();
void currentIndex();
@@ -78,9 +80,12 @@ private slots:
void componentChanges();
void modelChanges();
void positionViewAtIndex();
+ void positionViewAtIndex_rightToLeft();
+ void mirroring();
void snapping();
void resetModel();
void enforceRange();
+ void enforceRange_rightToLeft();
void QTBUG_8456();
void manualHighlight();
void footer();
@@ -203,6 +208,7 @@ void tst_QDeclarativeGridView::items()
QDeclarativeContext *ctxt = canvas->rootContext();
ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
ctxt->setContextProperty("testTopToBottom", QVariant(false));
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
@@ -251,6 +257,7 @@ void tst_QDeclarativeGridView::changed()
QDeclarativeContext *ctxt = canvas->rootContext();
ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
ctxt->setContextProperty("testTopToBottom", QVariant(false));
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
@@ -284,6 +291,7 @@ void tst_QDeclarativeGridView::inserted()
QDeclarativeContext *ctxt = canvas->rootContext();
ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
ctxt->setContextProperty("testTopToBottom", QVariant(false));
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
@@ -360,6 +368,7 @@ void tst_QDeclarativeGridView::removed()
QDeclarativeContext *ctxt = canvas->rootContext();
ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
ctxt->setContextProperty("testTopToBottom", QVariant(false));
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
@@ -493,6 +502,44 @@ void tst_QDeclarativeGridView::removed()
delete canvas;
}
+void tst_QDeclarativeGridView::clear()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
+ ctxt->setContextProperty("testTopToBottom", QVariant(false));
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QVERIFY(gridview != 0);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QVERIFY(contentItem != 0);
+
+ model.clear();
+
+ QVERIFY(gridview->count() == 0);
+ QVERIFY(gridview->currentItem() == 0);
+ QVERIFY(gridview->contentY() == 0);
+ QVERIFY(gridview->currentIndex() == -1);
+
+ // confirm sanity when adding an item to cleared list
+ model.addItem("New", "1");
+ QVERIFY(gridview->count() == 1);
+ QVERIFY(gridview->currentItem() != 0);
+ QVERIFY(gridview->currentIndex() == 0);
+
+ delete canvas;
+}
+
void tst_QDeclarativeGridView::moved()
{
QDeclarativeView *canvas = createView();
@@ -503,6 +550,7 @@ void tst_QDeclarativeGridView::moved()
QDeclarativeContext *ctxt = canvas->rootContext();
ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
ctxt->setContextProperty("testTopToBottom", QVariant(false));
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
@@ -726,6 +774,58 @@ void tst_QDeclarativeGridView::currentIndex()
QVERIFY(!gridview->highlightItem());
QVERIFY(!gridview->currentItem());
+ gridview->setHighlightFollowsCurrentItem(true);
+
+ gridview->setFlow(QDeclarativeGridView::LeftToRight);
+ gridview->setLayoutDirection(Qt::RightToLeft);
+
+ qApp->setActiveWindow(canvas);
+#ifdef Q_WS_X11
+ // to be safe and avoid failing setFocus with window managers
+ qt_x11_wait_for_window_manager(canvas);
+#endif
+ QTRY_VERIFY(canvas->hasFocus());
+ QTRY_VERIFY(canvas->scene()->hasFocus());
+ qApp->processEvents();
+
+ gridview->setCurrentIndex(35);
+
+ QTest::keyClick(canvas, Qt::Key_Right);
+ QCOMPARE(gridview->currentIndex(), 34);
+
+ QTest::keyClick(canvas, Qt::Key_Down);
+ QCOMPARE(gridview->currentIndex(), 37);
+
+ QTest::keyClick(canvas, Qt::Key_Up);
+ QCOMPARE(gridview->currentIndex(), 34);
+
+ QTest::keyClick(canvas, Qt::Key_Left);
+ QCOMPARE(gridview->currentIndex(), 35);
+
+
+ // turn off auto highlight
+ gridview->setHighlightFollowsCurrentItem(false);
+ QVERIFY(gridview->highlightFollowsCurrentItem() == false);
+ QVERIFY(gridview->highlightItem());
+ hlPosX = gridview->highlightItem()->x();
+ hlPosY = gridview->highlightItem()->y();
+
+ gridview->setCurrentIndex(5);
+ QTRY_COMPARE(gridview->highlightItem()->x(), hlPosX);
+ QTRY_COMPARE(gridview->highlightItem()->y(), hlPosY);
+
+ // insert item before currentIndex
+ gridview->setCurrentIndex(28);
+ model.insertItem(0, "Foo", "1111");
+ QTRY_COMPARE(canvas->rootObject()->property("current").toInt(), 29);
+
+ // check removing highlight by setting currentIndex to -1;
+ gridview->setCurrentIndex(-1);
+
+ QCOMPARE(gridview->currentIndex(), -1);
+ QVERIFY(!gridview->highlightItem());
+ QVERIFY(!gridview->currentItem());
+
delete canvas;
}
@@ -774,6 +874,7 @@ void tst_QDeclarativeGridView::changeFlow()
QDeclarativeContext *ctxt = canvas->rootContext();
ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
ctxt->setContextProperty("testTopToBottom", QVariant(false));
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
@@ -819,6 +920,44 @@ void tst_QDeclarativeGridView::changeFlow()
QTRY_COMPARE(number->text(), model.number(i));
}
+ ctxt->setContextProperty("testRightToLeft", QVariant(true));
+
+ // Confirm items positioned correctly and indexes correct
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal(-(i/5)*80 - item->width()));
+ QTRY_COMPARE(item->y(), qreal((i%5)*60));
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(i));
+ QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(i));
+ }
+ gridview->setContentX(100);
+ QTRY_COMPARE(gridview->contentX(), 100.);
+ ctxt->setContextProperty("testTopToBottom", QVariant(false));
+ QTRY_COMPARE(gridview->contentX(), 0.);
+
+ // Confirm items positioned correctly and indexes correct
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal(240 - (i%3+1)*80));
+ QTRY_COMPARE(item->y(), qreal((i/3)*60));
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(i));
+ QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(i));
+ }
+
delete canvas;
}
@@ -879,6 +1018,7 @@ void tst_QDeclarativeGridView::propertyChanges()
QSignalSpy keyNavigationWrapsSpy(gridView, SIGNAL(keyNavigationWrapsChanged()));
QSignalSpy cacheBufferSpy(gridView, SIGNAL(cacheBufferChanged()));
+ QSignalSpy layoutSpy(gridView, SIGNAL(layoutDirectionChanged()));
QSignalSpy flowSpy(gridView, SIGNAL(flowChanged()));
QTRY_COMPARE(gridView->isWrapEnabled(), true);
@@ -905,6 +1045,38 @@ void tst_QDeclarativeGridView::propertyChanges()
QTRY_COMPARE(cacheBufferSpy.count(),1);
QTRY_COMPARE(flowSpy.count(),1);
+ gridView->setFlow(QDeclarativeGridView::LeftToRight);
+ QTRY_COMPARE(gridView->flow(), QDeclarativeGridView::LeftToRight);
+
+ gridView->setWrapEnabled(true);
+ gridView->setCacheBuffer(5);
+ gridView->setLayoutDirection(Qt::RightToLeft);
+
+ QTRY_COMPARE(gridView->isWrapEnabled(), true);
+ QTRY_COMPARE(gridView->cacheBuffer(), 5);
+ QTRY_COMPARE(gridView->layoutDirection(), Qt::RightToLeft);
+
+ QTRY_COMPARE(keyNavigationWrapsSpy.count(),2);
+ QTRY_COMPARE(cacheBufferSpy.count(),2);
+ QTRY_COMPARE(layoutSpy.count(),1);
+ QTRY_COMPARE(flowSpy.count(),2);
+
+ gridView->setWrapEnabled(true);
+ gridView->setCacheBuffer(5);
+ gridView->setLayoutDirection(Qt::RightToLeft);
+
+ QTRY_COMPARE(keyNavigationWrapsSpy.count(),2);
+ QTRY_COMPARE(cacheBufferSpy.count(),2);
+ QTRY_COMPARE(layoutSpy.count(),1);
+ QTRY_COMPARE(flowSpy.count(),2);
+
+ gridView->setFlow(QDeclarativeGridView::TopToBottom);
+ QTRY_COMPARE(gridView->flow(), QDeclarativeGridView::TopToBottom);
+ QTRY_COMPARE(flowSpy.count(),3);
+
+ gridView->setFlow(QDeclarativeGridView::TopToBottom);
+ QTRY_COMPARE(flowSpy.count(),3);
+
delete canvas;
}
@@ -992,6 +1164,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex()
QDeclarativeContext *ctxt = canvas->rootContext();
ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
ctxt->setContextProperty("testTopToBottom", QVariant(false));
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
@@ -1185,6 +1358,7 @@ void tst_QDeclarativeGridView::snapping()
QDeclarativeContext *ctxt = canvas->rootContext();
ctxt->setContextProperty("testModel", &model);
ctxt->setContextProperty("testTopToBottom", QVariant(false));
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
qApp->processEvents();
@@ -1211,6 +1385,200 @@ void tst_QDeclarativeGridView::snapping()
QCOMPARE(gridview->contentY(), 120.);
delete canvas;
+
+}
+
+void tst_QDeclarativeGridView::mirroring()
+{
+ QDeclarativeView *canvasA = createView();
+ canvasA->setSource(QUrl::fromLocalFile(SRCDIR "/data/mirroring.qml"));
+ QDeclarativeGridView *gridviewA = findItem<QDeclarativeGridView>(canvasA->rootObject(), "view");
+ QTRY_VERIFY(gridviewA != 0);
+
+ QDeclarativeView *canvasB = createView();
+ canvasB->setSource(QUrl::fromLocalFile(SRCDIR "/data/mirroring.qml"));
+ QDeclarativeGridView *gridviewB = findItem<QDeclarativeGridView>(canvasB->rootObject(), "view");
+ QTRY_VERIFY(gridviewA != 0);
+ qApp->processEvents();
+
+ QList<QString> objectNames;
+ objectNames << "item1" << "item2"; // << "item3"
+
+ gridviewA->setProperty("layoutDirection", Qt::LeftToRight);
+ gridviewB->setProperty("layoutDirection", Qt::RightToLeft);
+ QCOMPARE(gridviewA->layoutDirection(), gridviewA->effectiveLayoutDirection());
+
+ // LTR != RTL
+ foreach(const QString objectName, objectNames)
+ QVERIFY(findItem<QDeclarativeItem>(gridviewA, objectName)->x() != findItem<QDeclarativeItem>(gridviewB, objectName)->x());
+
+ gridviewA->setProperty("layoutDirection", Qt::LeftToRight);
+ gridviewB->setProperty("layoutDirection", Qt::LeftToRight);
+
+ // LTR == LTR
+ foreach(const QString objectName, objectNames)
+ QCOMPARE(findItem<QDeclarativeItem>(gridviewA, objectName)->x(), findItem<QDeclarativeItem>(gridviewB, objectName)->x());
+
+ QVERIFY(gridviewB->layoutDirection() == gridviewB->effectiveLayoutDirection());
+ QDeclarativeItemPrivate::get(gridviewB)->setLayoutMirror(true);
+ QVERIFY(gridviewB->layoutDirection() != gridviewB->effectiveLayoutDirection());
+
+ // LTR != LTR+mirror
+ foreach(const QString objectName, objectNames)
+ QVERIFY(findItem<QDeclarativeItem>(gridviewA, objectName)->x() != findItem<QDeclarativeItem>(gridviewB, objectName)->x());
+
+ gridviewA->setProperty("layoutDirection", Qt::RightToLeft);
+
+ // RTL == LTR+mirror
+ foreach(const QString objectName, objectNames)
+ QCOMPARE(findItem<QDeclarativeItem>(gridviewA, objectName)->x(), findItem<QDeclarativeItem>(gridviewB, objectName)->x());
+
+ gridviewB->setProperty("layoutDirection", Qt::RightToLeft);
+
+ // RTL != RTL+mirror
+ foreach(const QString objectName, objectNames)
+ QVERIFY(findItem<QDeclarativeItem>(gridviewA, objectName)->x() != findItem<QDeclarativeItem>(gridviewB, objectName)->x());
+
+ gridviewA->setProperty("layoutDirection", Qt::LeftToRight);
+
+ // LTR == RTL+mirror
+ foreach(const QString objectName, objectNames)
+ QCOMPARE(findItem<QDeclarativeItem>(gridviewA, objectName)->x(), findItem<QDeclarativeItem>(gridviewB, objectName)->x());
+
+ delete canvasA;
+ delete canvasB;
+}
+
+void tst_QDeclarativeGridView::positionViewAtIndex_rightToLeft()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 40; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testTopToBottom", QVariant(true));
+ ctxt->setContextProperty("testRightToLeft", QVariant(true));
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QTRY_VERIFY(gridview != 0);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ // Confirm items positioned correctly
+ int itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal(-(i/5)*80-item->width()));
+ QTRY_COMPARE(item->y(), qreal((i%5)*60));
+ }
+
+ // Position on a currently visible item
+ gridview->positionViewAtIndex(6, QDeclarativeGridView::Beginning);
+ QTRY_COMPARE(gridview->contentX(), -320.);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 3; i < model.count() && i < itemCount-3-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal(-(i/5)*80-item->width()));
+ QTRY_COMPARE(item->y(), qreal((i%5)*60));
+ }
+
+ // Position on an item beyond the visible items
+ gridview->positionViewAtIndex(21, QDeclarativeGridView::Beginning);
+ QTRY_COMPARE(gridview->contentX(), -560.);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 22; i < model.count() && i < itemCount-22-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal(-(i/5)*80-item->width()));
+ QTRY_COMPARE(item->y(), qreal((i%5)*60));
+ }
+
+ // Position on an item that would leave empty space if positioned at the top
+ gridview->positionViewAtIndex(31, QDeclarativeGridView::Beginning);
+ QTRY_COMPARE(gridview->contentX(), -639.);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 24; i < model.count() && i < itemCount-24-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal(-(i/5)*80-item->width()));
+ QTRY_COMPARE(item->y(), qreal((i%5)*60));
+ }
+
+ // Position at the beginning again
+ gridview->positionViewAtIndex(0, QDeclarativeGridView::Beginning);
+ QTRY_COMPARE(gridview->contentX(), -240.);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal(-(i/5)*80-item->width()));
+ QTRY_COMPARE(item->y(), qreal((i%5)*60));
+ }
+
+ // Position at End
+ gridview->positionViewAtIndex(30, QDeclarativeGridView::End);
+ QTRY_COMPARE(gridview->contentX(), -560.);
+
+ // Position in Center
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Center);
+ QTRY_COMPARE(gridview->contentX(), -400.);
+
+ // Ensure at least partially visible
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible);
+ QTRY_COMPARE(gridview->contentX(), -400.);
+
+ gridview->setContentX(-555.);
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible);
+ QTRY_COMPARE(gridview->contentX(), -555.);
+
+ gridview->setContentX(-239);
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible);
+ QTRY_COMPARE(gridview->contentX(), -320.);
+
+ gridview->setContentX(-239);
+ gridview->positionViewAtIndex(20, QDeclarativeGridView::Visible);
+ QTRY_COMPARE(gridview->contentX(), -400.);
+
+ gridview->setContentX(-640);
+ gridview->positionViewAtIndex(20, QDeclarativeGridView::Visible);
+ QTRY_COMPARE(gridview->contentX(), -560.);
+
+ // Ensure completely visible
+ gridview->setContentX(-400);
+ gridview->positionViewAtIndex(20, QDeclarativeGridView::Contain);
+ QTRY_COMPARE(gridview->contentX(), -400.);
+
+ gridview->setContentX(-315);
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Contain);
+ QTRY_COMPARE(gridview->contentX(), -320.);
+
+ gridview->setContentX(-640);
+ gridview->positionViewAtIndex(20, QDeclarativeGridView::Contain);
+ QTRY_COMPARE(gridview->contentX(), -560.);
+
+ delete canvas;
}
void tst_QDeclarativeGridView::resetModel()
@@ -1264,9 +1632,12 @@ void tst_QDeclarativeGridView::enforceRange()
QDeclarativeContext *ctxt = canvas->rootContext();
ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
+ ctxt->setContextProperty("testTopToBottom", QVariant(false));
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview-enforcerange.qml"));
qApp->processEvents();
+ QVERIFY(canvas->rootObject() != 0);
QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
QTRY_VERIFY(gridview != 0);
@@ -1307,6 +1678,64 @@ void tst_QDeclarativeGridView::enforceRange()
delete canvas;
}
+void tst_QDeclarativeGridView::enforceRange_rightToLeft()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(true));
+ ctxt->setContextProperty("testTopToBottom", QVariant(true));
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview-enforcerange.qml"));
+ qApp->processEvents();
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QTRY_VERIFY(gridview != 0);
+
+ QTRY_COMPARE(gridview->preferredHighlightBegin(), 100.0);
+ QTRY_COMPARE(gridview->preferredHighlightEnd(), 100.0);
+ QTRY_COMPARE(gridview->highlightRangeMode(), QDeclarativeGridView::StrictlyEnforceRange);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ // view should be positioned at the top of the range.
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", 0);
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(gridview->contentX(), -100.);
+ QTRY_COMPARE(gridview->contentY(), 0.0);
+
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 0);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(0));
+ QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 0);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(0));
+
+ // Check currentIndex is updated when contentItem moves
+ gridview->setContentX(-200);
+ QTRY_COMPARE(gridview->currentIndex(), 3);
+
+ gridview->setCurrentIndex(7);
+ QTRY_COMPARE(gridview->contentX(), -300.);
+ QTRY_COMPARE(gridview->contentY(), 0.0);
+
+ TestModel model2;
+ for (int i = 0; i < 5; i++)
+ model2.addItem("Item" + QString::number(i), "");
+
+ ctxt->setContextProperty("testModel", &model2);
+ QCOMPARE(gridview->count(), 5);
+
+ delete canvas;
+}
+
void tst_QDeclarativeGridView::QTBUG_8456()
{
QDeclarativeView *canvas = createView();
@@ -1475,6 +1904,7 @@ void tst_QDeclarativeGridView::indexAt()
QDeclarativeContext *ctxt = canvas->rootContext();
ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
ctxt->setContextProperty("testTopToBottom", QVariant(false));
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
diff --git a/tests/auto/declarative/qdeclarativeimage/data/qtbug_16389.qml b/tests/auto/declarative/qdeclarativeimage/data/qtbug_16389.qml
new file mode 100644
index 0000000..29fba40
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeimage/data/qtbug_16389.qml
@@ -0,0 +1,30 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+
+ Item {
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.bottom: blueHandle.top
+ anchors.right: blueHandle.left
+
+ Image {
+ id: iconImage
+ objectName: "iconImage"
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ source: "heart200.png"
+ fillMode: Image.PreserveAspectFit
+ smooth: true
+ }
+ }
+
+ Rectangle {
+ id: blueHandle
+ objectName: "blueHandle"
+ color: "blue"
+ width: 25
+ height: 25
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
index f1fe2bd..9e090d2 100644
--- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
+++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
@@ -89,6 +89,7 @@ private slots:
void noLoading();
void paintedWidthHeight();
void sourceSize_QTBUG_14303();
+ void sourceSize_QTBUG_16389();
void nullPixmapPaint();
void testQtQuick11Attributes();
void testQtQuick11Attributes_data();
@@ -640,6 +641,29 @@ void tst_qdeclarativeimage::sourceSize_QTBUG_14303()
QTRY_COMPARE(sourceSizeSpy.count(), 2);
}
+void tst_qdeclarativeimage::sourceSize_QTBUG_16389()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/qtbug_16389.qml"));
+ canvas->show();
+ qApp->processEvents();
+
+ QDeclarativeImage *image = findItem<QDeclarativeImage>(canvas->rootObject(), "iconImage");
+ QDeclarativeItem *handle = findItem<QDeclarativeItem>(canvas->rootObject(), "blueHandle");
+
+ QCOMPARE(image->sourceSize().width(), 200);
+ QCOMPARE(image->sourceSize().height(), 200);
+ QCOMPARE(image->paintedWidth(), 0.0);
+ QCOMPARE(image->paintedHeight(), 0.0);
+
+ handle->setY(20);
+
+ QCOMPARE(image->sourceSize().width(), 200);
+ QCOMPARE(image->sourceSize().height(), 200);
+ QCOMPARE(image->paintedWidth(), 20.0);
+ QCOMPARE(image->paintedHeight(), 20.0);
+}
+
static int numberOfWarnings = 0;
static void checkWarnings(QtMsgType, const char *)
{
diff --git a/tests/auto/declarative/qdeclarativeitem/data/layoutmirroring.qml b/tests/auto/declarative/qdeclarativeitem/data/layoutmirroring.qml
new file mode 100644
index 0000000..866b615
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/layoutmirroring.qml
@@ -0,0 +1,54 @@
+import QtQuick 1.1
+
+Item {
+ property bool childrenInherit: true
+ Item {
+ objectName: "mirrored1"
+ LayoutMirroring.enabled: true
+ LayoutMirroring.childrenInherit: parent.childrenInherit
+ Item {
+ Item {
+ objectName: "notMirrored1"
+ LayoutMirroring.enabled: false
+ Item {
+ objectName: "inheritedMirror1"
+ }
+ }
+ Item {
+ objectName: "inheritedMirror2"
+ }
+ }
+ }
+ Item {
+ objectName: "mirrored2"
+ LayoutMirroring.enabled: true
+ LayoutMirroring.childrenInherit: false
+ Item {
+ objectName: "notMirrored2"
+ }
+ }
+ Item {
+ LayoutMirroring.enabled: true
+ LayoutMirroring.childrenInherit: true
+ Loader {
+ id: loader
+ }
+ }
+ states: State {
+ name: "newContent"
+ PropertyChanges {
+ target: loader
+ sourceComponent: component
+ }
+ }
+ Component {
+ id: component
+ Item {
+ objectName: "notMirrored3"
+ LayoutMirroring.enabled: false
+ Item {
+ objectName: "inheritedMirror3"
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
index 137522d..52c9a72 100644
--- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
+++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
@@ -65,7 +65,10 @@ private slots:
void keys();
void keysProcessingOrder();
void keyNavigation();
+ void keyNavigation_RightToLeft();
void keyNavigation_skipNotVisible();
+ void layoutMirroring();
+ void layoutMirroringIllegalParent();
void smooth();
void clip();
void mapCoordinates();
@@ -87,13 +90,33 @@ private slots:
void testQtQuick11Attributes();
void testQtQuick11Attributes_data();
void qtbug_16871();
-
private:
- template<typename T>
- T *findItem(QGraphicsObject *parent, const QString &objectName);
QDeclarativeEngine engine;
};
+template<typename T>
+T *findItem(QGraphicsObject *parent, const QString &objectName)
+{
+ if (!parent)
+ return 0;
+
+ const QMetaObject &mo = T::staticMetaObject;
+ //qDebug() << parent->QGraphicsObject::children().count() << "children";
+ for (int i = 0; i < parent->childItems().count(); ++i) {
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(parent->childItems().at(i));
+ if(!item)
+ continue;
+ //qDebug() << "try" << item;
+ if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName))
+ return static_cast<T*>(item);
+ item = findItem<T>(item, objectName);
+ if (item)
+ return static_cast<T*>(item);
+ }
+
+ return 0;
+}
+
class KeysTestObject : public QObject
{
Q_OBJECT
@@ -380,6 +403,165 @@ void tst_QDeclarativeItem::keysProcessingOrder()
delete testObject;
}
+QDeclarativeItemPrivate *childPrivate(QGraphicsObject *rootItem, const char * itemString)
+{
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(rootItem, QString(QLatin1String(itemString)));
+ QDeclarativeItemPrivate* itemPrivate = QDeclarativeItemPrivate::get(item);
+ return itemPrivate;
+}
+
+QVariant childProperty(QGraphicsObject *rootItem, const char * itemString, const char * property)
+{
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(rootItem, QString(QLatin1String(itemString)));
+ return item->property(property);
+}
+
+bool anchorsMirrored(QGraphicsObject *rootItem, const char * itemString)
+{
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(rootItem, QString(QLatin1String(itemString)));
+ QDeclarativeItemPrivate* itemPrivate = QDeclarativeItemPrivate::get(item);
+ return itemPrivate->anchors()->mirrored();
+}
+
+void tst_QDeclarativeItem::layoutMirroring()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/layoutmirroring.qml"));
+ canvas->show();
+
+ QDeclarativeItem *rootItem = qobject_cast<QDeclarativeItem*>(canvas->rootObject());
+ QVERIFY(rootItem);
+ QDeclarativeItemPrivate *rootPrivate = QDeclarativeItemPrivate::get(rootItem);
+ QVERIFY(rootPrivate);
+
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->effectiveLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "mirrored2")->effectiveLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->effectiveLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored2")->effectiveLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->effectiveLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->effectiveLayoutMirror, true);
+
+ QCOMPARE(anchorsMirrored(rootItem, "mirrored1"), true);
+ QCOMPARE(anchorsMirrored(rootItem, "mirrored2"), true);
+ QCOMPARE(anchorsMirrored(rootItem, "notMirrored1"), false);
+ QCOMPARE(anchorsMirrored(rootItem, "notMirrored2"), false);
+ QCOMPARE(anchorsMirrored(rootItem, "inheritedMirror1"), true);
+ QCOMPARE(anchorsMirrored(rootItem, "inheritedMirror2"), true);
+
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->inheritedLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "mirrored2")->inheritedLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->inheritedLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "notMirrored2")->inheritedLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->inheritedLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->inheritedLayoutMirror, true);
+
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->isMirrorImplicit, false);
+ QCOMPARE(childPrivate(rootItem, "mirrored2")->isMirrorImplicit, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->isMirrorImplicit, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored2")->isMirrorImplicit, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->isMirrorImplicit, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->isMirrorImplicit, true);
+
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->inheritMirrorFromParent, true);
+ QCOMPARE(childPrivate(rootItem, "mirrored2")->inheritMirrorFromParent, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->inheritMirrorFromParent, true);
+ QCOMPARE(childPrivate(rootItem, "notMirrored2")->inheritMirrorFromParent, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->inheritMirrorFromParent, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->inheritMirrorFromParent, true);
+
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->inheritMirrorFromItem, true);
+ QCOMPARE(childPrivate(rootItem, "mirrored2")->inheritMirrorFromItem, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->inheritMirrorFromItem, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored2")->inheritMirrorFromItem, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->inheritMirrorFromItem, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->inheritMirrorFromItem, false);
+
+ // load dynamic content using Loader that needs to inherit mirroring
+ rootItem->setProperty("state", "newContent");
+ QCOMPARE(childPrivate(rootItem, "notMirrored3")->effectiveLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror3")->effectiveLayoutMirror, true);
+
+ QCOMPARE(childPrivate(rootItem, "notMirrored3")->inheritedLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror3")->inheritedLayoutMirror, true);
+
+ QCOMPARE(childPrivate(rootItem, "notMirrored3")->isMirrorImplicit, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror3")->isMirrorImplicit, true);
+
+ QCOMPARE(childPrivate(rootItem, "notMirrored3")->inheritMirrorFromParent, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror3")->inheritMirrorFromParent, true);
+
+ QCOMPARE(childPrivate(rootItem, "notMirrored3")->inheritMirrorFromItem, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored3")->inheritMirrorFromItem, false);
+
+ // disable inheritance
+ rootItem->setProperty("childrenInherit", false);
+
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->effectiveLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->effectiveLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->effectiveLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->effectiveLayoutMirror, false);
+
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->inheritedLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->inheritedLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->inheritedLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->inheritedLayoutMirror, false);
+
+ // re-enable inheritance
+ rootItem->setProperty("childrenInherit", true);
+
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->effectiveLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->effectiveLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->effectiveLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->effectiveLayoutMirror, false);
+
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->inheritedLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->inheritedLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->inheritedLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->inheritedLayoutMirror, true);
+
+ //
+ // dynamic parenting
+ //
+ QDeclarativeItem *parentItem1 = new QDeclarativeItem();
+ QDeclarativeItemPrivate::get(parentItem1)->effectiveLayoutMirror = true; // LayoutMirroring.enabled: true
+ QDeclarativeItemPrivate::get(parentItem1)->isMirrorImplicit = false;
+ QDeclarativeItemPrivate::get(parentItem1)->inheritMirrorFromItem = true; // LayoutMirroring.childrenInherit: true
+ QDeclarativeItemPrivate::get(parentItem1)->resolveLayoutMirror();
+
+ // inherit in constructor
+ QDeclarativeItem *childItem1 = new QDeclarativeItem(parentItem1);
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem1)->effectiveLayoutMirror, true);
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem1)->inheritMirrorFromParent, true);
+
+ // inherit through a parent change
+ QDeclarativeItem *childItem2 = new QDeclarativeItem();
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem2)->effectiveLayoutMirror, false);
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem2)->inheritMirrorFromParent, false);
+ childItem2->setParentItem(parentItem1);
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem2)->effectiveLayoutMirror, true);
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem2)->inheritMirrorFromParent, true);
+
+ // stop inherting through a parent change
+ QDeclarativeItem *parentItem2 = new QDeclarativeItem();
+ QDeclarativeItemPrivate::get(parentItem2)->effectiveLayoutMirror = true; // LayoutMirroring.enabled: true
+ QDeclarativeItemPrivate::get(parentItem2)->resolveLayoutMirror();
+ childItem2->setParentItem(parentItem2);
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem2)->effectiveLayoutMirror, false);
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem2)->inheritMirrorFromParent, false);
+
+ delete parentItem1;
+ delete parentItem2;
+}
+
+void tst_QDeclarativeItem::layoutMirroringIllegalParent()
+{
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.1; QtObject { LayoutMirroring.enabled: true; LayoutMirroring.childrenInherit: true }", QUrl::fromLocalFile(""));
+ QTest::ignoreMessage(QtWarningMsg, "file::1:21: QML QtObject: LayoutDirection attached property only works with Items");
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+}
+
void tst_QDeclarativeItem::keyNavigation()
{
QDeclarativeView *canvas = new QDeclarativeView(0);
@@ -460,6 +642,59 @@ void tst_QDeclarativeItem::keyNavigation()
delete canvas;
}
+void tst_QDeclarativeItem::keyNavigation_RightToLeft()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(240,320);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/keynavigationtest.qml"));
+ canvas->show();
+ qApp->processEvents();
+
+ QDeclarativeItem *rootItem = qobject_cast<QDeclarativeItem*>(canvas->rootObject());
+ QVERIFY(rootItem);
+ QDeclarativeItemPrivate* rootItemPrivate = QDeclarativeItemPrivate::get(rootItem);
+
+ rootItemPrivate->effectiveLayoutMirror = true; // LayoutMirroring.mirror: true
+ rootItemPrivate->isMirrorImplicit = false;
+ rootItemPrivate->inheritMirrorFromItem = true; // LayoutMirroring.inherit: true
+ rootItemPrivate->resolveLayoutMirror();
+
+ QEvent wa(QEvent::WindowActivate);
+ QApplication::sendEvent(canvas, &wa);
+ QFocusEvent fe(QEvent::FocusIn);
+ QApplication::sendEvent(canvas, &fe);
+
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(canvas->rootObject(), "item1");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ QVariant result;
+ QVERIFY(QMetaObject::invokeMethod(canvas->rootObject(), "verify",
+ Q_RETURN_ARG(QVariant, result)));
+ QVERIFY(result.toBool());
+
+ // right
+ QKeyEvent key(QEvent::KeyPress, Qt::Key_Left, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QDeclarativeItem>(canvas->rootObject(), "item2");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ // left
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Right, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QDeclarativeItem>(canvas->rootObject(), "item1");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ delete canvas;
+}
+
void tst_QDeclarativeItem::keyNavigation_skipNotVisible()
{
QDeclarativeView *canvas = new QDeclarativeView(0);
@@ -1003,32 +1238,6 @@ void tst_QDeclarativeItem::qtbug_16871()
delete o;
}
-
-template<typename T>
-T *tst_QDeclarativeItem::findItem(QGraphicsObject *parent, const QString &objectName)
-{
- if (!parent)
- return 0;
-
- const QMetaObject &mo = T::staticMetaObject;
- //qDebug() << parent->QGraphicsObject::children().count() << "children";
- for (int i = 0; i < parent->childItems().count(); ++i) {
- QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(parent->childItems().at(i));
- if(!item)
- continue;
- //qDebug() << "try" << item;
- if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName))
- return static_cast<T*>(item);
- item = findItem<T>(item, objectName);
- if (item)
- return static_cast<T*>(item);
- }
-
- return 0;
-}
-
-
-
QTEST_MAIN(tst_QDeclarativeItem)
#include "tst_qdeclarativeitem.moc"
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType.qml b/tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType.qml
new file mode 100644
index 0000000..4526cf0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+QtObject {
+ property InlineAssignmentsOverrideBindingsType2 nested: InlineAssignmentsOverrideBindingsType2 {
+ value: 19 * 33
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType2.qml b/tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType2.qml
new file mode 100644
index 0000000..4127ca4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType2.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ property int value
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/inlineAssignmentsOverrideBindings.qml b/tests/auto/declarative/qdeclarativelanguage/data/inlineAssignmentsOverrideBindings.qml
new file mode 100644
index 0000000..8f3c5ce
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/inlineAssignmentsOverrideBindings.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+InlineAssignmentsOverrideBindingsType {
+ property int test: nested.value
+ nested.value: 11
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
index f3f41a9..5a2591f 100644
--- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
+++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
@@ -134,6 +134,7 @@ private slots:
void dontDoubleCallClassBegin();
void reservedWords_data();
void reservedWords();
+ void inlineAssignmentsOverrideBindings();
void basicRemote_data();
void basicRemote();
@@ -1413,9 +1414,18 @@ void tst_qdeclarativelanguage::testType(const QString& qml, const QString& type,
}
}
+// QTBUG-17276
+void tst_qdeclarativelanguage::inlineAssignmentsOverrideBindings()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("inlineAssignmentsOverrideBindings.qml"));
-// Import tests (QT-558)
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ QCOMPARE(o->property("test").toInt(), 11);
+ delete o;
+}
+// Import tests (QT-558)
void tst_qdeclarativelanguage::importsBuiltin_data()
{
// QT-610
diff --git a/tests/auto/declarative/qdeclarativelistview/data/headerfooter.qml b/tests/auto/declarative/qdeclarativelistview/data/headerfooter.qml
new file mode 100644
index 0000000..5633831
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/headerfooter.qml
@@ -0,0 +1,26 @@
+import QtQuick 1.1
+
+ListView {
+ id: view
+ property bool horizontal: false
+ property bool rtl: false
+ width: 240
+ height: 320
+
+ orientation: horizontal ? ListView.Horizontal : ListView.Vertical
+ header: Rectangle {
+ objectName: "header"
+ width: horizontal ? 20 : view.width
+ height: horizontal ? view.height : 20
+ color: "red"
+ }
+ footer: Rectangle {
+ objectName: "footer"
+ width: horizontal ? 30 : view.width
+ height: horizontal ? view.height : 30
+ color: "blue"
+ }
+// model: testModel
+ delegate: Text { width: 30; height: 30; text: index + "(" + x + ")" }
+ layoutDirection: rtl ? Qt.RightToLeft : Qt.LeftToRight
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml b/tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml
index 9d9cda8..b2d9213 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml
+++ b/tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml
@@ -1,6 +1,7 @@
import QtQuick 1.0
Rectangle {
+ property string sectionProperty: "number"
width: 240
height: 320
color: "#ffffff"
@@ -56,7 +57,7 @@ Rectangle {
height: 320
model: testModel
delegate: myDelegate
- section.property: "number"
+ section.property: sectionProperty
section.delegate: Rectangle {
objectName: "sect_" + section
color: "#99bb99"
diff --git a/tests/auto/declarative/qdeclarativelistview/data/rightToLeft.qml b/tests/auto/declarative/qdeclarativelistview/data/rightToLeft.qml
new file mode 100644
index 0000000..1e92bb3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/rightToLeft.qml
@@ -0,0 +1,42 @@
+// This example demonstrates how item positioning
+// changes in right-to-left layout direction
+
+import QtQuick 1.1
+
+Rectangle {
+ color: "lightgray"
+ width: 640
+ height: 320
+
+ VisualItemModel {
+ id: itemModel
+ objectName: "itemModel"
+ Rectangle {
+ objectName: "item1"
+ height: view.height; width: 100; color: "#FFFEF0"
+ Text { objectName: "text1"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ objectName: "item2"
+ height: view.height; width: 200; color: "#F0FFF7"
+ Text { objectName: "text2"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ objectName: "item3"
+ height: view.height; width: 240; color: "#F4F0FF"
+ Text { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ }
+
+ ListView {
+ id: view
+ objectName: "view"
+ anchors.fill: parent
+ anchors.bottomMargin: 30
+ model: itemModel
+ highlightRangeMode: "StrictlyEnforceRange"
+ orientation: ListView.Horizontal
+ flickDeceleration: 2000
+ layoutDirection: Qt.RightToLeft
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
index c7f90da..2267a89 100644
--- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
+++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
@@ -45,6 +45,7 @@
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecontext.h>
#include <QtDeclarative/qdeclarativeexpression.h>
+#include <QtDeclarative/private/qdeclarativeitem_p.h>
#include <QtDeclarative/private/qdeclarativelistview_p.h>
#include <QtDeclarative/private/qdeclarativetext_p.h>
#include <QtDeclarative/private/qdeclarativevisualitemmodel_p.h>
@@ -102,6 +103,7 @@ private slots:
void QTBUG_11105();
void header();
void footer();
+ void headerFooter();
void resizeView();
void sizeLessThan1();
void QTBUG_14821();
@@ -115,6 +117,8 @@ private slots:
void onRemove_data();
void testQtQuick11Attributes();
void testQtQuick11Attributes_data();
+ void rightToLeft();
+ void test_mirroring();
private:
template <class T> void items();
@@ -737,6 +741,13 @@ void tst_QDeclarativeListView::clear()
QTRY_VERIFY(listview->count() == 0);
QTRY_VERIFY(listview->currentItem() == 0);
QTRY_VERIFY(listview->contentY() == 0);
+ QVERIFY(listview->currentIndex() == -1);
+
+ // confirm sanity when adding an item to cleared list
+ model.addItem("New", "1");
+ QTRY_VERIFY(listview->count() == 1);
+ QVERIFY(listview->currentItem() != 0);
+ QVERIFY(listview->currentIndex() == 0);
delete canvas;
}
@@ -1091,6 +1102,52 @@ void tst_QDeclarativeListView::sectionsDelegate()
QList<QDeclarativeItem*> items = findItems<QDeclarativeItem>(contentItem, "sect_1");
QCOMPARE(items.count(), 1);
+ // QTBUG-17759
+ model.modifyItem(0, "One", "aaa");
+ model.modifyItem(1, "One", "aaa");
+ model.modifyItem(2, "One", "aaa");
+ model.modifyItem(3, "Four", "aaa");
+ model.modifyItem(4, "Four", "aaa");
+ model.modifyItem(5, "Four", "aaa");
+ model.modifyItem(6, "Five", "aaa");
+ model.modifyItem(7, "Five", "aaa");
+ model.modifyItem(8, "Five", "aaa");
+ model.modifyItem(9, "Two", "aaa");
+ model.modifyItem(10, "Two", "aaa");
+ model.modifyItem(11, "Two", "aaa");
+ QTRY_COMPARE(findItems<QDeclarativeItem>(contentItem, "sect_aaa").count(), 1);
+ canvas->rootObject()->setProperty("sectionProperty", "name");
+ // ensure view has settled.
+ QTRY_COMPARE(findItems<QDeclarativeItem>(contentItem, "sect_Four").count(), 1);
+ for (int i = 0; i < 4; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem,
+ "sect_" + model.name(i*3));
+ QVERIFY(item);
+ QTRY_COMPARE(item->y(), qreal(i*20*4));
+ }
+
+ // QTBUG-17769
+ model.removeItems(10, 20);
+ // ensure view has settled.
+ QTRY_COMPARE(findItems<QDeclarativeItem>(contentItem, "wrapper").count(), 10);
+ // Drag view up beyond bounds
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(20,20)));
+ {
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(20,0)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ }
+ {
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(20,-50)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ }
+ {
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(20,-200)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ }
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(20,-200)));
+ // view should settle back at 0
+ QTRY_COMPARE(listview->contentY(), 0.0);
+
delete canvas;
}
@@ -1709,8 +1766,6 @@ void tst_QDeclarativeListView::manualHighlight()
QDeclarativeView *canvas = new QDeclarativeView(0);
canvas->setFixedSize(240,320);
- QDeclarativeContext *ctxt = canvas->rootContext();
-
QString filename(SRCDIR "/data/manual-highlight.qml");
canvas->setSource(QUrl::fromLocalFile(filename));
@@ -1841,8 +1896,6 @@ void tst_QDeclarativeListView::header()
TestModel model;
- QDeclarativeContext *ctxt = canvas->rootContext();
-
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/header1.qml"));
qApp->processEvents();
@@ -1913,6 +1966,112 @@ void tst_QDeclarativeListView::footer()
delete canvas;
}
+class LVAccessor : public QDeclarativeListView
+{
+public:
+ qreal minY() const { return minYExtent(); }
+ qreal maxY() const { return maxYExtent(); }
+ qreal minX() const { return minXExtent(); }
+ qreal maxX() const { return maxXExtent(); }
+};
+
+void tst_QDeclarativeListView::headerFooter()
+{
+ {
+ // Vertical
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/headerfooter.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(canvas->rootObject());
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QDeclarativeItem *header = findItem<QDeclarativeItem>(contentItem, "header");
+ QVERIFY(header);
+ QCOMPARE(header->y(), 0.0);
+
+ QDeclarativeItem *footer = findItem<QDeclarativeItem>(contentItem, "footer");
+ QVERIFY(footer);
+ QCOMPARE(footer->y(), 20.0);
+
+ QVERIFY(static_cast<LVAccessor*>(listview)->minY() == 0);
+ QVERIFY(static_cast<LVAccessor*>(listview)->maxY() == 0);
+
+ delete canvas;
+ }
+ {
+ // Horizontal
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/headerfooter.qml"));
+ canvas->rootObject()->setProperty("horizontal", true);
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(canvas->rootObject());
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QDeclarativeItem *header = findItem<QDeclarativeItem>(contentItem, "header");
+ QVERIFY(header);
+ QCOMPARE(header->x(), 0.0);
+
+ QDeclarativeItem *footer = findItem<QDeclarativeItem>(contentItem, "footer");
+ QVERIFY(footer);
+ QCOMPARE(footer->x(), 20.0);
+
+ QVERIFY(static_cast<LVAccessor*>(listview)->minX() == 0);
+ QVERIFY(static_cast<LVAccessor*>(listview)->maxX() == 0);
+
+ delete canvas;
+ }
+ {
+ // Horizontal RTL
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/headerfooter.qml"));
+ canvas->rootObject()->setProperty("horizontal", true);
+ canvas->rootObject()->setProperty("rtl", true);
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(canvas->rootObject());
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QDeclarativeItem *header = findItem<QDeclarativeItem>(contentItem, "header");
+ QVERIFY(header);
+ QCOMPARE(header->x(), -20.0);
+
+ QDeclarativeItem *footer = findItem<QDeclarativeItem>(contentItem, "footer");
+ QVERIFY(footer);
+ QCOMPARE(footer->x(), -50.0);
+
+ QCOMPARE(static_cast<LVAccessor*>(listview)->minX(), 240.);
+ QCOMPARE(static_cast<LVAccessor*>(listview)->maxX(), 240.);
+
+ delete canvas;
+ }
+}
+
void tst_QDeclarativeListView::resizeView()
{
QDeclarativeView *canvas = createView();
@@ -2312,6 +2471,118 @@ void tst_QDeclarativeListView::testQtQuick11Attributes_data()
<< "";
}
+void tst_QDeclarativeListView::rightToLeft()
+{
+ QDeclarativeView *canvas = createView();
+ canvas->setFixedSize(640,320);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/rightToLeft.qml"));
+ qApp->processEvents();
+
+ QVERIFY(canvas->rootObject() != 0);
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "view");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QDeclarativeVisualItemModel *model = canvas->rootObject()->findChild<QDeclarativeVisualItemModel*>("itemModel");
+ QTRY_VERIFY(model != 0);
+
+ QTRY_VERIFY(model->count() == 3);
+ QTRY_COMPARE(listview->currentIndex(), 0);
+
+ // initial position at first item, right edge aligned
+ QCOMPARE(listview->contentX(), -640.);
+
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "item1");
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), -100.0);
+ QCOMPARE(item->height(), listview->height());
+
+ QDeclarativeText *text = findItem<QDeclarativeText>(contentItem, "text1");
+ QTRY_VERIFY(text);
+ QTRY_COMPARE(text->text(), QLatin1String("index: 0"));
+
+ listview->setCurrentIndex(2);
+
+ item = findItem<QDeclarativeItem>(contentItem, "item3");
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), -540.0);
+
+ text = findItem<QDeclarativeText>(contentItem, "text3");
+ QTRY_VERIFY(text);
+ QTRY_COMPARE(text->text(), QLatin1String("index: 2"));
+
+ QCOMPARE(listview->contentX(), -640.);
+
+ // Ensure resizing maintains position relative to right edge
+ qobject_cast<QDeclarativeItem*>(canvas->rootObject())->setWidth(600);
+ QTRY_COMPARE(listview->contentX(), -600.);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::test_mirroring()
+{
+ QDeclarativeView *canvasA = createView();
+ canvasA->setSource(QUrl::fromLocalFile(SRCDIR "/data/rightToLeft.qml"));
+ QDeclarativeListView *listviewA = findItem<QDeclarativeListView>(canvasA->rootObject(), "view");
+ QTRY_VERIFY(listviewA != 0);
+
+ QDeclarativeView *canvasB = createView();
+ canvasB->setSource(QUrl::fromLocalFile(SRCDIR "/data/rightToLeft.qml"));
+ QDeclarativeListView *listviewB = findItem<QDeclarativeListView>(canvasB->rootObject(), "view");
+ QTRY_VERIFY(listviewA != 0);
+ qApp->processEvents();
+
+ QList<QString> objectNames;
+ objectNames << "item1" << "item2"; // << "item3"
+
+ listviewA->setProperty("layoutDirection", Qt::LeftToRight);
+ listviewB->setProperty("layoutDirection", Qt::RightToLeft);
+ QCOMPARE(listviewA->layoutDirection(), listviewA->effectiveLayoutDirection());
+
+ // LTR != RTL
+ foreach(const QString objectName, objectNames)
+ QVERIFY(findItem<QDeclarativeItem>(listviewA, objectName)->x() != findItem<QDeclarativeItem>(listviewB, objectName)->x());
+
+ listviewA->setProperty("layoutDirection", Qt::LeftToRight);
+ listviewB->setProperty("layoutDirection", Qt::LeftToRight);
+
+ // LTR == LTR
+ foreach(const QString objectName, objectNames)
+ QCOMPARE(findItem<QDeclarativeItem>(listviewA, objectName)->x(), findItem<QDeclarativeItem>(listviewB, objectName)->x());
+
+ QVERIFY(listviewB->layoutDirection() == listviewB->effectiveLayoutDirection());
+ QDeclarativeItemPrivate::get(listviewB)->setLayoutMirror(true);
+ QVERIFY(listviewB->layoutDirection() != listviewB->effectiveLayoutDirection());
+
+ // LTR != LTR+mirror
+ foreach(const QString objectName, objectNames)
+ QVERIFY(findItem<QDeclarativeItem>(listviewA, objectName)->x() != findItem<QDeclarativeItem>(listviewB, objectName)->x());
+
+ listviewA->setProperty("layoutDirection", Qt::RightToLeft);
+
+ // RTL == LTR+mirror
+ foreach(const QString objectName, objectNames)
+ QCOMPARE(findItem<QDeclarativeItem>(listviewA, objectName)->x(), findItem<QDeclarativeItem>(listviewB, objectName)->x());
+
+ listviewB->setProperty("layoutDirection", Qt::RightToLeft);
+
+ // RTL != RTL+mirror
+ foreach(const QString objectName, objectNames)
+ QVERIFY(findItem<QDeclarativeItem>(listviewA, objectName)->x() != findItem<QDeclarativeItem>(listviewB, objectName)->x());
+
+ listviewA->setProperty("layoutDirection", Qt::LeftToRight);
+
+ // LTR == RTL+mirror
+ foreach(const QString objectName, objectNames)
+ QCOMPARE(findItem<QDeclarativeItem>(listviewA, objectName)->x(), findItem<QDeclarativeItem>(listviewB, objectName)->x());
+
+ delete canvasA;
+ delete canvasB;
+}
+
void tst_QDeclarativeListView::qListModelInterface_items()
{
items<TestModel>();
@@ -2421,7 +2692,7 @@ QList<T*> tst_QDeclarativeListView::findItems(QGraphicsObject *parent, const QSt
//qDebug() << parent->childItems().count() << "children";
for (int i = 0; i < parent->childItems().count(); ++i) {
QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(parent->childItems().at(i));
- if(!item)
+ if(!item || !item->isVisible())
continue;
//qDebug() << "try" << item;
if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName))
diff --git a/tests/auto/declarative/qdeclarativepathview/data/dragpath.qml b/tests/auto/declarative/qdeclarativepathview/data/dragpath.qml
index a361bdc..0f94840 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/dragpath.qml
+++ b/tests/auto/declarative/qdeclarativepathview/data/dragpath.qml
@@ -9,7 +9,7 @@ PathView {
startX: 0; startY: 100
PathLine { x: 400; y: 100 }
}
- delegate: Rectangle { height: 100; width: 1; color: PathView.isCurrentItem?"red" : "black" }
+ delegate: Rectangle { objectName: "wrapper"; height: 100; width: 2; color: PathView.isCurrentItem?"red" : "black" }
dragMargin: 100
preferredHighlightBegin: 0.5
preferredHighlightEnd: 0.5
diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
index ebb5f98..8000137 100644
--- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
+++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
@@ -111,6 +111,7 @@ private slots:
void undefinedPath();
void mouseDrag();
void treeModel();
+ void changePreferredHighlight();
private:
QDeclarativeView *createView();
@@ -948,6 +949,45 @@ void tst_QDeclarativePathView::treeModel()
delete canvas;
}
+void tst_QDeclarativePathView::changePreferredHighlight()
+{
+ QDeclarativeView *canvas = createView();
+ canvas->setFixedSize(400,200);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/dragpath.qml"));
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ QDeclarativePathView *pathview = qobject_cast<QDeclarativePathView*>(canvas->rootObject());
+ QVERIFY(pathview != 0);
+
+ int current = pathview->currentIndex();
+ QCOMPARE(current, 0);
+
+ QDeclarativeRectangle *firstItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 0);
+ QVERIFY(firstItem);
+ QDeclarativePath *path = qobject_cast<QDeclarativePath*>(pathview->path());
+ QVERIFY(path);
+ QPointF start = path->pointAt(0.5);
+ start.setX(qRound(start.x()));
+ start.setY(qRound(start.y()));
+ QPointF offset;//Center of item is at point, but pos is from corner
+ offset.setX(firstItem->width()/2);
+ offset.setY(firstItem->height()/2);
+ QTRY_COMPARE(firstItem->pos() + offset, start);
+
+ pathview->setPreferredHighlightBegin(0.8);
+ pathview->setPreferredHighlightEnd(0.8);
+ start = path->pointAt(0.8);
+ start.setX(qRound(start.x()));
+ start.setY(qRound(start.y()));
+ QTRY_COMPARE(firstItem->pos() + offset, start);
+ QCOMPARE(pathview->currentIndex(), 0);
+
+ delete canvas;
+}
+
QDeclarativeView *tst_QDeclarativePathView::createView()
{
QDeclarativeView *canvas = new QDeclarativeView(0);
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/grid-righttoleft.qml b/tests/auto/declarative/qdeclarativepositioners/data/grid-righttoleft.qml
deleted file mode 100644
index 0ec1f37..0000000
--- a/tests/auto/declarative/qdeclarativepositioners/data/grid-righttoleft.qml
+++ /dev/null
@@ -1,41 +0,0 @@
-import QtQuick 1.1
-
-Item {
- width: 640
- height: 480
- Grid {
- objectName: "grid"
- columns: 3
- layoutDirection: Qt.RightToLeft
- Rectangle {
- objectName: "one"
- color: "red"
- width: 50
- height: 50
- }
- Rectangle {
- objectName: "two"
- color: "green"
- width: 20
- height: 50
- }
- Rectangle {
- objectName: "three"
- color: "blue"
- width: 50
- height: 20
- }
- Rectangle {
- objectName: "four"
- color: "cyan"
- width: 50
- height: 50
- }
- Rectangle {
- objectName: "five"
- color: "magenta"
- width: 10
- height: 10
- }
- }
-}
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml b/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml
index f3b17dd..929b726 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml
+++ b/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml
@@ -1,9 +1,11 @@
-import QtQuick 1.0
+import QtQuick 1.1
Item {
width: 640
height: 480
+ property bool testRightToLeft: false
Grid {
+ layoutDirection: testRightToLeft ? Qt.RightToLeft : Qt.LeftToRight
objectName: "grid"
columns: 3
Rectangle {
@@ -21,7 +23,7 @@ Item {
Rectangle {
objectName: "three"
color: "blue"
- width: 50
+ width: 30
height: 20
}
Rectangle {
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml b/tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml
index e1a9652..d35c02d 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml
+++ b/tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml
@@ -4,7 +4,6 @@ Item {
width: 640
height: 480
property bool testRightToLeft: false
-
Row {
objectName: "row"
layoutDirection: testRightToLeft ? Qt.RightToLeft : Qt.LeftToRight
diff --git a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
index 40e533d..92ab722 100644
--- a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
+++ b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
@@ -45,6 +45,7 @@
#include <private/qdeclarativerectangle_p.h>
#include <private/qdeclarativepositioners_p.h>
#include <private/qdeclarativetransition_p.h>
+#include <private/qdeclarativeitem_p.h>
#include <qdeclarativeexpression.h>
#include <QtGui/qgraphicswidget.h>
#include "../../../shared/util.h"
@@ -87,6 +88,7 @@ private slots:
void test_flow_implicit_resize();
void test_conflictinganchors();
void test_vertical_qgraphicswidget();
+ void test_mirroring();
void testQtQuick11Attributes();
void testQtQuick11Attributes_data();
private:
@@ -452,7 +454,7 @@ void tst_QDeclarativePositioners::test_grid()
QDeclarativeGrid *grid = canvas->rootObject()->findChild<QDeclarativeGrid*>("grid");
QCOMPARE(grid->flow(), QDeclarativeGrid::LeftToRight);
- QCOMPARE(grid->width(), 120.0);
+ QCOMPARE(grid->width(), 100.0);
QCOMPARE(grid->height(), 100.0);
delete canvas;
@@ -494,7 +496,9 @@ void tst_QDeclarativePositioners::test_grid_topToBottom()
void tst_QDeclarativePositioners::test_grid_rightToLeft()
{
- QDeclarativeView *canvas = createView(SRCDIR "/data/grid-righttoleft.qml");
+ QDeclarativeView *canvas = createView(SRCDIR "/data/gridtest.qml");
+
+ canvas->rootObject()->setProperty("testRightToLeft", true);
QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
QVERIFY(one != 0);
@@ -507,20 +511,20 @@ void tst_QDeclarativePositioners::test_grid_rightToLeft()
QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
QVERIFY(five != 0);
- QCOMPARE(one->x(), 70.0);
+ QCOMPARE(one->x(), 50.0);
QCOMPARE(one->y(), 0.0);
- QCOMPARE(two->x(), 50.0);
+ QCOMPARE(two->x(), 30.0);
QCOMPARE(two->y(), 0.0);
QCOMPARE(three->x(), 0.0);
QCOMPARE(three->y(), 0.0);
- QCOMPARE(four->x(), 70.0);
+ QCOMPARE(four->x(), 50.0);
QCOMPARE(four->y(), 50.0);
- QCOMPARE(five->x(), 60.0);
+ QCOMPARE(five->x(), 40.0);
QCOMPARE(five->y(), 50.0);
QDeclarativeGrid *grid = canvas->rootObject()->findChild<QDeclarativeGrid*>("grid");
QCOMPARE(grid->layoutDirection(), Qt::RightToLeft);
- QCOMPARE(grid->width(), 120.0);
+ QCOMPARE(grid->width(), 100.0);
QCOMPARE(grid->height(), 100.0);
delete canvas;
@@ -1198,6 +1202,66 @@ void tst_QDeclarativePositioners::test_vertical_qgraphicswidget()
delete canvas;
}
+void tst_QDeclarativePositioners::test_mirroring()
+{
+ QList<QString> qmlFiles;
+ qmlFiles << "horizontal.qml" << "gridtest.qml" << "flowtest.qml";
+ QList<QString> objectNames;
+ objectNames << "one" << "two" << "three" << "four" << "five";
+
+ foreach(const QString qmlFile, qmlFiles) {
+ QDeclarativeView *canvasA = createView(QString(SRCDIR) + "/data/" + qmlFile);
+ QDeclarativeItem *rootA = qobject_cast<QDeclarativeItem*>(canvasA->rootObject());
+
+ QDeclarativeView *canvasB = createView(QString(SRCDIR) + "/data/" + qmlFile);
+ QDeclarativeItem *rootB = qobject_cast<QDeclarativeItem*>(canvasB->rootObject());
+
+ rootA->setProperty("testRightToLeft", true); // layoutDirection: Qt.RightToLeft
+
+ // LTR != RTL
+ foreach(const QString objectName, objectNames) {
+ // horizontal.qml only has three items
+ if (qmlFile == QString("horizontal.qml") && objectName == QString("four"))
+ break;
+ QDeclarativeItem *itemA = rootA->findChild<QDeclarativeItem*>(objectName);
+ QDeclarativeItem *itemB = rootB->findChild<QDeclarativeItem*>(objectName);
+ QVERIFY(itemA->x() != itemB->x());
+ }
+
+ QDeclarativeItemPrivate* rootPrivateB = QDeclarativeItemPrivate::get(rootB);
+
+ rootPrivateB->effectiveLayoutMirror = true; // LayoutMirroring.enabled: true
+ rootPrivateB->isMirrorImplicit = false;
+ rootPrivateB->inheritMirrorFromItem = true; // LayoutMirroring.childrenInherit: true
+ rootPrivateB->resolveLayoutMirror();
+
+ // RTL == mirror
+ foreach(const QString objectName, objectNames) {
+ // horizontal.qml only has three items
+ if (qmlFile == QString("horizontal.qml") && objectName == QString("four"))
+ break;
+ QDeclarativeItem *itemA = rootA->findChild<QDeclarativeItem*>(objectName);
+ QDeclarativeItem *itemB = rootB->findChild<QDeclarativeItem*>(objectName);
+ QCOMPARE(itemA->x(), itemB->x());
+ }
+
+ rootA->setProperty("testRightToLeft", false); // layoutDirection: Qt.LeftToRight
+ rootB->setProperty("testRightToLeft", true); // layoutDirection: Qt.RightToLeft
+
+ // LTR == RTL + mirror
+ foreach(const QString objectName, objectNames) {
+ // horizontal.qml only has three items
+ if (qmlFile == QString("horizontal.qml") && objectName == QString("four"))
+ break;
+ QDeclarativeItem *itemA = rootA->findChild<QDeclarativeItem*>(objectName);
+ QDeclarativeItem *itemB = rootB->findChild<QDeclarativeItem*>(objectName);
+ QCOMPARE(itemA->x(), itemB->x());
+ }
+ delete canvasA;
+ delete canvasB;
+ }
+}
+
void tst_QDeclarativePositioners::testQtQuick11Attributes()
{
QFETCH(QString, code);
diff --git a/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp b/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp
index 7d746a7..e3a4723 100644
--- a/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp
+++ b/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp
@@ -76,6 +76,40 @@ void tst_QDeclarativePropertyMap::insert()
map.insert(QLatin1String("key1"),"Hello World");
QCOMPARE(map.value(QLatin1String("key1")), QVariant("Hello World"));
+
+ //inserting property names same with existing method(signal, slot, method) names is not allowed
+ //QDeclarativePropertyMap has an invokable keys() method
+ QTest::ignoreMessage(QtWarningMsg, "Creating property with name \"keys\" is not permitted, conflicts with internal symbols. ");
+ map.insert(QLatin1String("keys"), 1);
+ QVERIFY(map.keys().count() == 2);
+ QVERIFY(!map.contains(QLatin1String("keys")));
+ QVERIFY(map.value(QLatin1String("keys")).isNull());
+
+ //QDeclarativePropertyMap has a deleteLater() slot
+ QTest::ignoreMessage(QtWarningMsg, "Creating property with name \"deleteLater\" is not permitted, conflicts with internal symbols. ");
+ map.insert(QLatin1String("deleteLater"), 1);
+ QVERIFY(map.keys().count() == 2);
+ QVERIFY(!map.contains(QLatin1String("deleteLater")));
+ QVERIFY(map.value(QLatin1String("deleteLater")).isNull());
+
+ //QDeclarativePropertyMap has an valueChanged() signal
+ QTest::ignoreMessage(QtWarningMsg, "Creating property with name \"valueChanged\" is not permitted, conflicts with internal symbols. ");
+ map.insert(QLatin1String("valueChanged"), 1);
+ QVERIFY(map.keys().count() == 2);
+ QVERIFY(!map.contains(QLatin1String("valueChanged")));
+ QVERIFY(map.value(QLatin1String("valueChanged")).isNull());
+
+ //but 'valueChange' should be ok
+ map.insert(QLatin1String("valueChange"), 1);
+ QVERIFY(map.keys().count() == 3);
+ QVERIFY(map.contains(QLatin1String("valueChange")));
+ QCOMPARE(map.value(QLatin1String("valueChange")), QVariant(1));
+
+ //'valueCHANGED' should be ok, too
+ map.insert(QLatin1String("valueCHANGED"), 1);
+ QVERIFY(map.keys().count() == 4);
+ QVERIFY(map.contains(QLatin1String("valueCHANGED")));
+ QCOMPARE(map.value(QLatin1String("valueCHANGED")), QVariant(1));
}
void tst_QDeclarativePropertyMap::operatorInsert()
diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
index 56bed30..20e2640 100644
--- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
+++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
@@ -120,6 +120,9 @@ private slots:
void anchorChanges3();
void anchorChanges4();
void anchorChanges5();
+ void anchorChangesRTL();
+ void anchorChangesRTL2();
+ void anchorChangesRTL3();
void anchorChangesCrash();
void anchorRewindBug();
void anchorRewindBug2();
@@ -813,6 +816,125 @@ void tst_qdeclarativestates::anchorChanges5()
delete rect;
}
+void mirrorAnchors(QDeclarativeItem *item) {
+ QDeclarativeItemPrivate *itemPrivate = QDeclarativeItemPrivate::get(item);
+ itemPrivate->setLayoutMirror(true);
+}
+
+qreal offsetRTL(QDeclarativeItem *anchorItem, QDeclarativeItem *item) {
+ return anchorItem->width()+2*anchorItem->x()-item->width();
+}
+
+void tst_qdeclarativestates::anchorChangesRTL()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges1.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+ mirrorAnchors(innerRect);
+
+ QDeclarativeListReference list(rect, "states");
+ QDeclarativeState *state = qobject_cast<QDeclarativeState*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QDeclarativeAnchorChanges *aChanges = qobject_cast<QDeclarativeAnchorChanges*>(state->operationAt(0));
+ QVERIFY(aChanges != 0);
+
+ rectPrivate->setState("right");
+ QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) - qreal(150));
+ QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QDeclarativeAnchorLine::Invalid); //### was reset (how do we distinguish from not set at all)
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine);
+
+ rectPrivate->setState("");
+ QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) -qreal(5));
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::anchorChangesRTL2()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges2.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+ mirrorAnchors(innerRect);
+
+ rectPrivate->setState("right");
+ QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) - qreal(150));
+
+ rectPrivate->setState("");
+ QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) - qreal(5));
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::anchorChangesRTL3()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges3.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+ mirrorAnchors(innerRect);
+
+ QDeclarativeItem *leftGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("LeftGuideline"));
+ QVERIFY(leftGuideline != 0);
+
+ QDeclarativeItem *bottomGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("BottomGuideline"));
+ QVERIFY(bottomGuideline != 0);
+
+ QDeclarativeListReference list(rect, "states");
+ QDeclarativeState *state = qobject_cast<QDeclarativeState*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QDeclarativeAnchorChanges *aChanges = qobject_cast<QDeclarativeAnchorChanges*>(state->operationAt(0));
+ QVERIFY(aChanges != 0);
+
+ rectPrivate->setState("reanchored");
+ QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().item, QDeclarativeItemPrivate::get(leftGuideline)->left().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QDeclarativeItemPrivate::get(leftGuideline)->left().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->top().item, rectPrivate->top().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->top().anchorLine, rectPrivate->top().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->bottom().item, QDeclarativeItemPrivate::get(bottomGuideline)->bottom().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->bottom().anchorLine, QDeclarativeItemPrivate::get(bottomGuideline)->bottom().anchorLine);
+
+ QCOMPARE(innerRect->x(), offsetRTL(leftGuideline, innerRect) - qreal(10));
+ QCOMPARE(innerRect->y(), qreal(0));
+ // between left side of parent and leftGuideline.x: 10, which has width 0
+ QCOMPARE(innerRect->width(), qreal(10));
+ QCOMPARE(innerRect->height(), qreal(150));
+
+ rectPrivate->setState("");
+ QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) - qreal(0));
+ QCOMPARE(innerRect->y(), qreal(10));
+ // between right side of parent and left side of rightGuideline.x: 150, which has width 0
+ QCOMPARE(innerRect->width(), qreal(50));
+ QCOMPARE(innerRect->height(), qreal(190));
+
+ delete rect;
+}
+
//QTBUG-9609
void tst_qdeclarativestates::anchorChangesCrash()
{
diff --git a/tests/auto/declarative/qdeclarativetext/data/qtbug_14734.qml b/tests/auto/declarative/qdeclarativetext/data/qtbug_14734.qml
new file mode 100644
index 0000000..bd07d66
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/qtbug_14734.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 640
+ height: 480
+
+ Text {
+ text: "í "
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
index 05546cb..581b58c 100644
--- a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
+++ b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
@@ -109,6 +109,7 @@ private slots:
void testQtQuick11Attributes();
void testQtQuick11Attributes_data();
+ void qtbug_14734();
private:
QStringList standard;
QStringList richText;
@@ -517,20 +518,112 @@ void tst_qdeclarativetext::horizontalAlignment_RightToLeft()
QDeclarativeTextPrivate *textPrivate = QDeclarativeTextPrivate::get(text);
QVERIFY(textPrivate != 0);
- QVERIFY(textPrivate->layout.lineAt(0).x() > canvas->width()/2);
+ // implicit alignment should follow the reading direction of RTL text
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ QCOMPARE(text->effectiveHAlign(), text->hAlign());
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2);
+
+ // explicitly left aligned text
+ text->setHAlign(QDeclarativeText::AlignLeft);
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignLeft);
+ QCOMPARE(text->effectiveHAlign(), text->hAlign());
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() < canvas->width()/2);
+
+ // explicitly right aligned text
+ text->setHAlign(QDeclarativeText::AlignRight);
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ QCOMPARE(text->effectiveHAlign(), text->hAlign());
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2);
- // "Right" aligned
+ // change to rich text
+ QString textString = text->text();
+ text->setText(QString("<i>") + textString + QString("</i>"));
+ text->setTextFormat(QDeclarativeText::RichText);
+ text->resetHAlign();
+
+ // implicitly aligned rich text should follow the reading direction of text
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ QCOMPARE(text->effectiveHAlign(), text->hAlign());
+ QVERIFY(textPrivate->textDocument()->defaultTextOption().alignment() & Qt::AlignLeft);
+
+ // explicitly left aligned rich text
+ text->setHAlign(QDeclarativeText::AlignLeft);
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignLeft);
+ QCOMPARE(text->effectiveHAlign(), text->hAlign());
+ QVERIFY(textPrivate->textDocument()->defaultTextOption().alignment() & Qt::AlignRight);
+
+ // explicitly right aligned rich text
text->setHAlign(QDeclarativeText::AlignRight);
QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
- QVERIFY(textPrivate->layout.lineAt(0).x() < canvas->width()/2);
+ QCOMPARE(text->effectiveHAlign(), text->hAlign());
+ QVERIFY(textPrivate->textDocument()->defaultTextOption().alignment() & Qt::AlignLeft);
+
+ text->setText(textString);
+ text->setTextFormat(QDeclarativeText::PlainText);
- // Center aligned
+ // explicitly center aligned
text->setHAlign(QDeclarativeText::AlignHCenter);
QCOMPARE(text->hAlign(), QDeclarativeText::AlignHCenter);
- QVERIFY(textPrivate->layout.lineAt(0).x() < canvas->width()/2);
- QVERIFY(textPrivate->layout.lineAt(0).x() + textPrivate->layout.lineAt(0).width() > canvas->width()/2);
+ QCOMPARE(text->effectiveHAlign(), text->hAlign());
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() < canvas->width()/2);
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().right() > canvas->width()/2);
+
+ // reseted alignment should go back to following the text reading direction
+ text->resetHAlign();
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2);
+
+ // mirror the text item
+ QDeclarativeItemPrivate::get(text)->setLayoutMirror(true);
+
+ // mirrored implicit alignment should continue to follow the reading direction of the text
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ QCOMPARE(text->effectiveHAlign(), QDeclarativeText::AlignRight);
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2);
+
+ // mirrored explicitly right aligned behaves as left aligned
+ text->setHAlign(QDeclarativeText::AlignRight);
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ QCOMPARE(text->effectiveHAlign(), QDeclarativeText::AlignLeft);
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() < canvas->width()/2);
+
+ // mirrored explicitly left aligned behaves as right aligned
+ text->setHAlign(QDeclarativeText::AlignLeft);
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignLeft);
+ QCOMPARE(text->effectiveHAlign(), QDeclarativeText::AlignRight);
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2);
+
+ // disable mirroring
+ QDeclarativeItemPrivate::get(text)->setLayoutMirror(false);
+ text->resetHAlign();
+
+ // English text should be implicitly left aligned
+ text->setText("Hello world!");
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignLeft);
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() < canvas->width()/2);
+
+#ifndef Q_OS_MAC // QTBUG-18040
+ // empty text with implicit alignment follows the system locale-based
+ // keyboard input direction from QApplication::keyboardInputDirection
+ text->setText("");
+ QCOMPARE(text->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
+ QDeclarativeText::AlignLeft : QDeclarativeText::AlignRight);
+ text->setHAlign(QDeclarativeText::AlignRight);
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+#endif
delete canvas;
+
+#ifndef Q_OS_MAC // QTBUG-18040
+ // alignment of Text with no text set to it
+ QString componentStr = "import QtQuick 1.0\nText {}";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QCOMPARE(textObject->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
+ QDeclarativeText::AlignLeft : QDeclarativeText::AlignRight);
+ delete textObject;
+#endif
}
void tst_qdeclarativetext::verticalAlignment()
@@ -1113,13 +1206,13 @@ void tst_qdeclarativetext::lineHeight()
myText->setLineHeightMode(QDeclarativeText::ProportionalHeight);
myText->setLineHeight(1.0);
- //qreal h2 = myText->height();
+ qreal h2 = myText->height();
myText->setLineHeight(2.0);
- //QVERIFY(myText->height() == h2 * 2.0);
+ QVERIFY(myText->height() == h2 * 2.0);
myText->setLineHeightMode(QDeclarativeText::FixedHeight);
myText->setLineHeight(10);
- //QCOMPARE(myText->height(), myText->lineCount() * 10.0);
+ QCOMPARE(myText->height(), myText->lineCount() * 10.0);
delete canvas;
}
@@ -1202,6 +1295,19 @@ void tst_qdeclarativetext::testQtQuick11Attributes_data()
<< "";
}
+void tst_qdeclarativetext::qtbug_14734()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/qtbug_14734.qml");
+ QVERIFY(canvas);
+
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ delete canvas;
+}
+
QTEST_MAIN(tst_qdeclarativetext)
#include "tst_qdeclarativetext.moc"
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_words.qml b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_words.qml
new file mode 100644
index 0000000..22a9871
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_words.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+TextEdit {
+ focus: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: false
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_words.qml b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_words.qml
new file mode 100644
index 0000000..d61da46
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_words.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+TextEdit {
+ focus: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: true
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/navigation.qml b/tests/auto/declarative/qdeclarativetextedit/data/navigation.qml
index 9ee8a93..0e1caf6 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/navigation.qml
+++ b/tests/auto/declarative/qdeclarativetextedit/data/navigation.qml
@@ -15,6 +15,7 @@ Rectangle {
KeyNavigation.right: lastItem
KeyNavigation.up: firstItem
KeyNavigation.down: lastItem
+ text: "a"
}
Item {
id: lastItem
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/positionAt.qml b/tests/auto/declarative/qdeclarativetextedit/data/positionAt.qml
new file mode 100644
index 0000000..e010135
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/positionAt.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+TextEdit {
+ focus: true
+ objectName: "myInput"
+ width: 50
+ height: 25
+ text: "This is\n a long piece of text"
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
index 2c3ec7c..f62c2c5 100644
--- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
+++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
@@ -110,6 +110,9 @@ private slots:
void persistentSelection();
void focusOnPress();
void selection();
+ void isRightToLeft_data();
+ void isRightToLeft();
+ void keySelection();
void moveCursorSelection_data();
void moveCursorSelection();
void moveCursorSelectionSequence_data();
@@ -121,6 +124,8 @@ private slots:
void dragMouseSelection();
void inputMethodHints();
+ void positionAt();
+
void cursorDelegate();
void cursorVisible();
void delegateLoading_data();
@@ -128,6 +133,8 @@ private slots:
void navigation();
void readOnly();
void copyAndPaste();
+ void canPaste();
+ void canPasteEmpty();
void textInput();
void openInputPanelOnClick();
void openInputPanelOnFocus();
@@ -140,9 +147,10 @@ private slots:
void preeditMicroFocus();
void inputContextMouseHandler();
+ void inputMethodComposing();
private:
- void simulateKey(QDeclarativeView *, int key);
+ void simulateKey(QDeclarativeView *, int key, Qt::KeyboardModifiers modifiers = 0);
QDeclarativeView *createView(const QString &filename);
QStringList standard;
@@ -440,21 +448,109 @@ void tst_qdeclarativetextedit::hAlign_RightToLeft()
QVERIFY(textEdit != 0);
canvas->show();
+ // implicit alignment should follow the reading direction of text
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
- // "Right" align
+ // explicitly left aligned
+ textEdit->setHAlign(QDeclarativeTextEdit::AlignLeft);
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignLeft);
+ QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2);
+
+ // explicitly right aligned
textEdit->setHAlign(QDeclarativeTextEdit::AlignRight);
QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+
+ QString textString = textEdit->text();
+ textEdit->setText(QString("<i>") + textString + QString("</i>"));
+ textEdit->resetHAlign();
+
+ // implicitly aligned rich text should follow the reading direction of RTL text
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->effectiveHAlign(), textEdit->hAlign());
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+
+ // explicitly left aligned rich text
+ textEdit->setHAlign(QDeclarativeTextEdit::AlignLeft);
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignLeft);
+ QCOMPARE(textEdit->effectiveHAlign(), textEdit->hAlign());
QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2);
- // Center align
- // Note that position 0 is on the right-hand side
+ // explicitly right aligned rich text
+ textEdit->setHAlign(QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->effectiveHAlign(), textEdit->hAlign());
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+
+ textEdit->setText(textString);
+
+ // explicitly center aligned
textEdit->setHAlign(QDeclarativeTextEdit::AlignHCenter);
QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignHCenter);
- QVERIFY(textEdit->positionToRectangle(0).x() - textEdit->width() < canvas->width()/2);
QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+ // reseted alignment should go back to following the text reading direction
+ textEdit->resetHAlign();
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+
+ // mirror the text item
+ QDeclarativeItemPrivate::get(textEdit)->setLayoutMirror(true);
+
+ // mirrored implicit alignment should continue to follow the reading direction of the text
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->effectiveHAlign(), QDeclarativeTextEdit::AlignRight);
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+
+ // mirrored explicitly right aligned behaves as left aligned
+ textEdit->setHAlign(QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->effectiveHAlign(), QDeclarativeTextEdit::AlignLeft);
+ QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2);
+
+ // mirrored explicitly left aligned behaves as right aligned
+ textEdit->setHAlign(QDeclarativeTextEdit::AlignLeft);
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignLeft);
+ QCOMPARE(textEdit->effectiveHAlign(), QDeclarativeTextEdit::AlignRight);
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+
+ // disable mirroring
+ QDeclarativeItemPrivate::get(textEdit)->setLayoutMirror(false);
+ textEdit->resetHAlign();
+
+ // English text should be implicitly left aligned
+ textEdit->setText("Hello world!");
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignLeft);
+ QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2);
+
+#ifndef Q_OS_MAC // QTBUG-18040
+ // empty text with implicit alignment follows the system locale-based
+ // keyboard input direction from QApplication::keyboardInputDirection
+ textEdit->setText("");
+ QCOMPARE(textEdit->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
+ QDeclarativeTextEdit::AlignLeft : QDeclarativeTextEdit::AlignRight);
+ if (QApplication::keyboardInputDirection() == Qt::LeftToRight)
+ QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2);
+ else
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+ textEdit->setHAlign(QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+#endif
+
delete canvas;
+
+#ifndef Q_OS_MAC // QTBUG-18040
+ // alignment of TextEdit with no text set to it
+ QString componentStr = "import QtQuick 1.0\nTextEdit {}";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeTextEdit *textObject = qobject_cast<QDeclarativeTextEdit*>(textComponent.create());
+ QCOMPARE(textObject->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
+ QDeclarativeTextEdit::AlignLeft : QDeclarativeTextEdit::AlignRight);
+ delete textObject;
+#endif
}
void tst_qdeclarativetextedit::vAlign()
@@ -757,6 +853,113 @@ void tst_qdeclarativetextedit::selection()
QVERIFY(textEditObject->selectedText().isNull());
}
+void tst_qdeclarativetextedit::isRightToLeft_data()
+{
+ QTest::addColumn<QString>("text");
+ QTest::addColumn<bool>("emptyString");
+ QTest::addColumn<bool>("firstCharacter");
+ QTest::addColumn<bool>("lastCharacter");
+ QTest::addColumn<bool>("middleCharacter");
+ QTest::addColumn<bool>("startString");
+ QTest::addColumn<bool>("midString");
+ QTest::addColumn<bool>("endString");
+
+ const quint16 arabic_str[] = { 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0647};
+ QTest::newRow("Empty") << "" << false << false << false << false << false << false << false;
+ QTest::newRow("Neutral") << "23244242" << false << false << false << false << false << false << false;
+ QTest::newRow("LTR") << "Hello world" << false << false << false << false << false << false << false;
+ QTest::newRow("RTL") << QString::fromUtf16(arabic_str, 11) << false << true << true << true << true << true << true;
+ QTest::newRow("Bidi RTL + LTR + RTL") << QString::fromUtf16(arabic_str, 11) + QString("Hello world") + QString::fromUtf16(arabic_str, 11) << false << true << true << false << true << true << true;
+ QTest::newRow("Bidi LTR + RTL + LTR") << QString("Hello world") + QString::fromUtf16(arabic_str, 11) + QString("Hello world") << false << false << false << true << false << false << false;
+}
+
+void tst_qdeclarativetextedit::isRightToLeft()
+{
+ QFETCH(QString, text);
+ QFETCH(bool, emptyString);
+ QFETCH(bool, firstCharacter);
+ QFETCH(bool, lastCharacter);
+ QFETCH(bool, middleCharacter);
+ QFETCH(bool, startString);
+ QFETCH(bool, midString);
+ QFETCH(bool, endString);
+
+ QDeclarativeTextEdit textEdit;
+ textEdit.setText(text);
+
+ // first test that the right string is delivered to the QString::isRightToLeft()
+ QCOMPARE(textEdit.isRightToLeft(0,0), text.mid(0,0).isRightToLeft());
+ QCOMPARE(textEdit.isRightToLeft(0,1), text.mid(0,1).isRightToLeft());
+ QCOMPARE(textEdit.isRightToLeft(text.count()-2, text.count()-1), text.mid(text.count()-2, text.count()-1).isRightToLeft());
+ QCOMPARE(textEdit.isRightToLeft(text.count()/2, text.count()/2 + 1), text.mid(text.count()/2, text.count()/2 + 1).isRightToLeft());
+ QCOMPARE(textEdit.isRightToLeft(0,text.count()/4), text.mid(0,text.count()/4).isRightToLeft());
+ QCOMPARE(textEdit.isRightToLeft(text.count()/4,3*text.count()/4), text.mid(text.count()/4,3*text.count()/4).isRightToLeft());
+ if (text.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML TextEdit: isRightToLeft(start, end) called with the end property being smaller than the start.");
+ QCOMPARE(textEdit.isRightToLeft(3*text.count()/4,text.count()-1), text.mid(3*text.count()/4,text.count()-1).isRightToLeft());
+
+ // then test that the feature actually works
+ QCOMPARE(textEdit.isRightToLeft(0,0), emptyString);
+ QCOMPARE(textEdit.isRightToLeft(0,1), firstCharacter);
+ QCOMPARE(textEdit.isRightToLeft(text.count()-2, text.count()-1), lastCharacter);
+ QCOMPARE(textEdit.isRightToLeft(text.count()/2, text.count()/2 + 1), middleCharacter);
+ QCOMPARE(textEdit.isRightToLeft(0,text.count()/4), startString);
+ QCOMPARE(textEdit.isRightToLeft(text.count()/4,3*text.count()/4), midString);
+ if (text.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML TextEdit: isRightToLeft(start, end) called with the end property being smaller than the start.");
+ QCOMPARE(textEdit.isRightToLeft(3*text.count()/4,text.count()-1), endString);
+}
+
+void tst_qdeclarativetextedit::keySelection()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/navigation.qml");
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+ canvas->setFocus();
+
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeTextEdit *input = qobject_cast<QDeclarativeTextEdit *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
+
+ QVERIFY(input != 0);
+ QTRY_VERIFY(input->hasActiveFocus() == true);
+
+ QSignalSpy spy(input, SIGNAL(selectionChanged()));
+
+ simulateKey(canvas, Qt::Key_Right, Qt::ShiftModifier);
+ QVERIFY(input->hasActiveFocus() == true);
+ QCOMPARE(input->selectedText(), QString("a"));
+ QCOMPARE(spy.count(), 1);
+ simulateKey(canvas, Qt::Key_Right);
+ QVERIFY(input->hasActiveFocus() == true);
+ QCOMPARE(input->selectedText(), QString());
+ QCOMPARE(spy.count(), 2);
+ simulateKey(canvas, Qt::Key_Right);
+ QVERIFY(input->hasActiveFocus() == false);
+ QCOMPARE(input->selectedText(), QString());
+ QCOMPARE(spy.count(), 2);
+
+ simulateKey(canvas, Qt::Key_Left);
+ QVERIFY(input->hasActiveFocus() == true);
+ QCOMPARE(spy.count(), 2);
+ simulateKey(canvas, Qt::Key_Left, Qt::ShiftModifier);
+ QVERIFY(input->hasActiveFocus() == true);
+ QCOMPARE(input->selectedText(), QString("a"));
+ QCOMPARE(spy.count(), 3);
+ simulateKey(canvas, Qt::Key_Left);
+ QVERIFY(input->hasActiveFocus() == true);
+ QCOMPARE(input->selectedText(), QString());
+ QCOMPARE(spy.count(), 4);
+ simulateKey(canvas, Qt::Key_Left);
+ QVERIFY(input->hasActiveFocus() == false);
+ QCOMPARE(input->selectedText(), QString());
+ QCOMPARE(spy.count(), 4);
+
+ delete canvas;
+}
+
void tst_qdeclarativetextedit::moveCursorSelection_data()
{
QTest::addColumn<QString>("testStr");
@@ -1102,6 +1305,8 @@ void tst_qdeclarativetextedit::mouseSelection_data()
QTest::newRow("on") << SRCDIR "/data/mouseselection_true.qml" << true;
QTest::newRow("off") << SRCDIR "/data/mouseselection_false.qml" << false;
QTest::newRow("default") << SRCDIR "/data/mouseselection_default.qml" << false;
+ QTest::newRow("on word selection") << SRCDIR "/data/mouseselection_true_words.qml" << true;
+ QTest::newRow("off word selection") << SRCDIR "/data/mouseselection_false_words.qml" << false;
}
void tst_qdeclarativetextedit::mouseSelection()
@@ -1250,6 +1455,56 @@ void tst_qdeclarativetextedit::inputMethodHints()
delete canvas;
}
+void tst_qdeclarativetextedit::positionAt()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/positionAt.qml");
+ QVERIFY(canvas->rootObject() != 0);
+ canvas->show();
+ canvas->setFocus();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+
+ QDeclarativeTextEdit *texteditObject = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject());
+ QVERIFY(texteditObject != 0);
+
+ QFontMetrics fm(texteditObject->font());
+ const int y0 = fm.height() / 2;
+ const int y1 = fm.height() * 3 / 2;
+
+ int pos = texteditObject->positionAt(texteditObject->width()/2, y0);
+ int diff = abs(int(fm.width(texteditObject->text().left(pos))-texteditObject->width()/2));
+
+ // some tollerance for different fonts.
+#ifdef Q_OS_LINUX
+ QVERIFY(diff < 2);
+#else
+ QVERIFY(diff < 5);
+#endif
+
+ const qreal x0 = texteditObject->positionToRectangle(pos).x();
+ const qreal x1 = texteditObject->positionToRectangle(pos + 1).x();
+
+ QString preeditText = texteditObject->text().mid(0, pos);
+ texteditObject->setText(texteditObject->text().mid(pos));
+ texteditObject->setCursorPosition(0);
+
+ QInputMethodEvent inputEvent(preeditText, QList<QInputMethodEvent::Attribute>());
+ QApplication::sendEvent(canvas, &inputEvent);
+
+ // Check all points within the preedit text return the same position.
+ QCOMPARE(texteditObject->positionAt(0, y0), 0);
+ QCOMPARE(texteditObject->positionAt(x0 / 2, y0), 0);
+ QCOMPARE(texteditObject->positionAt(x0, y0), 0);
+
+ // Verify positioning returns to normal after the preedit text.
+ QCOMPARE(texteditObject->positionAt(x1, y0), 1);
+ QCOMPARE(texteditObject->positionToRectangle(1).x(), x1);
+
+ QVERIFY(texteditObject->positionAt(x0 / 2, y1) > 0);
+
+ delete canvas;
+}
+
void tst_qdeclarativetextedit::cursorDelegate()
{
QDeclarativeView* view = createView(SRCDIR "/data/cursorTest.qml");
@@ -1425,6 +1680,8 @@ void tst_qdeclarativetextedit::navigation()
simulateKey(canvas, Qt::Key_Right);
QVERIFY(input->hasActiveFocus() == true);
simulateKey(canvas, Qt::Key_Right);
+ QVERIFY(input->hasActiveFocus() == true);
+ simulateKey(canvas, Qt::Key_Right);
QVERIFY(input->hasActiveFocus() == false);
simulateKey(canvas, Qt::Key_Left);
QVERIFY(input->hasActiveFocus() == true);
@@ -1492,6 +1749,42 @@ void tst_qdeclarativetextedit::copyAndPaste() {
#endif
}
+void tst_qdeclarativetextedit::canPaste() {
+#ifndef QT_NO_CLIPBOARD
+
+ QApplication::clipboard()->setText("Some text");
+
+ QString componentStr = "import QtQuick 1.0\nTextEdit { text: \"Hello world!\" }";
+ QDeclarativeComponent textEditComponent(&engine);
+ textEditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEdit = qobject_cast<QDeclarativeTextEdit*>(textEditComponent.create());
+ QVERIFY(textEdit != 0);
+
+ // check initial value - QTBUG-17765
+ QTextControl tc;
+ QCOMPARE(textEdit->canPaste(), tc.canPaste());
+
+#endif
+}
+
+void tst_qdeclarativetextedit::canPasteEmpty() {
+#ifndef QT_NO_CLIPBOARD
+
+ QApplication::clipboard()->clear();
+
+ QString componentStr = "import QtQuick 1.0\nTextEdit { text: \"Hello world!\" }";
+ QDeclarativeComponent textEditComponent(&engine);
+ textEditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEdit = qobject_cast<QDeclarativeTextEdit*>(textEditComponent.create());
+ QVERIFY(textEdit != 0);
+
+ // check initial value - QTBUG-17765
+ QTextControl tc;
+ QCOMPARE(textEdit->canPaste(), tc.canPaste());
+
+#endif
+}
+
void tst_qdeclarativetextedit::readOnly()
{
QDeclarativeView *canvas = createView(SRCDIR "/data/readOnly.qml");
@@ -1516,10 +1809,10 @@ void tst_qdeclarativetextedit::readOnly()
delete canvas;
}
-void tst_qdeclarativetextedit::simulateKey(QDeclarativeView *view, int key)
+void tst_qdeclarativetextedit::simulateKey(QDeclarativeView *view, int key, Qt::KeyboardModifiers modifiers)
{
- QKeyEvent press(QKeyEvent::KeyPress, key, 0);
- QKeyEvent release(QKeyEvent::KeyRelease, key, 0);
+ QKeyEvent press(QKeyEvent::KeyPress, key, modifiers);
+ QKeyEvent release(QKeyEvent::KeyRelease, key, modifiers);
QApplication::sendEvent(view, &press);
QApplication::sendEvent(view, &release);
@@ -2079,6 +2372,43 @@ void tst_qdeclarativetextedit::inputContextMouseHandler()
ic.eventType = QEvent::None;
}
+void tst_qdeclarativetextedit::inputMethodComposing()
+{
+ QString text = "supercalifragisiticexpialidocious!";
+
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ MyInputContext ic;
+ view.setInputContext(&ic);
+ QDeclarativeTextEdit edit;
+ edit.setWidth(200);
+ edit.setText(text.mid(0, 12));
+ edit.setCursorPosition(12);
+ edit.setPos(0, 0);
+ edit.setFocus(true);
+ scene.addItem(&edit);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+
+ QSignalSpy spy(&edit, SIGNAL(inputMethodComposingChanged()));
+
+ QCOMPARE(edit.isInputMethodComposing(), false);
+
+ ic.sendEvent(QInputMethodEvent(text.mid(3), QList<QInputMethodEvent::Attribute>()));
+ QCOMPARE(edit.isInputMethodComposing(), true);
+ QCOMPARE(spy.count(), 1);
+
+ ic.sendEvent(QInputMethodEvent(text.mid(12), QList<QInputMethodEvent::Attribute>()));
+ QCOMPARE(edit.isInputMethodComposing(), true);
+ QCOMPARE(spy.count(), 1);
+
+ ic.sendEvent(QInputMethodEvent());
+ QCOMPARE(edit.isInputMethodComposing(), false);
+ QCOMPARE(spy.count(), 2);
+}
+
QTEST_MAIN(tst_qdeclarativetextedit)
#include "tst_qdeclarativetextedit.moc"
diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
index 49a05a3..45f38a4 100644
--- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
+++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
@@ -89,6 +89,8 @@ private slots:
void font();
void color();
void selection();
+ void isRightToLeft_data();
+ void isRightToLeft();
void moveCursorSelection_data();
void moveCursorSelection();
void moveCursorSelectionSequence_data();
@@ -111,8 +113,12 @@ private slots:
void passwordCharacter();
void cursorDelegate();
void cursorVisible();
+ void cursorRectangle();
void navigation();
+ void navigation_RTL();
void copyAndPaste();
+ void canPasteEmpty();
+ void canPaste();
void readOnly();
void openInputPanelOnClick();
@@ -128,6 +134,7 @@ private slots:
void preeditAutoScroll();
void preeditMicroFocus();
void inputContextMouseHandler();
+ void inputMethodComposing();
private:
void simulateKey(QDeclarativeView *, int key);
@@ -143,7 +150,8 @@ tst_qdeclarativetextinput::tst_qdeclarativetextinput()
standard << "the quick brown fox jumped over the lazy dog"
<< "It's supercalifragisiticexpialidocious!"
<< "Hello, world!"
- << "!dlrow ,olleH";
+ << "!dlrow ,olleH"
+ << " spacey text ";
colorStrings << "aliceblue"
<< "antiquewhite"
@@ -434,6 +442,63 @@ void tst_qdeclarativetextinput::selection()
delete textinputObject;
}
+void tst_qdeclarativetextinput::isRightToLeft_data()
+{
+ QTest::addColumn<QString>("text");
+ QTest::addColumn<bool>("emptyString");
+ QTest::addColumn<bool>("firstCharacter");
+ QTest::addColumn<bool>("lastCharacter");
+ QTest::addColumn<bool>("middleCharacter");
+ QTest::addColumn<bool>("startString");
+ QTest::addColumn<bool>("midString");
+ QTest::addColumn<bool>("endString");
+
+ const quint16 arabic_str[] = { 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0647};
+ QTest::newRow("Empty") << "" << false << false << false << false << false << false << false;
+ QTest::newRow("Neutral") << "23244242" << false << false << false << false << false << false << false;
+ QTest::newRow("LTR") << "Hello world" << false << false << false << false << false << false << false;
+ QTest::newRow("RTL") << QString::fromUtf16(arabic_str, 11) << false << true << true << true << true << true << true;
+ QTest::newRow("Bidi RTL + LTR + RTL") << QString::fromUtf16(arabic_str, 11) + QString("Hello world") + QString::fromUtf16(arabic_str, 11) << false << true << true << false << true << true << true;
+ QTest::newRow("Bidi LTR + RTL + LTR") << QString("Hello world") + QString::fromUtf16(arabic_str, 11) + QString("Hello world") << false << false << false << true << false << false << false;
+}
+
+void tst_qdeclarativetextinput::isRightToLeft()
+{
+ QFETCH(QString, text);
+ QFETCH(bool, emptyString);
+ QFETCH(bool, firstCharacter);
+ QFETCH(bool, lastCharacter);
+ QFETCH(bool, middleCharacter);
+ QFETCH(bool, startString);
+ QFETCH(bool, midString);
+ QFETCH(bool, endString);
+
+ QDeclarativeTextInput textInput;
+ textInput.setText(text);
+
+ // first test that the right string is delivered to the QString::isRightToLeft()
+ QCOMPARE(textInput.isRightToLeft(0,0), text.mid(0,0).isRightToLeft());
+ QCOMPARE(textInput.isRightToLeft(0,1), text.mid(0,1).isRightToLeft());
+ QCOMPARE(textInput.isRightToLeft(text.count()-2, text.count()-1), text.mid(text.count()-2, text.count()-1).isRightToLeft());
+ QCOMPARE(textInput.isRightToLeft(text.count()/2, text.count()/2 + 1), text.mid(text.count()/2, text.count()/2 + 1).isRightToLeft());
+ QCOMPARE(textInput.isRightToLeft(0,text.count()/4), text.mid(0,text.count()/4).isRightToLeft());
+ QCOMPARE(textInput.isRightToLeft(text.count()/4,3*text.count()/4), text.mid(text.count()/4,3*text.count()/4).isRightToLeft());
+ if (text.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML TextInput: isRightToLeft(start, end) called with the end property being smaller than the start.");
+ QCOMPARE(textInput.isRightToLeft(3*text.count()/4,text.count()-1), text.mid(3*text.count()/4,text.count()-1).isRightToLeft());
+
+ // then test that the feature actually works
+ QCOMPARE(textInput.isRightToLeft(0,0), emptyString);
+ QCOMPARE(textInput.isRightToLeft(0,1), firstCharacter);
+ QCOMPARE(textInput.isRightToLeft(text.count()-2, text.count()-1), lastCharacter);
+ QCOMPARE(textInput.isRightToLeft(text.count()/2, text.count()/2 + 1), middleCharacter);
+ QCOMPARE(textInput.isRightToLeft(0,text.count()/4), startString);
+ QCOMPARE(textInput.isRightToLeft(text.count()/4,3*text.count()/4), midString);
+ if (text.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML TextInput: isRightToLeft(start, end) called with the end property being smaller than the start.");
+ QCOMPARE(textInput.isRightToLeft(3*text.count()/4,text.count()-1), endString);
+}
+
void tst_qdeclarativetextinput::moveCursorSelection_data()
{
QTest::addColumn<QString>("testStr");
@@ -444,6 +509,9 @@ void tst_qdeclarativetextinput::moveCursorSelection_data()
QTest::addColumn<int>("selectionEnd");
QTest::addColumn<bool>("reversible");
+ // () contains the text selected by the cursor.
+ // <> contains the actual selection.
+
QTest::newRow("(t)he|characters")
<< standard[0] << 0 << 1 << QDeclarativeTextInput::SelectCharacters << 0 << 1 << true;
QTest::newRow("do(g)|characters")
@@ -581,6 +649,24 @@ void tst_qdeclarativetextinput::moveCursorSelection_data()
<< standard[3] << 0 << 0 << QDeclarativeTextInput::SelectWords << 0 << 0 << true;
QTest::newRow("!<()>dlrow|words")
<< standard[3] << 1 << 1 << QDeclarativeTextInput::SelectWords << 1 << 1 << true;
+
+ QTest::newRow(" <s(pac)ey> text |words")
+ << standard[4] << 1 << 4 << QDeclarativeTextInput::SelectWords << 1 << 7 << true;
+ QTest::newRow(" spacey <t(ex)t> |words")
+ << standard[4] << 11 << 13 << QDeclarativeTextInput::SelectWords << 10 << 14 << false; // Should be reversible. QTBUG-11365
+ QTest::newRow("<( )>spacey text |words|ltr")
+ << standard[4] << 0 << 1 << QDeclarativeTextInput::SelectWords << 0 << 1 << false;
+ QTest::newRow("<( )spacey> text |words|rtl")
+ << standard[4] << 1 << 0 << QDeclarativeTextInput::SelectWords << 0 << 7 << false;
+ QTest::newRow("spacey <text( )>|words|ltr")
+ << standard[4] << 14 << 15 << QDeclarativeTextInput::SelectWords << 10 << 15 << false;
+// QTBUG-11365
+// QTest::newRow("spacey text<( )>|words|rtl")
+// << standard[4] << 15 << 14 << QDeclarativeTextInput::SelectWords << 14 << 15 << false;
+ QTest::newRow("<()> spacey text |words")
+ << standard[4] << 0 << 0 << QDeclarativeTextInput::SelectWords << 0 << 0 << false;
+ QTest::newRow(" spacey text <()>|words")
+ << standard[4] << 15 << 15 << QDeclarativeTextInput::SelectWords << 15 << 15 << false;
}
void tst_qdeclarativetextinput::moveCursorSelection()
@@ -627,6 +713,11 @@ void tst_qdeclarativetextinput::moveCursorSelectionSequence_data()
QTest::addColumn<int>("selection2Start");
QTest::addColumn<int>("selection2End");
+ // () contains the text selected by the cursor.
+ // <> contains the actual selection.
+ // ^ is the revised cursor position.
+ // {} contains the revised selection.
+
QTest::newRow("the {<quick( bro)wn> f^ox} jumped|ltr")
<< standard[0]
<< 9 << 13 << 17
@@ -739,6 +830,50 @@ void tst_qdeclarativetextinput::moveCursorSelectionSequence_data()
<< 11 << 9 << 5
<< 8 << 13
<< 1 << 13;
+
+ QTest::newRow("{<(^} sp)acey> text |ltr")
+ << standard[4]
+ << 0 << 3 << 0
+ << 0 << 7
+ << 0 << 0;
+ QTest::newRow("{<( ^}sp)acey> text |ltr")
+ << standard[4]
+ << 0 << 3 << 1
+ << 0 << 7
+ << 0 << 1;
+ QTest::newRow("<( {s^p)acey>} text |rtl")
+ << standard[4]
+ << 3 << 0 << 2
+ << 0 << 7
+ << 1 << 7;
+ QTest::newRow("<( {^sp)acey>} text |rtl")
+ << standard[4]
+ << 3 << 0 << 1
+ << 0 << 7
+ << 1 << 7;
+
+ QTest::newRow(" spacey <te(xt {^)>}|rtl")
+ << standard[4]
+ << 15 << 12 << 15
+ << 10 << 15
+ << 15 << 15;
+// QTBUG-11365
+// QTest::newRow(" spacey <te(xt{^ )>}|rtl")
+// << standard[4]
+// << 15 << 12 << 14
+// << 10 << 15
+// << 14 << 15;
+ QTest::newRow(" spacey {<te(x^t} )>|ltr")
+ << standard[4]
+ << 12 << 15 << 13
+ << 10 << 15
+ << 10 << 14;
+// QTBUG-11365
+// QTest::newRow(" spacey {<te(xt^} )>|ltr")
+// << standard[4]
+// << 12 << 15 << 14
+// << 10 << 15
+// << 10 << 14;
}
void tst_qdeclarativetextinput::moveCursorSelectionSequence()
@@ -916,18 +1051,93 @@ void tst_qdeclarativetextinput::horizontalAlignment_RightToLeft()
QVERIFY(textInputPrivate != 0);
QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
- // "Right" Align
- textInput->setHAlign(QDeclarativeTextInput::AlignRight);
+ // implicit alignment should follow the reading direction of RTL text
QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
+ QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
+
+ // explicitly left aligned
+ textInput->setHAlign(QDeclarativeTextInput::AlignLeft);
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignLeft);
+ QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
QVERIFY(-textInputPrivate->hscroll < canvas->width()/2);
- // Center Align
+ // explicitly right aligned
+ textInput->setHAlign(QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
+
+ // explicitly center aligned
textInput->setHAlign(QDeclarativeTextInput::AlignHCenter);
+ QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignHCenter);
QVERIFY(-textInputPrivate->hscroll < canvas->width()/2);
QVERIFY(-textInputPrivate->hscroll + textInputPrivate->width() > canvas->width()/2);
+ // reseted alignment should go back to following the text reading direction
+ textInput->resetHAlign();
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
+ QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
+
+ // mirror the text item
+ QDeclarativeItemPrivate::get(textInput)->setLayoutMirror(true);
+
+ // mirrored implicit alignment should continue to follow the reading direction of the text
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
+ QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
+
+ // explicitly right aligned behaves as left aligned
+ textInput->setHAlign(QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->effectiveHAlign(), QDeclarativeTextInput::AlignLeft);
+ QVERIFY(-textInputPrivate->hscroll < canvas->width()/2);
+
+ // mirrored explicitly left aligned behaves as right aligned
+ textInput->setHAlign(QDeclarativeTextInput::AlignLeft);
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignLeft);
+ QCOMPARE(textInput->effectiveHAlign(), QDeclarativeTextInput::AlignRight);
+ QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
+
+ // disable mirroring
+ QDeclarativeItemPrivate::get(textInput)->setLayoutMirror(false);
+ QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
+ textInput->resetHAlign();
+
+ // English text should be implicitly left aligned
+ textInput->setText("Hello world!");
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignLeft);
+ QVERIFY(-textInputPrivate->hscroll < canvas->width()/2);
+
+#ifndef Q_OS_MAC // QTBUG-18040
+ // empty text with implicit alignment follows the system locale-based
+ // keyboard input direction from QApplication::keyboardInputDirection
+ textInput->setText("");
+ QCOMPARE(textInput->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
+ QDeclarativeTextInput::AlignLeft : QDeclarativeTextInput::AlignRight);
+ if (QApplication::keyboardInputDirection() == Qt::LeftToRight)
+ QVERIFY(-textInputPrivate->hscroll < canvas->width()/2);
+ else
+ QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
+ textInput->setHAlign(QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
+#endif
+
delete canvas;
+
+#ifndef Q_OS_MAC // QTBUG-18040
+ // alignment of TextInput with no text set to it
+ QString componentStr = "import QtQuick 1.0\nTextInput {}";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeTextInput *textObject = qobject_cast<QDeclarativeTextInput*>(textComponent.create());
+ QCOMPARE(textObject->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
+ QDeclarativeTextInput::AlignLeft : QDeclarativeTextInput::AlignRight);
+ delete textObject;
+#endif
}
void tst_qdeclarativetextinput::positionAt()
@@ -955,6 +1165,10 @@ void tst_qdeclarativetextinput::positionAt()
QVERIFY(diff < 5);
#endif
+ int x = textinputObject->positionToRectangle(pos + 1).x() - 1;
+ QCOMPARE(textinputObject->positionAt(x, QDeclarativeTextInput::CursorBetweenCharacters), pos + 1);
+ QCOMPARE(textinputObject->positionAt(x, QDeclarativeTextInput::CursorOnCharacter), pos);
+
// Check without autoscroll...
textinputObject->setAutoScroll(false);
pos = textinputObject->positionAt(textinputObject->width()/2);
@@ -967,6 +1181,29 @@ void tst_qdeclarativetextinput::positionAt()
QVERIFY(diff < 5);
#endif
+ x = textinputObject->positionToRectangle(pos + 1).x() - 1;
+ QCOMPARE(textinputObject->positionAt(x, QDeclarativeTextInput::CursorBetweenCharacters), pos + 1);
+ QCOMPARE(textinputObject->positionAt(x, QDeclarativeTextInput::CursorOnCharacter), pos);
+
+ const qreal x0 = textinputObject->positionToRectangle(pos).x();
+ const qreal x1 = textinputObject->positionToRectangle(pos + 1).x();
+
+ QString preeditText = textinputObject->text().mid(0, pos);
+ textinputObject->setText(textinputObject->text().mid(pos));
+ textinputObject->setCursorPosition(0);
+
+ QInputMethodEvent inputEvent(preeditText, QList<QInputMethodEvent::Attribute>());
+ QApplication::sendEvent(canvas, &inputEvent);
+
+ // Check all points within the preedit text return the same position.
+ QCOMPARE(textinputObject->positionAt(0), 0);
+ QCOMPARE(textinputObject->positionAt(x0 / 2), 0);
+ QCOMPARE(textinputObject->positionAt(x0), 0);
+
+ // Verify positioning returns to normal after the preedit text.
+ QCOMPARE(textinputObject->positionAt(x1), 1);
+ QCOMPARE(textinputObject->positionToRectangle(1).x(), x1);
+
delete canvas;
}
@@ -1145,6 +1382,24 @@ void tst_qdeclarativetextinput::inputMethods()
QApplication::sendEvent(canvas, &event);
QCOMPARE(input->text(), QString("My Hello world!"));
+ input->setCursorPosition(2);
+ event.setCommitString("Your", -2, 2);
+ QApplication::sendEvent(canvas, &event);
+ QCOMPARE(input->text(), QString("Your Hello world!"));
+ QCOMPARE(input->cursorPosition(), 4);
+
+ input->setCursorPosition(7);
+ event.setCommitString("Goodbye", -2, 5);
+ QApplication::sendEvent(canvas, &event);
+ QCOMPARE(input->text(), QString("Your Goodbye world!"));
+ QCOMPARE(input->cursorPosition(), 12);
+
+ input->setCursorPosition(8);
+ event.setCommitString("Our", -8, 4);
+ QApplication::sendEvent(canvas, &event);
+ QCOMPARE(input->text(), QString("Our Goodbye world!"));
+ QCOMPARE(input->cursorPosition(), 7);
+
delete canvas;
}
@@ -1194,6 +1449,45 @@ void tst_qdeclarativetextinput::navigation()
delete canvas;
}
+void tst_qdeclarativetextinput::navigation_RTL()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/navigation.qml");
+ canvas->show();
+ canvas->setFocus();
+
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeTextInput *input = qobject_cast<QDeclarativeTextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
+
+ QVERIFY(input != 0);
+ const quint16 arabic_str[] = { 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0647};
+ input->setText(QString::fromUtf16(arabic_str, 11));
+
+ input->setCursorPosition(0);
+ QTRY_VERIFY(input->hasActiveFocus() == true);
+
+ // move off
+ simulateKey(canvas, Qt::Key_Right);
+ QVERIFY(input->hasActiveFocus() == false);
+
+ // move back
+ simulateKey(canvas, Qt::Key_Left);
+ QVERIFY(input->hasActiveFocus() == true);
+
+ input->setCursorPosition(input->text().length());
+ QVERIFY(input->hasActiveFocus() == true);
+
+ // move off
+ simulateKey(canvas, Qt::Key_Left);
+ QVERIFY(input->hasActiveFocus() == false);
+
+ // move back
+ simulateKey(canvas, Qt::Key_Right);
+ QVERIFY(input->hasActiveFocus() == true);
+
+ delete canvas;
+}
+
void tst_qdeclarativetextinput::copyAndPaste() {
#ifndef QT_NO_CLIPBOARD
@@ -1273,6 +1567,42 @@ void tst_qdeclarativetextinput::copyAndPaste() {
#endif
}
+void tst_qdeclarativetextinput::canPasteEmpty() {
+#ifndef QT_NO_CLIPBOARD
+
+ QApplication::clipboard()->clear();
+
+ QString componentStr = "import QtQuick 1.0\nTextInput { text: \"Hello world!\" }";
+ QDeclarativeComponent textInputComponent(&engine);
+ textInputComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextInput *textInput = qobject_cast<QDeclarativeTextInput*>(textInputComponent.create());
+ QVERIFY(textInput != 0);
+
+ QLineControl lc;
+ bool cp = !lc.isReadOnly() && QApplication::clipboard()->text().length() != 0;
+ QCOMPARE(textInput->canPaste(), cp);
+
+#endif
+}
+
+void tst_qdeclarativetextinput::canPaste() {
+#ifndef QT_NO_CLIPBOARD
+
+ QApplication::clipboard()->setText("Some text");
+
+ QString componentStr = "import QtQuick 1.0\nTextInput { text: \"Hello world!\" }";
+ QDeclarativeComponent textInputComponent(&engine);
+ textInputComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextInput *textInput = qobject_cast<QDeclarativeTextInput*>(textInputComponent.create());
+ QVERIFY(textInput != 0);
+
+ QLineControl lc;
+ bool cp = !lc.isReadOnly() && QApplication::clipboard()->text().length() != 0;
+ QCOMPARE(textInput->canPaste(), cp);
+
+#endif
+}
+
void tst_qdeclarativetextinput::passwordCharacter()
{
QString componentStr = "import QtQuick 1.0\nTextInput { text: \"Hello world!\"; font.family: \"Helvetica\"; echoMode: TextInput.Password }";
@@ -1386,6 +1716,45 @@ void tst_qdeclarativetextinput::cursorVisible()
#endif
}
+void tst_qdeclarativetextinput::cursorRectangle()
+{
+ QString text = "Hello World!";
+
+ QDeclarativeTextInput input;
+ input.setText(text);
+ QFontMetricsF fm(input.font());
+ input.setWidth(fm.width(text.mid(0, 5)));
+
+ QRect r;
+
+ for (int i = 0; i <= 5; ++i) {
+ input.setCursorPosition(i);
+ r = input.cursorRectangle();
+ int textWidth = fm.width(text.mid(0, i));
+
+ QVERIFY(r.left() < textWidth);
+ QVERIFY(r.right() > textWidth);
+ QCOMPARE(input.inputMethodQuery(Qt::ImMicroFocus).toRect(), r);
+ }
+
+ // Check the cursor rectangle remains within the input bounding rect when auto scrolling.
+ QVERIFY(r.left() < input.boundingRect().width());
+ QVERIFY(r.right() >= input.width());
+
+ for (int i = 6; i < text.length(); ++i) {
+ input.setCursorPosition(i);
+ QCOMPARE(r, input.cursorRectangle());
+ QCOMPARE(input.inputMethodQuery(Qt::ImMicroFocus).toRect(), r);
+ }
+
+ for (int i = text.length() - 2; i >= 0; --i) {
+ input.setCursorPosition(i);
+ r = input.cursorRectangle();
+ QVERIFY(r.right() >= 0);
+ QCOMPARE(input.inputMethodQuery(Qt::ImMicroFocus).toRect(), r);
+ }
+}
+
void tst_qdeclarativetextinput::readOnly()
{
QDeclarativeView *canvas = createView(SRCDIR "/data/readOnly.qml");
@@ -1460,13 +1829,23 @@ void tst_qdeclarativetextinput::echoMode()
QCOMPARE(input->inputMethodHints(), ref);
QCOMPARE(input->text(), initial);
QCOMPARE(input->displayText(), QLatin1String("QQQQQQQQ"));
+ QCOMPARE(input->inputMethodQuery(Qt::ImSurroundingText).toString(), QLatin1String("QQQQQQQQ"));
QTest::keyPress(canvas, Qt::Key_A);//Clearing previous entry is part of PasswordEchoOnEdit
QTest::keyRelease(canvas, Qt::Key_A, Qt::NoModifier ,10);
QCOMPARE(input->text(), QLatin1String("a"));
QCOMPARE(input->displayText(), QLatin1String("a"));
+ QCOMPARE(input->inputMethodQuery(Qt::ImSurroundingText).toString(), QLatin1String("a"));
input->setFocus(false);
QVERIFY(input->hasActiveFocus() == false);
QCOMPARE(input->displayText(), QLatin1String("Q"));
+ QCOMPARE(input->inputMethodQuery(Qt::ImSurroundingText).toString(), QLatin1String("Q"));
+ input->setFocus(true);
+ QInputMethodEvent inputEvent;
+ inputEvent.setCommitString(initial);
+ QApplication::sendEvent(canvas, &inputEvent);
+ QCOMPARE(input->text(), initial);
+ QCOMPARE(input->displayText(), initial);
+ QCOMPARE(input->inputMethodQuery(Qt::ImSurroundingText).toString(), initial);
delete canvas;
}
@@ -1840,7 +2219,8 @@ void tst_qdeclarativetextinput::preeditAutoScroll()
MyInputContext ic;
view.setInputContext(&ic);
QDeclarativeTextInput input;
- input.setWidth(QFontMetricsF(input.font()).width(committedText));
+ QFontMetricsF fm(input.font());
+ input.setWidth(fm.width(committedText));
input.setText(committedText);
input.setPos(0, 0);
input.setFocus(true);
@@ -1853,7 +2233,7 @@ void tst_qdeclarativetextinput::preeditAutoScroll()
// test the text is scrolled so the preedit is visible.
ic.sendPreeditText(preeditText.mid(0, 3), 1);
QVERIFY(input.positionAt(0) != 0);
- QCOMPARE(input.positionAt(input.width()), 8);
+ QVERIFY(input.cursorRectangle().left() < input.boundingRect().width());
// test the text is scrolled back when the preedit is removed.
ic.sendEvent(QInputMethodEvent());
@@ -1862,26 +2242,31 @@ void tst_qdeclarativetextinput::preeditAutoScroll()
// test if the preedit is larger than the text input that the
// character preceding the cursor is still visible.
+ qreal x = input.positionToRectangle(0).x();
for (int i = 0; i < 3; ++i) {
ic.sendPreeditText(preeditText, i + 1);
- QCOMPARE(input.positionAt(0), 5 + i);
+ QVERIFY(input.cursorRectangle().right() >= fm.width(preeditText.at(i)));
+ QVERIFY(input.positionToRectangle(0).x() < x);
+ x = input.positionToRectangle(0).x();
}
for (int i = 1; i >= 0; --i) {
ic.sendPreeditText(preeditText, i + 1);
- QCOMPARE(input.positionAt(0), 5 + i);
+ QVERIFY(input.cursorRectangle().right() >= fm.width(preeditText.at(i)));
+ QVERIFY(input.positionToRectangle(0).x() > x);
+ x = input.positionToRectangle(0).x();
}
// Test incrementing the preedit cursor doesn't cause further
// scrolling when right most text is visible.
ic.sendPreeditText(preeditText, preeditText.length() - 3);
- int position = input.positionAt(0);
+ x = input.positionToRectangle(0).x();
for (int i = 2; i >= 0; --i) {
ic.sendPreeditText(preeditText, preeditText.length() - i);
- QCOMPARE(input.positionAt(0), position);
+ QCOMPARE(input.positionToRectangle(0).x(), x);
}
for (int i = 1; i < 3; ++i) {
ic.sendPreeditText(preeditText, preeditText.length() - i);
- QCOMPARE(input.positionAt(0), position);
+ QCOMPARE(input.positionToRectangle(0).x(), x);
}
// Test disabling auto scroll.
@@ -1903,6 +2288,7 @@ void tst_qdeclarativetextinput::preeditMicroFocus()
view.setInputContext(&ic);
QDeclarativeTextInput input;
input.setPos(0, 0);
+ input.setAutoScroll(false);
input.setFocus(true);
scene.addItem(&input);
view.show();
@@ -2066,6 +2452,43 @@ void tst_qdeclarativetextinput::inputContextMouseHandler()
ic.eventType = QEvent::None;
}
+void tst_qdeclarativetextinput::inputMethodComposing()
+{
+ QString text = "supercalifragisiticexpialidocious!";
+
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ MyInputContext ic;
+ view.setInputContext(&ic);
+ QDeclarativeTextInput input;
+ input.setWidth(200);
+ input.setText(text.mid(0, 12));
+ input.setCursorPosition(12);
+ input.setPos(0, 0);
+ input.setFocus(true);
+ scene.addItem(&input);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+
+ QSignalSpy spy(&input, SIGNAL(inputMethodComposingChanged()));
+
+ QCOMPARE(input.isInputMethodComposing(), false);
+
+ ic.sendEvent(QInputMethodEvent(text.mid(3), QList<QInputMethodEvent::Attribute>()));
+ QCOMPARE(input.isInputMethodComposing(), true);
+ QCOMPARE(spy.count(), 1);
+
+ ic.sendEvent(QInputMethodEvent(text.mid(12), QList<QInputMethodEvent::Attribute>()));
+ QCOMPARE(input.isInputMethodComposing(), true);
+ QCOMPARE(spy.count(), 1);
+
+ ic.sendEvent(QInputMethodEvent());
+ QCOMPARE(input.isInputMethodComposing(), false);
+ QCOMPARE(spy.count(), 2);
+}
+
QTEST_MAIN(tst_qdeclarativetextinput)
#include "tst_qdeclarativetextinput.moc"
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/Global.js b/tests/auto/declarative/qdeclarativeworkerscript/data/Global.js
new file mode 100644
index 0000000..6bdb4a5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/Global.js
@@ -0,0 +1 @@
+var data = "World"
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/script_include.js b/tests/auto/declarative/qdeclarativeworkerscript/data/script_include.js
new file mode 100644
index 0000000..0385d91
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/script_include.js
@@ -0,0 +1,5 @@
+WorkerScript.onMessage = function(msg) {
+ var res = Qt.include("Global.js");
+ WorkerScript.sendMessage(msg + " " + data)
+}
+
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/worker_include.qml b/tests/auto/declarative/qdeclarativeworkerscript/data/worker_include.qml
new file mode 100644
index 0000000..595cb2b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/worker_include.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+BaseWorker {
+ source: "script_include.js"
+}
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp b/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp
index 4b922fb..b64e10c 100644
--- a/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp
+++ b/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp
@@ -79,6 +79,7 @@ private slots:
void messaging_sendQObjectList();
void messaging_sendJsObject();
void script_with_pragma();
+ void script_included();
void scriptError_onLoad();
void scriptError_onCall();
@@ -226,6 +227,24 @@ void tst_QDeclarativeWorkerScript::script_with_pragma()
delete worker;
}
+void tst_QDeclarativeWorkerScript::script_included()
+{
+ QDeclarativeComponent component(&m_engine, SRCDIR "/data/worker_include.qml");
+ QDeclarativeWorkerScript *worker = qobject_cast<QDeclarativeWorkerScript*>(component.create());
+ QVERIFY(worker != 0);
+
+ QString value("Hello");
+
+ QVERIFY(QMetaObject::invokeMethod(worker, "testSend", Q_ARG(QVariant, value)));
+ waitForEchoMessage(worker);
+
+ const QMetaObject *mo = worker->metaObject();
+ QCOMPARE(mo->property(mo->indexOfProperty("response")).read(worker).toString(), value + " World");
+
+ qApp->processEvents();
+ delete worker;
+}
+
static QString qdeclarativeworkerscript_lastWarning;
static void qdeclarativeworkerscript_warningsHandler(QtMsgType type, const char *msg)
{
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.0.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.0.png
new file mode 100644
index 0000000..160155e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.1.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.1.png
new file mode 100644
index 0000000..160155e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.10.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.10.png
new file mode 100644
index 0000000..1ccab41
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.10.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.11.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.11.png
new file mode 100644
index 0000000..160155e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.11.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.12.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.12.png
new file mode 100644
index 0000000..f25bd7c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.12.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.2.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.2.png
new file mode 100644
index 0000000..f25bd7c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.3.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.3.png
new file mode 100644
index 0000000..dad1de4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.4.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.4.png
new file mode 100644
index 0000000..cd4f23a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.5.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.5.png
new file mode 100644
index 0000000..160155e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.6.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.6.png
new file mode 100644
index 0000000..160155e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.7.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.7.png
new file mode 100644
index 0000000..f25bd7c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.8.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.8.png
new file mode 100644
index 0000000..160155e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.9.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.9.png
new file mode 100644
index 0000000..160155e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.9.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.qml b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.qml
new file mode 100644
index 0000000..e858c11
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.qml
@@ -0,0 +1,1499 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "reanchor.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 48
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 64
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 80
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 96
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 112
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 128
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 144
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 160
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 176
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 192
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 208
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 224
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 240
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 256
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 272
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 288
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 304
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 320
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 336
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 352
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 368
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 384
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 400
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 416
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 432
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 448
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 464
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 480
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 496
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 512
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 528
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 544
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 560
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 576
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 592
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 608
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 624
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 640
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 656
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 672
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 688
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 704
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 720
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 736
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 752
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 768
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 784
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 800
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 816
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 832
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 848
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 864
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 880
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 896
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 912
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 928
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 944
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 960
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 976
+ image: "reanchor.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1008
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1024
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1040
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1056
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 164; y: 196
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1072
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1088
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1104
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1120
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1136
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 164; y: 196
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1152
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1168
+ hash: "f7814217626627ce70ca0e9487354ba9"
+ }
+ Frame {
+ msec: 1184
+ hash: "7825b2b77e441ca6f46dbca80c7fe602"
+ }
+ Frame {
+ msec: 1200
+ hash: "0ac443a9946b0bcf8db768af7d16d51e"
+ }
+ Frame {
+ msec: 1216
+ hash: "c943d5d46f0d527690f38a9c8bd7be51"
+ }
+ Frame {
+ msec: 1232
+ hash: "38151db0c9964d33bcb2ff155ebd468c"
+ }
+ Frame {
+ msec: 1248
+ hash: "0fb8c53587a95a12cced6d30018edec1"
+ }
+ Frame {
+ msec: 1264
+ hash: "2c684a649652270a638aca41a80e327c"
+ }
+ Frame {
+ msec: 1280
+ hash: "60dd5c448ef8b97ec13ad3140a584229"
+ }
+ Frame {
+ msec: 1296
+ hash: "d564f28f9d528daca729db6fab163b6c"
+ }
+ Frame {
+ msec: 1312
+ hash: "4c07b33632ec4f30ee31141099c15a88"
+ }
+ Frame {
+ msec: 1328
+ hash: "9facfd27fa16ee9d493e7fb7bcfadbf8"
+ }
+ Frame {
+ msec: 1344
+ hash: "fc0fbb8aac8f389841e615be1e7b06de"
+ }
+ Frame {
+ msec: 1360
+ hash: "579c18fa201b5609276c761ffd42df33"
+ }
+ Frame {
+ msec: 1376
+ hash: "5b3630c37acfc2599a5a8b2e11aaa34c"
+ }
+ Frame {
+ msec: 1392
+ hash: "2c1ee8aca06dccf0d39287721bf76aa7"
+ }
+ Frame {
+ msec: 1408
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1424
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1440
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1456
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1472
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1488
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1504
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1520
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1536
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1552
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1568
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1584
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1600
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1616
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1632
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1648
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1664
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1680
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1696
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1712
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1728
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1744
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1760
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1776
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1792
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1808
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1824
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1840
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1856
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1872
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1888
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1904
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1920
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1936
+ image: "reanchor.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1968
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1984
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 2000
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 2016
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 170; y: 120
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2032
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 2048
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 2064
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 2080
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 2096
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 170; y: 120
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2112
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 2128
+ hash: "e9d7372c17ca1510eb15faff5d0794b2"
+ }
+ Frame {
+ msec: 2144
+ hash: "60f897e2b9594c4b5c02ce2fbdf9ae3c"
+ }
+ Frame {
+ msec: 2160
+ hash: "c35ead9a8e682e8f3c0a091d232310f7"
+ }
+ Frame {
+ msec: 2176
+ hash: "272632b0568391022590edc09ea30e28"
+ }
+ Frame {
+ msec: 2192
+ hash: "9d4cdb31b01e86a31627e3ff9bb64100"
+ }
+ Frame {
+ msec: 2208
+ hash: "5ee65b0290721fe47508c6435c18554b"
+ }
+ Frame {
+ msec: 2224
+ hash: "8dd65e1a9417318d793d2027de4fe6ae"
+ }
+ Frame {
+ msec: 2240
+ hash: "bcce6d1fd7d2c1539ad9ac42c0552d5e"
+ }
+ Frame {
+ msec: 2256
+ hash: "e01f5850113c178da3383406fe73d6e0"
+ }
+ Frame {
+ msec: 2272
+ hash: "968fc6b2bf6b7d43e05254339cf6123f"
+ }
+ Frame {
+ msec: 2288
+ hash: "30f25fdde31e13934e328fa1d2655ccb"
+ }
+ Frame {
+ msec: 2304
+ hash: "f58a21e96037813c9dd7f933405c9b11"
+ }
+ Frame {
+ msec: 2320
+ hash: "1fe42c887f2eaf7696fcf0b8b884d0fd"
+ }
+ Frame {
+ msec: 2336
+ hash: "848a27b9e4f4c0bcc1a11d6dba7ce92b"
+ }
+ Frame {
+ msec: 2352
+ hash: "ca92736257db83e39f54b04325201942"
+ }
+ Frame {
+ msec: 2368
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 2384
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 134; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2400
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 2416
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 2432
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 2448
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 2464
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 134; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2480
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 2496
+ hash: "9082504eee5e0c3cbef9fd9545f09dcb"
+ }
+ Frame {
+ msec: 2512
+ hash: "dbe5169edb4400c74841a8af64e0949f"
+ }
+ Frame {
+ msec: 2528
+ hash: "d588405fc5e2423cdb954c5624172209"
+ }
+ Frame {
+ msec: 2544
+ hash: "ed2b273ea36fb7d8feaca4d5dae72f81"
+ }
+ Frame {
+ msec: 2560
+ hash: "5249e4824eb169b5ee3f7fb52fe09aa7"
+ }
+ Frame {
+ msec: 2576
+ hash: "2838eff2a1a299c9e47cf78be99172ca"
+ }
+ Frame {
+ msec: 2592
+ hash: "c47f6a937a4a6ef045159d7ba04de8af"
+ }
+ Frame {
+ msec: 2608
+ hash: "fd3bc1b9ba2629bccb0fec04deffcdad"
+ }
+ Frame {
+ msec: 2624
+ hash: "54c9b8599a32ac95aff324977b34f7e6"
+ }
+ Frame {
+ msec: 2640
+ hash: "cc5652a05828146cdc9c9b8430f5f59c"
+ }
+ Frame {
+ msec: 2656
+ hash: "ce5815fb51a4bd697a2fde46084e118b"
+ }
+ Frame {
+ msec: 2672
+ hash: "01dfd2604263f1fd24382ce876af10f9"
+ }
+ Frame {
+ msec: 2688
+ hash: "45ea282d20ee9e345eb2cac8c22c42e0"
+ }
+ Frame {
+ msec: 2704
+ hash: "afd26ac9776e57c94e4b52ebfeb7206c"
+ }
+ Frame {
+ msec: 2720
+ hash: "97aeed321d4d92cb1ec236d2a98fbe9b"
+ }
+ Mouse {
+ type: 4
+ button: 1
+ buttons: 1
+ x: 134; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2736
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 2752
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 2768
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 2784
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 2800
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 134; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2816
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 2832
+ hash: "81b8228c6aeefe8072b7704f11e6707e"
+ }
+ Frame {
+ msec: 2848
+ hash: "617e416bf117a51b756c90321ebb1449"
+ }
+ Frame {
+ msec: 2864
+ hash: "656d8d5d54c9ee137aceb519aff72cce"
+ }
+ Frame {
+ msec: 2880
+ hash: "94ba3b6f558c010cdd32f54cce436388"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 134; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2896
+ image: "reanchor.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "0bc822fdd4caac17aab80e8601d3a523"
+ }
+ Frame {
+ msec: 2928
+ hash: "886d0407ac76d7344f7a314f07b3efff"
+ }
+ Frame {
+ msec: 2944
+ hash: "eb6c46af5037f24348edbe0dda48fb62"
+ }
+ Frame {
+ msec: 2960
+ hash: "1c578a1eeb67c6833241bcb3214f06fb"
+ }
+ Frame {
+ msec: 2976
+ hash: "55f1631ef567217a5945b2a23c59b549"
+ }
+ Frame {
+ msec: 2992
+ hash: "25fdd4d54ddb035b082dc3a0d0816114"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 134; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3008
+ hash: "25fdd4d54ddb035b082dc3a0d0816114"
+ }
+ Frame {
+ msec: 3024
+ hash: "efd61e7c1aaffec77bd3d2de6645b2c0"
+ }
+ Frame {
+ msec: 3040
+ hash: "02ac5ca0fa7d2ec3903fccd5dc556fa5"
+ }
+ Frame {
+ msec: 3056
+ hash: "daf52e45b8fc68f74e424554074678cc"
+ }
+ Frame {
+ msec: 3072
+ hash: "9e2def87e83b0c4b9f26684665aa1e51"
+ }
+ Frame {
+ msec: 3088
+ hash: "0e72fc762cc9a061e91692376d65d292"
+ }
+ Frame {
+ msec: 3104
+ hash: "c5ac37e4a5250b35a4976bcb31505cca"
+ }
+ Frame {
+ msec: 3120
+ hash: "eefe6bb7963c580c68198ee6098a36f4"
+ }
+ Frame {
+ msec: 3136
+ hash: "7b78d77ac11b72d1fb827ebb66a04c8e"
+ }
+ Frame {
+ msec: 3152
+ hash: "ce5815fb51a4bd697a2fde46084e118b"
+ }
+ Frame {
+ msec: 3168
+ hash: "94ba3b6f558c010cdd32f54cce436388"
+ }
+ Frame {
+ msec: 3184
+ hash: "61a56140e5a6a2bfcee5c6322b37e130"
+ }
+ Frame {
+ msec: 3200
+ hash: "a67b22c0a966fe3fbe869497dc00960f"
+ }
+ Frame {
+ msec: 3216
+ hash: "4edd212676ac93ae761039e80f989349"
+ }
+ Frame {
+ msec: 3232
+ hash: "fea5797441d65625c400238f73d94807"
+ }
+ Frame {
+ msec: 3248
+ hash: "23e9209ff0257343016cffdf7ea6571c"
+ }
+ Frame {
+ msec: 3264
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3280
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3296
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3312
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3328
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3344
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3360
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3376
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3392
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3408
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3424
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3440
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3456
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3472
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3488
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3504
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3520
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3536
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3552
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3568
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3584
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3600
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3616
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3632
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3648
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3664
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3680
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3696
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3712
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3728
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3744
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3760
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3776
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3792
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3808
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3824
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3840
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3856
+ image: "reanchor.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3888
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3904
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3920
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3936
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3952
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3968
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3984
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4000
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4016
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4032
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4048
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4064
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4080
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4096
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4112
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4128
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4144
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4160
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4176
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 124; y: 113
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4192
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4208
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4224
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4240
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4256
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 124; y: 113
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4272
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4288
+ hash: "81b8228c6aeefe8072b7704f11e6707e"
+ }
+ Frame {
+ msec: 4304
+ hash: "617e416bf117a51b756c90321ebb1449"
+ }
+ Frame {
+ msec: 4320
+ hash: "656d8d5d54c9ee137aceb519aff72cce"
+ }
+ Frame {
+ msec: 4336
+ hash: "94ba3b6f558c010cdd32f54cce436388"
+ }
+ Frame {
+ msec: 4352
+ hash: "5b0679ff3730cba4ac026e89c7811fbe"
+ }
+ Frame {
+ msec: 4368
+ hash: "0bc822fdd4caac17aab80e8601d3a523"
+ }
+ Frame {
+ msec: 4384
+ hash: "886d0407ac76d7344f7a314f07b3efff"
+ }
+ Frame {
+ msec: 4400
+ hash: "eb6c46af5037f24348edbe0dda48fb62"
+ }
+ Frame {
+ msec: 4416
+ hash: "1c578a1eeb67c6833241bcb3214f06fb"
+ }
+ Frame {
+ msec: 4432
+ hash: "55f1631ef567217a5945b2a23c59b549"
+ }
+ Frame {
+ msec: 4448
+ hash: "25fdd4d54ddb035b082dc3a0d0816114"
+ }
+ Frame {
+ msec: 4464
+ hash: "295ea6ff4d3c2c7de0cfbc29b2bd2c38"
+ }
+ Frame {
+ msec: 4480
+ hash: "26b978ab645c04731703bcf15ac34a11"
+ }
+ Frame {
+ msec: 4496
+ hash: "0db4c2515b89506df51732c4b9bf75dc"
+ }
+ Frame {
+ msec: 4512
+ hash: "3cf30f3a06e325e195a4a7dec1e04c01"
+ }
+ Frame {
+ msec: 4528
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4544
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4560
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4576
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4592
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4608
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4624
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4640
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4656
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4672
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4688
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4704
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4720
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4736
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4752
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4768
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4784
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4800
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4816
+ image: "reanchor.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4848
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4864
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4880
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4896
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4912
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4928
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4944
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4960
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4976
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4992
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5008
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5024
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5040
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5056
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5072
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5088
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5104
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5120
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5136
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5152
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5168
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5184
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5200
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5216
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5232
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5248
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5264
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5280
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5296
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5312
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5328
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5344
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5360
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5376
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5392
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5408
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5424
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5440
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5456
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5472
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5488
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5504
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5520
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5536
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5552
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5568
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5584
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/reanchor.qml b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/reanchor.qml
new file mode 100644
index 0000000..ba37737
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/reanchor.qml
@@ -0,0 +1,69 @@
+import QtQuick 1.1
+
+Rectangle {
+ id: container
+ width: 200; height: 200
+ Rectangle {
+ id: myRect
+ anchors.layoutDirection: Qt.RightToLeft
+ objectName: "MyRect"
+ color: "green";
+ anchors.left: parent.left
+ anchors.right: rightGuideline.left
+ anchors.top: topGuideline.top
+ anchors.bottom: container.bottom
+ }
+ Item { id: leftGuideline; x: 10 }
+ Item { id: rightGuideline; x: 150 }
+ Item { id: topGuideline; y: 10 }
+ Item { id: bottomGuideline; y: 150 }
+ Item { id: topGuideline2; y: 50 }
+ Item { id: bottomGuideline2; y: 175 }
+ MouseArea {
+ id: wholeArea
+ anchors.fill: parent
+ onClicked: {
+ if (container.state == "") {
+ container.state = "reanchored";
+ } else if (container.state == "reanchored") {
+ container.state = "reanchored2";
+ } else if (container.state == "reanchored2")
+ container.state = "reanchored";
+ }
+ }
+
+ states: [ State {
+ name: "reanchored"
+ AnchorChanges {
+ target: myRect;
+ anchors.left: leftGuideline.left
+ anchors.right: container.right
+ anchors.top: container.top
+ anchors.bottom: bottomGuideline.bottom
+ }
+ }, State {
+ name: "reanchored2"
+ AnchorChanges {
+ target: myRect;
+ anchors.left: undefined
+ anchors.right: undefined
+ anchors.top: topGuideline2.top
+ anchors.bottom: bottomGuideline2.bottom
+ }
+ }]
+
+ transitions: Transition {
+ AnchorAnimation { }
+ }
+
+ MouseArea {
+ width: 50; height: 50
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ onClicked: {
+ container.state = "";
+ }
+ }
+
+ state: "reanchored"
+}
diff --git a/tests/auto/gui.pro b/tests/auto/gui.pro
index 4b809fb..b2e9e6f 100644
--- a/tests/auto/gui.pro
+++ b/tests/auto/gui.pro
@@ -110,6 +110,7 @@ SUBDIRS=\
qmimedata \
qmouseevent_modal \
qmovie \
+ qvolatileimage \
qnetworkaccessmanager_and_qprogressdialog \
qnetworkcachemetadata \
qnetworkdiskcache \
diff --git a/tests/auto/mediaobject/dummy/dummy.pro b/tests/auto/mediaobject/dummy/dummy.pro
index 88b864b..9797500 100644
--- a/tests/auto/mediaobject/dummy/dummy.pro
+++ b/tests/auto/mediaobject/dummy/dummy.pro
@@ -1,7 +1,7 @@
TEMPLATE = lib
isEmpty(QT_MAJOR_VERSION) {
- VERSION=4.6.4
+ VERSION=4.7.4
} else {
VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
}
diff --git a/tests/auto/nativeimagehandleprovider/nativeimagehandleprovider.pro b/tests/auto/nativeimagehandleprovider/nativeimagehandleprovider.pro
new file mode 100644
index 0000000..fb8ecb0
--- /dev/null
+++ b/tests/auto/nativeimagehandleprovider/nativeimagehandleprovider.pro
@@ -0,0 +1,6 @@
+load(qttest_p4)
+SOURCES += tst_nativeimagehandleprovider.cpp
+symbian {
+ LIBS += -lfbscli -lbitgdi
+ contains(QT_CONFIG, openvg): QT *= openvg
+}
diff --git a/tests/auto/nativeimagehandleprovider/tst_nativeimagehandleprovider.cpp b/tests/auto/nativeimagehandleprovider/tst_nativeimagehandleprovider.cpp
new file mode 100644
index 0000000..3a315f2
--- /dev/null
+++ b/tests/auto/nativeimagehandleprovider/tst_nativeimagehandleprovider.cpp
@@ -0,0 +1,237 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite 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 <QtTest/QtTest>
+#include <QtGui/private/qpixmapdata_p.h>
+#include <QtGui/private/qnativeimagehandleprovider_p.h>
+#include <QScopedPointer>
+#include <QPixmap>
+#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG)
+#include <fbs.h>
+#include <bitdev.h>
+#include <QtOpenVG/private/qpixmapdata_vg_p.h>
+#endif
+
+QPixmap pixmapFromNativeImageHandleProvider(QNativeImageHandleProvider *source)
+{
+#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG)
+ if (!source)
+ return QPixmap();
+ QScopedPointer<QPixmapData> pd(QPixmapData::create(0, 0, QPixmapData::PixmapType));
+ pd->fromNativeType(source, QPixmapData::NativeImageHandleProvider);
+ return QPixmap(pd.take());
+#else
+ Q_UNUSED(source);
+ return QPixmap();
+#endif
+}
+
+class DummyProvider : public QNativeImageHandleProvider
+{
+public:
+ void get(void **handle, QString *type);
+ void release(void *handle, const QString &type);
+};
+
+void DummyProvider::get(void **handle, QString *type)
+{
+ *handle = (void *) 0x12345678;
+ *type = "some dummy type";
+}
+
+void DummyProvider::release(void *handle, const QString &type)
+{
+ Q_UNUSED(handle);
+ Q_UNUSED(type);
+}
+
+#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG)
+class BitmapProvider : public QNativeImageHandleProvider
+{
+public:
+ BitmapProvider() : bmp(0), refCount(0), w(50), h(60) { }
+ void get(void **handle, QString *type);
+ void release(void *handle, const QString &type);
+
+ CFbsBitmap *bmp;
+ int refCount, w, h;
+ void *returnedHandle;
+ QString returnedType;
+};
+
+void BitmapProvider::get(void **handle, QString *type)
+{
+ // There may not be a release() if the get() fails so don't bother with
+ // refcounting in such cases.
+ if (bmp)
+ ++refCount;
+ returnedType = QLatin1String("CFbsBitmap");
+ returnedHandle = bmp;
+ *handle = returnedHandle;
+ *type = returnedType;
+}
+
+void BitmapProvider::release(void *handle, const QString &type)
+{
+ if (handle == returnedHandle && type == returnedType && returnedHandle) {
+ --refCount;
+ }
+}
+#endif // symbian & openvg
+
+class tst_NativeImageHandleProvider : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_NativeImageHandleProvider() { }
+
+private slots:
+ void create();
+ void bitmap();
+ void hibernate();
+};
+
+void tst_NativeImageHandleProvider::create()
+{
+ QPixmap pm = pixmapFromNativeImageHandleProvider(0);
+ QVERIFY(pm.isNull());
+ QPixmap tmp(10, 20);
+ if (tmp.pixmapData()->classId() == QPixmapData::OpenVGClass) {
+ // Verify that null pixmap is properly returned when get() provides bogus results.
+ DummyProvider prov;
+ pm = pixmapFromNativeImageHandleProvider(&prov);
+ QVERIFY(pm.isNull());
+ pm = QPixmap();
+ } else {
+ QSKIP("Not openvg, skipping non-trivial tests", SkipSingle);
+ }
+}
+
+void tst_NativeImageHandleProvider::bitmap()
+{
+#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG)
+ QPixmap tmp(10, 20);
+ if (tmp.pixmapData()->classId() == QPixmapData::OpenVGClass) {
+ BitmapProvider prov;
+
+ // This should fail because of null ptr.
+ QPixmap pm = pixmapFromNativeImageHandleProvider(&prov);
+ QVERIFY(pm.isNull());
+ pm = QPixmap();
+ QCOMPARE(prov.refCount, 0);
+
+ prov.bmp = new CFbsBitmap;
+ QCOMPARE(prov.bmp->Create(TSize(prov.w, prov.h), EColor16MAP), KErrNone);
+ CFbsBitmapDevice *bitmapDevice = CFbsBitmapDevice::NewL(prov.bmp);
+ CBitmapContext *bitmapContext = 0;
+ QCOMPARE(bitmapDevice->CreateBitmapContext(bitmapContext), KErrNone);
+ TRgb symbianColor = TRgb(255, 200, 100);
+ bitmapContext->SetBrushColor(symbianColor);
+ bitmapContext->Clear();
+ delete bitmapContext;
+ delete bitmapDevice;
+
+ pm = pixmapFromNativeImageHandleProvider(&prov);
+ QVERIFY(!pm.isNull());
+ QCOMPARE(pm.width(), prov.w);
+ QCOMPARE(pm.height(), prov.h);
+ QVERIFY(prov.refCount == 1);
+ QImage img = pm.toImage();
+ QVERIFY(prov.refCount == 1);
+ QRgb pix = img.pixel(QPoint(1, 2));
+ QCOMPARE(qRed(pix), symbianColor.Red());
+ QCOMPARE(qGreen(pix), symbianColor.Green());
+ QCOMPARE(qBlue(pix), symbianColor.Blue());
+
+ pm = QPixmap(); // should result in calling release
+ QCOMPARE(prov.refCount, 0);
+ delete prov.bmp;
+ } else {
+ QSKIP("Not openvg", SkipSingle);
+ }
+#else
+ QSKIP("Not applicable", SkipSingle);
+#endif
+}
+
+void tst_NativeImageHandleProvider::hibernate()
+{
+#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG)
+ QPixmap tmp(10, 20);
+ if (tmp.pixmapData()->classId() == QPixmapData::OpenVGClass) {
+ BitmapProvider prov;
+ prov.bmp = new CFbsBitmap;
+ QCOMPARE(prov.bmp->Create(TSize(prov.w, prov.h), EColor16MAP), KErrNone);
+
+ QPixmap pm = pixmapFromNativeImageHandleProvider(&prov);
+ QCOMPARE(prov.refCount, 1);
+
+ QVGPixmapData *vgpd = static_cast<QVGPixmapData *>(pm.pixmapData());
+ vgpd->hibernate();
+ QCOMPARE(prov.refCount, 0);
+
+ // Calling toVGImage() may cause some warnings as we don't have a gui initialized,
+ // but the only thing we care about here is get() being called.
+ vgpd->toVGImage();
+ QCOMPARE(prov.refCount, 1);
+
+ pm = QPixmap();
+ QCOMPARE(prov.refCount, 0);
+ delete prov.bmp;
+ } else {
+ QSKIP("Not openvg", SkipSingle);
+ }
+#else
+ QSKIP("Not applicable", SkipSingle);
+#endif
+}
+
+int main(int argc, char *argv[])
+{
+ QApplication::setGraphicsSystem("openvg");
+ QApplication app(argc, argv);
+ tst_NativeImageHandleProvider tc;
+ return QTest::qExec(&tc, argc, argv);
+}
+
+#include "tst_nativeimagehandleprovider.moc"
diff --git a/tests/auto/other.pro b/tests/auto/other.pro
index 3c8f856..40fa4a9 100644
--- a/tests/auto/other.pro
+++ b/tests/auto/other.pro
@@ -32,7 +32,8 @@ SUBDIRS=\
qvariant \
qwidget \
qworkspace \
- windowsmobile
+ windowsmobile \
+ nativeimagehandleprovider
contains(QT_CONFIG, OdfWriter):SUBDIRS += qzip qtextodfwriter
mac: {
diff --git a/tests/auto/qdesktopwidget/tst_qdesktopwidget.cpp b/tests/auto/qdesktopwidget/tst_qdesktopwidget.cpp
index 0256b82..f66b849 100644
--- a/tests/auto/qdesktopwidget/tst_qdesktopwidget.cpp
+++ b/tests/auto/qdesktopwidget/tst_qdesktopwidget.cpp
@@ -127,7 +127,7 @@ void tst_QDesktopWidget::screenNumberForQWidget()
QWidget widget;
widget.show();
- QApplication::processEvents();
+ QTest::qWaitForWindowShown(&widget);
QVERIFY(widget.isVisible());
int widgetScreen = desktop.screenNumber(&widget);
@@ -142,7 +142,9 @@ void tst_QDesktopWidget::screenNumberForQPoint()
QRect allScreens;
for (int i = 0; i < desktopWidget->numScreens(); ++i) {
QRect screenGeometry = desktopWidget->screenGeometry(i);
+#if !defined(Q_OS_SYMBIAN)
QCOMPARE(desktopWidget->screenNumber(screenGeometry.center()), i);
+#endif
allScreens |= screenGeometry;
}
@@ -180,7 +182,6 @@ void tst_QDesktopWidget::screenGeometry()
total = desktopWidget->screenGeometry(i);
available = desktopWidget->availableGeometry(i);
}
- QVERIFY(total.contains(r));
}
QTEST_MAIN(tst_QDesktopWidget)
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index dacb61e..168f75e 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -447,7 +447,8 @@ private slots:
void updateMicroFocus();
void textItem_shortcuts();
void scroll();
- void stopClickFocusPropagation();
+ void focusHandling_data();
+ void focusHandling();
void deviceCoordinateCache_simpleRotations();
// task specific tests below me
@@ -10537,8 +10538,39 @@ void tst_QGraphicsItem::scroll()
QCOMPARE(item2->lastExposedRect, expectedItem2Expose);
}
-void tst_QGraphicsItem::stopClickFocusPropagation()
+Q_DECLARE_METATYPE(QGraphicsItem::GraphicsItemFlag);
+
+void tst_QGraphicsItem::focusHandling_data()
{
+ QTest::addColumn<QGraphicsItem::GraphicsItemFlag>("focusFlag");
+ QTest::addColumn<bool>("useStickyFocus");
+ QTest::addColumn<int>("expectedFocusItem"); // 0: none, 1: focusableUnder, 2: itemWithFocus
+
+ QTest::newRow("Focus goes through.")
+ << static_cast<QGraphicsItem::GraphicsItemFlag>(0x0) << false << 1;
+
+ QTest::newRow("Focus goes through, even with sticky scene.")
+ << static_cast<QGraphicsItem::GraphicsItemFlag>(0x0) << true << 1;
+
+ QTest::newRow("With ItemStopsClickFocusPropagation, we cannot focus the item beneath the flagged one (but can still focus-out).")
+ << QGraphicsItem::ItemStopsClickFocusPropagation << false << 0;
+
+ QTest::newRow("With ItemStopsClickFocusPropagation, we cannot focus the item beneath the flagged one (and cannot focus-out if scene is sticky).")
+ << QGraphicsItem::ItemStopsClickFocusPropagation << true << 2;
+
+ QTest::newRow("With ItemStopsFocusHandling, focus cannot be changed by presses.")
+ << QGraphicsItem::ItemStopsFocusHandling << false << 2;
+
+ QTest::newRow("With ItemStopsFocusHandling, focus cannot be changed by presses (even if scene is sticky).")
+ << QGraphicsItem::ItemStopsFocusHandling << true << 2;
+}
+
+void tst_QGraphicsItem::focusHandling()
+{
+ QFETCH(QGraphicsItem::GraphicsItemFlag, focusFlag);
+ QFETCH(bool, useStickyFocus);
+ QFETCH(int, expectedFocusItem);
+
class MyItem : public QGraphicsRectItem
{
public:
@@ -10549,12 +10581,9 @@ void tst_QGraphicsItem::stopClickFocusPropagation()
}
};
- QGraphicsScene scene(-50, -50, 400, 400);
- scene.setStickyFocus(true);
-
QGraphicsRectItem *noFocusOnTop = new MyItem;
+ noFocusOnTop->setFlag(QGraphicsItem::ItemIsFocusable, false);
noFocusOnTop->setBrush(Qt::yellow);
- noFocusOnTop->setFlag(QGraphicsItem::ItemStopsClickFocusPropagation);
QGraphicsRectItem *focusableUnder = new MyItem;
focusableUnder->setBrush(Qt::blue);
@@ -10566,9 +10595,13 @@ void tst_QGraphicsItem::stopClickFocusPropagation()
itemWithFocus->setFlag(QGraphicsItem::ItemIsFocusable);
itemWithFocus->setPos(250, 10);
+ QGraphicsScene scene(-50, -50, 400, 400);
scene.addItem(noFocusOnTop);
scene.addItem(focusableUnder);
scene.addItem(itemWithFocus);
+ scene.setStickyFocus(useStickyFocus);
+
+ noFocusOnTop->setFlag(focusFlag);
focusableUnder->stackBefore(noFocusOnTop);
itemWithFocus->setFocus();
@@ -10580,14 +10613,28 @@ void tst_QGraphicsItem::stopClickFocusPropagation()
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
QVERIFY(itemWithFocus->hasFocus());
- QPointF mousePressPoint = noFocusOnTop->mapToScene(QPointF());
- mousePressPoint.rx() += 60;
- mousePressPoint.ry() += 60;
+ const QPointF mousePressPoint = noFocusOnTop->mapToScene(noFocusOnTop->boundingRect().center());
const QList<QGraphicsItem *> itemsAtMousePressPosition = scene.items(mousePressPoint);
- QVERIFY(itemsAtMousePressPosition.contains(focusableUnder));
+ QVERIFY(itemsAtMousePressPosition.contains(noFocusOnTop));
sendMousePress(&scene, mousePressPoint);
- QVERIFY(itemWithFocus->hasFocus());
+
+ switch (expectedFocusItem) {
+ case 0:
+ QCOMPARE(scene.focusItem(), static_cast<QGraphicsRectItem *>(0));
+ break;
+ case 1:
+ QCOMPARE(scene.focusItem(), focusableUnder);
+ break;
+ case 2:
+ QCOMPARE(scene.focusItem(), itemWithFocus);
+ break;
+ }
+
+ // Sanity check - manually setting the focus must work regardless of our
+ // focus handling flags:
+ focusableUnder->setFocus();
+ QCOMPARE(scene.focusItem(), focusableUnder);
}
void tst_QGraphicsItem::deviceCoordinateCache_simpleRotations()
diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
index d446ca7..9ff086c 100644
--- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -289,6 +289,7 @@ private slots:
void taskQTBUG_7863_paintIntoCacheWithTransparentParts();
void taskQT_3674_doNotCrash();
void taskQTBUG_15977_renderWithDeviceCoordinateCache();
+ void taskQTBUG_16401_focusItem();
};
void tst_QGraphicsScene::initTestCase()
@@ -4680,5 +4681,35 @@ void tst_QGraphicsScene::taskQTBUG_15977_renderWithDeviceCoordinateCache()
QCOMPARE(image, expected);
}
+void tst_QGraphicsScene::taskQTBUG_16401_focusItem()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ QGraphicsRectItem *rect = scene.addRect(0, 0, 100, 100);
+ rect->setFlag(QGraphicsItem::ItemIsFocusable);
+
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+ QApplication::setActiveWindow(&view);
+
+ QVERIFY(!scene.focusItem());
+
+ rect->setFocus();
+ QCOMPARE(scene.focusItem(), rect);
+ QFocusEvent focusOut(QEvent::FocusOut);
+ QApplication::sendEvent(&view, &focusOut);
+ QVERIFY(!scene.focusItem());
+ QFocusEvent focusIn(QEvent::FocusIn);
+ QApplication::sendEvent(&view, &focusIn);
+ QCOMPARE(scene.focusItem(), rect);
+
+ rect->clearFocus();
+ QVERIFY(!scene.focusItem());
+ QApplication::sendEvent(&view, &focusOut);
+ QVERIFY(!scene.focusItem());
+ QApplication::sendEvent(&view, &focusIn);
+ QVERIFY(!scene.focusItem());
+}
+
QTEST_MAIN(tst_QGraphicsScene)
#include "tst_qgraphicsscene.moc"
diff --git a/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp b/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp
index 79f2213..9434a0b 100644
--- a/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp
+++ b/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp
@@ -163,10 +163,11 @@ static inline bool fuzzyCompare(qreal p1, qreal p2)
{
// increase delta on small machines using float instead of double
if (sizeof(qreal) == sizeof(float))
- return (qAbs(p1 - p2) <= 0.00002f * qMin(qAbs(p1), qAbs(p2)));
+ return (qAbs(p1 - p2) <= 0.00003f * qMin(qAbs(p1), qAbs(p2)));
else
return (qAbs(p1 - p2) <= 0.00001f * qMin(qAbs(p1), qAbs(p2)));
}
+
static bool fuzzyCompare(const QTransform& t1, const QTransform& t2)
{
return fuzzyCompare(t1.m11(), t2.m11()) &&
@@ -180,6 +181,15 @@ static bool fuzzyCompare(const QTransform& t1, const QTransform& t2)
fuzzyCompare(t1.m33(), t2.m33());
}
+static inline bool fuzzyCompare(const QMatrix4x4& m1, const QMatrix4x4& m2)
+{
+ bool ok = true;
+ for (int y = 0; y < 4; ++y)
+ for (int x = 0; x < 4; ++x)
+ ok &= fuzzyCompare(m1(y, x), m2(y, x));
+ return ok;
+}
+
void tst_QGraphicsTransform::rotation()
{
QGraphicsRotation rotation;
@@ -267,7 +277,7 @@ void tst_QGraphicsTransform::rotation3d()
// because the deg2rad value in QTransform is not accurate
// enough to match what QMatrix4x4 is doing.
} else {
- QVERIFY(qFuzzyCompare(t, r));
+ QVERIFY(fuzzyCompare(t, r));
}
//now let's check that a null vector will not change the transform
diff --git a/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp b/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp
index 0c89013..91dfe47 100644
--- a/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp
+++ b/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp
@@ -171,16 +171,16 @@ void tst_QNetworkCookie::parseSingleCookie_data()
QTest::newRow("with-value7") << "a = b" << cookie;
QTest::newRow("with-value8") << "a = b " << cookie;
- cookie.setValue(",");
+ cookie.setValue("\",\"");
QTest::newRow("with-value-with-special1") << "a = \",\" " << cookie;
- cookie.setValue(";");
+ cookie.setValue("\";\"");
QTest::newRow("with-value-with-special2") << "a = \";\" " << cookie;
- cookie.setValue(" ");
+ cookie.setValue("\" \"");
QTest::newRow("with-value-with-special3") << "a = \" \" " << cookie;
- cookie.setValue("\"");
- QTest::newRow("with-value-with-special3") << "a = \"\\\"\" " << cookie;
- cookie.setValue("\"a, b; c\"");
- QTest::newRow("with-value-with-special4") << "a = \"\\\"a, b; c\\\"\"" << cookie;
+ cookie.setValue("\"\\\"\"");
+ QTest::newRow("with-value-with-special4") << "a = \"\\\"\" " << cookie;
+ cookie.setValue("\"\\\"a, b; c\\\"\"");
+ QTest::newRow("with-value-with-special5") << "a = \"\\\"a, b; c\\\"\"" << cookie;
cookie.setValue("b");
cookie.setSecure(true);
@@ -568,10 +568,18 @@ void tst_QNetworkCookie::parseSingleCookie_data()
cookie.setDomain("mail.yahoo.com");
QTest::newRow("network3") << "YM.LC=v=2&m=9993_262838_159_1558_1063_0_5649_4012_3776161073,9426_260205_549_1295_1336_0_5141_4738_3922731647,6733_258196_952_1364_643_0_3560_-1_0,3677_237633_1294_1294_19267_0_3244_29483_4102206176,1315_235149_1693_1541_941_0_3224_1691_1861378060,1858_214311_2100_1298_19538_0_2873_30900_716411652,6258_212007_2506_1285_1017_0_2868_3606_4288540264,3743_207884_2895_1362_2759_0_2545_7114_3388520216,2654_205253_3257_1297_1332_0_2504_4682_3048534803,1891_184881_3660_1291_19079_0_978_29178_2592538685&f=1&n=20&s=date&o=down&e=1196548712&b=Inbox&u=removed; path=/; domain=mail.yahoo.com" << cookie;
- cookie = QNetworkCookie("__ac", "c2hhdXNtYW46U2FTYW80Wm8%3D");
+ cookie = QNetworkCookie("__ac", "\"c2hhdXNtYW46U2FTYW80Wm8%3D\"");
cookie.setPath("/");
cookie.setExpirationDate(QDateTime(QDate(2008, 8, 30), QTime(20, 21, 49), Qt::UTC));
QTest::newRow("network4") << "__ac=\"c2hhdXNtYW46U2FTYW80Wm8%3D\"; Path=/; Expires=Sat, 30 Aug 2008 20:21:49 +0000" << cookie;
+
+ // linkedin.com sends cookies in quotes and expects the cookie in quotes
+ cookie = QNetworkCookie("leo_auth_token", "\"GST:UroVXaxYA3sVSkoVjMNH9bj4dZxVzK2yekgrAUxMfUsyLTNyPjoP60:1298974875:b675566ae32ab36d7a708c0efbf446a5c22b9fca\"");
+ cookie.setPath("/");
+ cookie.setExpirationDate(QDateTime(QDate(2011, 3, 1), QTime(10, 51, 14), Qt::UTC));
+ QTest::newRow("network5") << "leo_auth_token=\"GST:UroVXaxYA3sVSkoVjMNH9bj4dZxVzK2yekgrAUxMfUsyLTNyPjoP60:1298974875:b675566ae32ab36d7a708c0efbf446a5c22b9fca\"; Version=1; Max-Age=1799; Expires=Tue, 01-Mar-2011 10:51:14 GMT; Path=/" << cookie;
+
+
}
void tst_QNetworkCookie::parseSingleCookie()
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index 8274140..81278b6 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -333,6 +333,8 @@ private Q_SLOTS:
void synchronousRequest();
void synchronousRequestSslFailure();
+ void dontInsertPartialContentIntoTheCache();
+
// NOTE: This test must be last!
void parentingRepliesToTheApp();
};
@@ -573,6 +575,63 @@ public:
Q_DECLARE_METATYPE(MyMemoryCache::CachedContent)
Q_DECLARE_METATYPE(MyMemoryCache::CacheData)
+class MySpyMemoryCache: public QAbstractNetworkCache
+{
+public:
+ MySpyMemoryCache(QObject *parent) : QAbstractNetworkCache(parent) {}
+ ~MySpyMemoryCache()
+ {
+ qDeleteAll(m_buffers);
+ m_buffers.clear();
+ }
+
+ QHash<QUrl, QIODevice*> m_buffers;
+ QList<QUrl> m_insertedUrls;
+
+ QNetworkCacheMetaData metaData(const QUrl &)
+ {
+ return QNetworkCacheMetaData();
+ }
+
+ void updateMetaData(const QNetworkCacheMetaData &)
+ {
+ }
+
+ QIODevice *data(const QUrl &)
+ {
+ return 0;
+ }
+
+ bool remove(const QUrl &url)
+ {
+ delete m_buffers.take(url);
+ return m_insertedUrls.removeAll(url) > 0;
+ }
+
+ qint64 cacheSize() const
+ {
+ return 0;
+ }
+
+ QIODevice *prepare(const QNetworkCacheMetaData &metaData)
+ {
+ QBuffer* buffer = new QBuffer;
+ buffer->open(QIODevice::ReadWrite);
+ buffer->setProperty("url", metaData.url());
+ m_buffers.insert(metaData.url(), buffer);
+ return buffer;
+ }
+
+ void insert(QIODevice *buffer)
+ {
+ QUrl url = buffer->property("url").toUrl();
+ m_insertedUrls << url;
+ delete m_buffers.take(url);
+ }
+
+ void clear() { m_insertedUrls.clear(); }
+};
+
class DataReader: public QObject
{
Q_OBJECT
@@ -951,6 +1010,7 @@ tst_QNetworkReply::tst_QNetworkReply()
qRegisterMetaType<QAuthenticator *>();
qRegisterMetaType<QNetworkProxy>();
qRegisterMetaType<QList<QSslError> >();
+ qRegisterMetaType<QNetworkReply::NetworkError>();
Q_SET_DEFAULT_IAP
@@ -2572,6 +2632,9 @@ void tst_QNetworkReply::ioGetFromHttpBrokenServer_data()
QTest::newRow("justHalfStatus+disconnect") << QByteArray("HTTP/1.1") << true;
QTest::newRow("justStatus+disconnect") << QByteArray("HTTP/1.1 200 OK\r\n") << true;
QTest::newRow("justStatusAndHalfHeaders+disconnect") << QByteArray("HTTP/1.1 200 OK\r\nContent-L") << true;
+
+ QTest::newRow("halfContent+disconnect") << QByteArray("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\nAB") << true;
+
}
void tst_QNetworkReply::ioGetFromHttpBrokenServer()
@@ -2583,29 +2646,35 @@ void tst_QNetworkReply::ioGetFromHttpBrokenServer()
QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort())));
QNetworkReplyPtr reply = manager.get(request);
+ QSignalSpy spy(reply, SIGNAL(error(QNetworkReply::NetworkError)));
+
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
QTestEventLoop::instance().enterLoop(10);
QVERIFY(!QTestEventLoop::instance().timeout());
QCOMPARE(reply->url(), request.url());
+ QCOMPARE(spy.count(), 1);
QVERIFY(reply->error() != QNetworkReply::NoError);
}
void tst_QNetworkReply::ioGetFromHttpStatus100_data()
{
QTest::addColumn<QByteArray>("dataToSend");
- QTest::newRow("normal") << QByteArray("HTTP/1.1 100 Continue\r\n\r\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- QTest::newRow("minimal") << QByteArray("HTTP/1.1 100 Continue\n\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- QTest::newRow("minimal2") << QByteArray("HTTP/1.1 100 Continue\n\nHTTP/1.0 200 OK\r\n\r\n");
- QTest::newRow("minimal3") << QByteArray("HTTP/1.1 100 Continue\n\nHTTP/1.0 200 OK\n\n");
- QTest::newRow("with_headers") << QByteArray("HTTP/1.1 100 Continue\r\nBla: x\r\n\r\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- QTest::newRow("with_headers2") << QByteArray("HTTP/1.1 100 Continue\nBla: x\n\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
+ QTest::addColumn<int>("statusCode");
+ QTest::newRow("normal") << QByteArray("HTTP/1.1 100 Continue\r\n\r\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n") << 200;
+ QTest::newRow("minimal") << QByteArray("HTTP/1.1 100 Continue\n\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n") << 200;
+ QTest::newRow("minimal2") << QByteArray("HTTP/1.1 100 Continue\n\nHTTP/1.0 200 OK\r\n\r\n") << 200;
+ QTest::newRow("minimal3") << QByteArray("HTTP/1.1 100 Continue\n\nHTTP/1.0 200 OK\n\n") << 200;
+ QTest::newRow("minimal+404") << QByteArray("HTTP/1.1 100 Continue\n\nHTTP/1.0 204 No Content\r\n\r\n") << 204;
+ QTest::newRow("with_headers") << QByteArray("HTTP/1.1 100 Continue\r\nBla: x\r\n\r\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n") << 200;
+ QTest::newRow("with_headers2") << QByteArray("HTTP/1.1 100 Continue\nBla: x\n\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n") << 200;
}
void tst_QNetworkReply::ioGetFromHttpStatus100()
{
QFETCH(QByteArray, dataToSend);
+ QFETCH(int, statusCode);
MiniHttpServer server(dataToSend);
server.doClose = true;
@@ -2618,7 +2687,7 @@ void tst_QNetworkReply::ioGetFromHttpStatus100()
QCOMPARE(reply->url(), request.url());
QCOMPARE(reply->error(), QNetworkReply::NoError);
- QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200);
+ QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), statusCode);
QVERIFY(reply->rawHeader("bla").isNull());
}
@@ -2653,6 +2722,7 @@ void tst_QNetworkReply::ioGetFromHttpWithCache_data()
QTest::addColumn<QString>("body");
QTest::addColumn<MyMemoryCache::CachedContent>("cachedReply");
QTest::addColumn<int>("cacheMode");
+ QTest::addColumn<QStringList>("extraHttpHeaders");
QTest::addColumn<bool>("loadedFromCache");
QTest::addColumn<bool>("networkUsed");
@@ -2670,11 +2740,11 @@ void tst_QNetworkReply::ioGetFromHttpWithCache_data()
"\r\n";
QTest::newRow("not-cached,always-network")
- << reply200 << "Reloaded" << MyMemoryCache::CachedContent() << int(QNetworkRequest::AlwaysNetwork) << false << true;
+ << reply200 << "Reloaded" << MyMemoryCache::CachedContent() << int(QNetworkRequest::AlwaysNetwork) << QStringList() << false << true;
QTest::newRow("not-cached,prefer-network")
- << reply200 << "Reloaded" << MyMemoryCache::CachedContent() << int(QNetworkRequest::PreferNetwork) << false << true;
+ << reply200 << "Reloaded" << MyMemoryCache::CachedContent() << int(QNetworkRequest::PreferNetwork) << QStringList() << false << true;
QTest::newRow("not-cached,prefer-cache")
- << reply200 << "Reloaded" << MyMemoryCache::CachedContent() << int(QNetworkRequest::PreferCache) << false << true;
+ << reply200 << "Reloaded" << MyMemoryCache::CachedContent() << int(QNetworkRequest::PreferCache) << QStringList() << false << true;
QDateTime present = QDateTime::currentDateTime().toUTC();
QDateTime past = present.addSecs(-3600);
@@ -2696,14 +2766,14 @@ void tst_QNetworkReply::ioGetFromHttpWithCache_data()
content.first.setLastModified(past);
QTest::newRow("expired,200,prefer-network")
- << reply200 << "Reloaded" << content << int(QNetworkRequest::PreferNetwork) << false << true;
+ << reply200 << "Reloaded" << content << int(QNetworkRequest::PreferNetwork) << QStringList() << false << true;
QTest::newRow("expired,200,prefer-cache")
- << reply200 << "Reloaded" << content << int(QNetworkRequest::PreferCache) << false << true;
+ << reply200 << "Reloaded" << content << int(QNetworkRequest::PreferCache) << QStringList() << false << true;
QTest::newRow("expired,304,prefer-network")
- << reply304 << "Not-reloaded" << content << int(QNetworkRequest::PreferNetwork) << true << true;
+ << reply304 << "Not-reloaded" << content << int(QNetworkRequest::PreferNetwork) << QStringList() << true << true;
QTest::newRow("expired,304,prefer-cache")
- << reply304 << "Not-reloaded" << content << int(QNetworkRequest::PreferCache) << true << true;
+ << reply304 << "Not-reloaded" << content << int(QNetworkRequest::PreferCache) << QStringList() << true << true;
//
// Set to not-expired
@@ -2715,20 +2785,20 @@ void tst_QNetworkReply::ioGetFromHttpWithCache_data()
content.first.setExpirationDate(future);
QTest::newRow("not-expired,200,always-network")
- << reply200 << "Reloaded" << content << int(QNetworkRequest::AlwaysNetwork) << false << true;
+ << reply200 << "Reloaded" << content << int(QNetworkRequest::AlwaysNetwork) << QStringList() << false << true;
QTest::newRow("not-expired,200,prefer-network")
- << reply200 << "Not-reloaded" << content << int(QNetworkRequest::PreferNetwork) << true << false;
+ << reply200 << "Not-reloaded" << content << int(QNetworkRequest::PreferNetwork) << QStringList() << true << false;
QTest::newRow("not-expired,200,prefer-cache")
- << reply200 << "Not-reloaded" << content << int(QNetworkRequest::PreferCache) << true << false;
+ << reply200 << "Not-reloaded" << content << int(QNetworkRequest::PreferCache) << QStringList() << true << false;
QTest::newRow("not-expired,200,always-cache")
- << reply200 << "Not-reloaded" << content << int(QNetworkRequest::AlwaysCache) << true << false;
+ << reply200 << "Not-reloaded" << content << int(QNetworkRequest::AlwaysCache) << QStringList() << true << false;
QTest::newRow("not-expired,304,prefer-network")
- << reply304 << "Not-reloaded" << content << int(QNetworkRequest::PreferNetwork) << true << false;
+ << reply304 << "Not-reloaded" << content << int(QNetworkRequest::PreferNetwork) << QStringList() << true << false;
QTest::newRow("not-expired,304,prefer-cache")
- << reply304 << "Not-reloaded" << content << int(QNetworkRequest::PreferCache) << true << false;
+ << reply304 << "Not-reloaded" << content << int(QNetworkRequest::PreferCache) << QStringList() << true << false;
QTest::newRow("not-expired,304,always-cache")
- << reply304 << "Not-reloaded" << content << int(QNetworkRequest::AlwaysCache) << true << false;
+ << reply304 << "Not-reloaded" << content << int(QNetworkRequest::AlwaysCache) << QStringList() << true << false;
//
// Set must-revalidate now
@@ -2739,20 +2809,42 @@ void tst_QNetworkReply::ioGetFromHttpWithCache_data()
content.first.setRawHeaders(rawHeaders);
QTest::newRow("must-revalidate,200,always-network")
- << reply200 << "Reloaded" << content << int(QNetworkRequest::AlwaysNetwork) << false << true;
+ << reply200 << "Reloaded" << content << int(QNetworkRequest::AlwaysNetwork) << QStringList() << false << true;
QTest::newRow("must-revalidate,200,prefer-network")
- << reply200 << "Reloaded" << content << int(QNetworkRequest::PreferNetwork) << false << true;
+ << reply200 << "Reloaded" << content << int(QNetworkRequest::PreferNetwork) << QStringList() << false << true;
QTest::newRow("must-revalidate,200,prefer-cache")
- << reply200 << "Not-reloaded" << content << int(QNetworkRequest::PreferCache) << true << false;
+ << reply200 << "Not-reloaded" << content << int(QNetworkRequest::PreferCache) << QStringList() << true << false;
QTest::newRow("must-revalidate,200,always-cache")
- << reply200 << "Not-reloaded" << content << int(QNetworkRequest::AlwaysCache) << true << false;
+ << reply200 << "Not-reloaded" << content << int(QNetworkRequest::AlwaysCache) << QStringList() << true << false;
QTest::newRow("must-revalidate,304,prefer-network")
- << reply304 << "Not-reloaded" << content << int(QNetworkRequest::PreferNetwork) << true << true;
+ << reply304 << "Not-reloaded" << content << int(QNetworkRequest::PreferNetwork) << QStringList() << true << true;
QTest::newRow("must-revalidate,304,prefer-cache")
- << reply304 << "Not-reloaded" << content << int(QNetworkRequest::PreferCache) << true << false;
+ << reply304 << "Not-reloaded" << content << int(QNetworkRequest::PreferCache) << QStringList() << true << false;
QTest::newRow("must-revalidate,304,always-cache")
- << reply304 << "Not-reloaded" << content << int(QNetworkRequest::AlwaysCache) << true << false;
+ << reply304 << "Not-reloaded" << content << int(QNetworkRequest::AlwaysCache) << QStringList() << true << false;
+
+ //
+ // Partial content
+ //
+ rawHeaders.clear();
+ rawHeaders << QNetworkCacheMetaData::RawHeader("Date", QLocale::c().toString(past, dateFormat).toLatin1())
+ << QNetworkCacheMetaData::RawHeader("Cache-control", "max-age=7200"); // isn't used in cache loading
+ content.first.setRawHeaders(rawHeaders);
+ content.first.setExpirationDate(future);
+
+ QByteArray reply206 =
+ "HTTP/1.0 206\r\n"
+ "Connection: keep-alive\r\n"
+ "Content-Type: text/plain\r\n"
+ "Cache-control: no-cache\r\n"
+ "Content-Range: bytes 2-6/8\r\n"
+ "Content-length: 4\r\n"
+ "\r\n"
+ "load";
+
+ QTest::newRow("partial,dontuse-cache")
+ << reply206 << "load" << content << int(QNetworkRequest::PreferCache) << (QStringList() << "Range" << "bytes=2-6") << false << true;
}
void tst_QNetworkReply::ioGetFromHttpWithCache()
@@ -2774,6 +2866,15 @@ void tst_QNetworkReply::ioGetFromHttpWithCache()
QNetworkRequest request(url);
request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, cacheMode);
request.setAttribute(QNetworkRequest::CacheSaveControlAttribute, false);
+
+ QFETCH(QStringList, extraHttpHeaders);
+ QStringListIterator it(extraHttpHeaders);
+ while (it.hasNext()) {
+ QString header = it.next();
+ QString value = it.next();
+ request.setRawHeader(header.toLatin1(), value.toLatin1()); // To latin1? Deal with it!
+ }
+
QNetworkReplyPtr reply = manager.get(request);
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
@@ -5233,6 +5334,39 @@ void tst_QNetworkReply::synchronousRequestSslFailure()
QCOMPARE(sslErrorsSpy.count(), 0);
}
+void tst_QNetworkReply::dontInsertPartialContentIntoTheCache()
+{
+ QByteArray reply206 =
+ "HTTP/1.0 206\r\n"
+ "Connection: keep-alive\r\n"
+ "Content-Type: text/plain\r\n"
+ "Cache-control: no-cache\r\n"
+ "Content-Range: bytes 2-6/8\r\n"
+ "Content-length: 4\r\n"
+ "\r\n"
+ "load";
+
+ MiniHttpServer server(reply206);
+ server.doClose = false;
+
+ MySpyMemoryCache *memoryCache = new MySpyMemoryCache(&manager);
+ manager.setCache(memoryCache);
+
+ QUrl url = "http://localhost:" + QString::number(server.serverPort());
+ QNetworkRequest request(url);
+ request.setRawHeader("Range", "bytes=2-6");
+
+ QNetworkReplyPtr reply = manager.get(request);
+
+ connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ QVERIFY(server.totalConnections > 0);
+ QCOMPARE(reply->readAll().constData(), "load");
+ QCOMPARE(memoryCache->m_insertedUrls.count(), 0);
+}
+
// NOTE: This test must be last testcase in tst_qnetworkreply!
void tst_QNetworkReply::parentingRepliesToTheApp()
{
@@ -5242,4 +5376,5 @@ void tst_QNetworkReply::parentingRepliesToTheApp()
}
QTEST_MAIN(tst_QNetworkReply)
+
#include "tst_qnetworkreply.moc"
diff --git a/tests/auto/qpainterpath/tst_qpainterpath.cpp b/tests/auto/qpainterpath/tst_qpainterpath.cpp
index 00f9b91..4ade9ad 100644
--- a/tests/auto/qpainterpath/tst_qpainterpath.cpp
+++ b/tests/auto/qpainterpath/tst_qpainterpath.cpp
@@ -290,6 +290,11 @@ void tst_QPainterPath::contains_QPointF_data()
QTest::newRow("horizontal cubic, out left") << path << QPointF(0, 100) << false;
QTest::newRow("horizontal cubic, out right") << path << QPointF(300, 100) <<false;
QTest::newRow("horizontal cubic, in mid") << path << QPointF(150, 100) << true;
+
+ path = QPainterPath();
+ path.addEllipse(QRectF(-5000.0, -5000.0, 1500000.0, 1500000.0));
+ QTest::newRow("huge ellipse, qreal=float crash") << path << QPointF(1100000.35, 1098000.2) << true;
+
}
void tst_QPainterPath::contains_QPointF()
diff --git a/tests/auto/qpixmap/qpixmap.pro b/tests/auto/qpixmap/qpixmap.pro
index ff8258f..e6a8257 100644
--- a/tests/auto/qpixmap/qpixmap.pro
+++ b/tests/auto/qpixmap/qpixmap.pro
@@ -25,6 +25,7 @@ wince*: {
LIBS += -lfbscli.dll -lbitgdi.dll -lgdi.dll
contains(QT_CONFIG, openvg) {
LIBS += $$QMAKE_LIBS_OPENVG
+ QT *= openvg
}
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index 62a6eb4..0b5c30b 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -52,6 +52,7 @@
#include <qsplashscreen.h>
#include <private/qpixmapdata_p.h>
+#include <private/qdrawhelper_p.h>
#include <QSet>
@@ -68,6 +69,10 @@
#include <fbs.h>
#include <gdi.h>
#include <bitdev.h>
+#if !defined(QT_NO_OPENVG)
+#include <QtOpenVG/qvg.h>
+#include <QtOpenVG/private/qpixmapdata_vg_p.h>
+#endif
#endif
#ifdef Q_WS_X11
@@ -185,6 +190,10 @@ private slots:
void toImageDeepCopy();
void loadAsBitmapOrPixmap();
+
+#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG)
+ void vgImageReadBack();
+#endif
};
static bool lenientCompare(const QPixmap &actual, const QPixmap &expected)
@@ -632,9 +641,12 @@ void tst_QPixmap::mask()
QVERIFY(!pm.isNull());
QVERIFY(!bm.isNull());
- // hw: todo: this will fail if the default pixmap format is
- // argb32_premultiplied. The mask will be all 1's
- QVERIFY(pm.mask().isNull());
+ if (!pm.hasAlphaChannel()) {
+ // This would fail if the default pixmap format is
+ // argb32_premultiplied. The mask will be all 1's.
+ // Therefore this is skipped when the alpha channel is present.
+ QVERIFY(pm.mask().isNull());
+ }
QImage img = bm.toImage();
QVERIFY(img.format() == QImage::Format_MonoLSB
@@ -1256,7 +1268,10 @@ void tst_QPixmap::fromSymbianCFbsBitmap()
QCOMPARE(actualColor, color);
QImage shouldBe(pixmap.width(), pixmap.height(), image.format());
- shouldBe.fill(color.rgba());
+ if (image.format() == QImage::Format_RGB16)
+ shouldBe.fill(qrgb565(color.rgba()).rawValue());
+ else
+ shouldBe.fill(color.rgba());
QCOMPARE(image, shouldBe);
}
__UHEAP_MARKEND;
@@ -1767,6 +1782,104 @@ void tst_QPixmap::toImageDeepCopy()
QVERIFY(first != second);
}
+#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG)
+Q_OPENVG_EXPORT VGImage qPixmapToVGImage(const QPixmap& pixmap);
+class FriendlyVGPixmapData : public QVGPixmapData
+{
+public:
+ FriendlyVGPixmapData(PixelType type) : QVGPixmapData(type) { }
+ bool sourceIsNull() { return source.isNull(); }
+ friend QPixmap pixmapFromVGImage(VGImage image);
+};
+QPixmap pixmapFromVGImage(VGImage image)
+{
+ if (image != VG_INVALID_HANDLE) {
+ int w = vgGetParameteri(image, VG_IMAGE_WIDTH);
+ int h = vgGetParameteri(image, VG_IMAGE_HEIGHT);
+ FriendlyVGPixmapData *pd = new FriendlyVGPixmapData(QPixmapData::PixmapType);
+ pd->resize(w, h);
+ pd->vgImage = image;
+ pd->recreate = false;
+ pd->prevSize = QSize(pd->w, pd->h);
+ return QPixmap(pd);
+ }
+ return QPixmap();
+}
+class Content : public QWidget
+{
+public:
+ void paintEvent(QPaintEvent *) {
+ QPainter painter(this);
+ QColor testPixel(qRgb(200, 150, 100));
+ if (pm.isNull()) { // first phase: create a VGImage
+ painter.beginNativePainting();
+ vgimage = vgCreateImage(VG_sARGB_8888_PRE, w, h, VG_IMAGE_QUALITY_FASTER);
+ QImage img(20, 10, QImage::Format_ARGB32_Premultiplied);
+ img.fill(qRgb(0, 0, 0));
+ QPainter p(&img);
+ p.fillRect(0, 0, img.width(), img.height(), testPixel);
+ p.end();
+ vgImageSubData(vgimage, img.bits(), img.bytesPerLine(), VG_sARGB_8888_PRE, 0, 0, img.width(), img.height());
+ // Now the area 0,0 20x10 (in OpenVG coords) is filled with some color.
+ painter.endNativePainting();
+ } else { // second phase: check if readback works
+ painter.drawPixmap(0, 0, pm);
+ // Drawing should not cause readback, this is important for performance;
+ noreadback_ok = static_cast<FriendlyVGPixmapData *>(pm.pixmapData())->sourceIsNull();
+ // However toImage() requires readback.
+ QImage img = pm.toImage();
+ readback_ok = img.width() == pm.width();
+ readback_ok &= img.height() == pm.height();
+ readback_ok &= !static_cast<FriendlyVGPixmapData *>(pm.pixmapData())->sourceIsNull();
+ uint pix = img.pixel(1, 1);
+ content_ok = qRed(pix) == testPixel.red();
+ content_ok &= qGreen(pix) == testPixel.green();
+ content_ok &= qBlue(pix) == testPixel.blue();
+ pix = img.pixel(img.width() - 1, img.height() - 1);
+ content_ok &= qRed(pix) == 0;
+ content_ok &= qGreen(pix) == 0;
+ content_ok &= qBlue(pix) == 0;
+ }
+ }
+ int w;
+ int h;
+ VGImage vgimage;
+ QPixmap pm;
+ bool noreadback_ok;
+ bool readback_ok;
+ bool content_ok;
+};
+void tst_QPixmap::vgImageReadBack()
+{
+ QPixmap tmp(10, 20);
+ if (tmp.pixmapData()->classId() == QPixmapData::OpenVGClass) {
+ Content c;
+ c.w = 50;
+ c.h = 60;
+ c.vgimage = VG_INVALID_HANDLE;
+ c.noreadback_ok = c.readback_ok = c.content_ok = false;
+ c.showFullScreen();
+ QTest::qWaitForWindowShown(&c);
+ QVERIFY(c.vgimage != VG_INVALID_HANDLE);
+ QPixmap pm = pixmapFromVGImage(c.vgimage);
+ QVERIFY(!pm.isNull());
+ QCOMPARE(pm.width(), c.w);
+ QCOMPARE(pm.height(), c.h);
+ QVERIFY(qPixmapToVGImage(pm) == c.vgimage);
+ QVERIFY(static_cast<FriendlyVGPixmapData *>(pm.pixmapData())->sourceIsNull());
+ c.pm = pm;
+ // Make sure the second phase in paintEvent is executed too.
+ c.hide();
+ c.showFullScreen();
+ QTest::qWaitForWindowShown(&c);
+ QVERIFY(c.noreadback_ok);
+ QVERIFY(c.readback_ok);
+ QVERIFY(c.content_ok);
+ } else {
+ QSKIP("Not using openvg graphicssystem", SkipSingle);
+ }
+}
+#endif // Symbian & OpenVG
QTEST_MAIN(tst_QPixmap)
#include "tst_qpixmap.moc"
diff --git a/tests/auto/qtextblock/tst_qtextblock.cpp b/tests/auto/qtextblock/tst_qtextblock.cpp
index 7b41874..cec3a6a 100644
--- a/tests/auto/qtextblock/tst_qtextblock.cpp
+++ b/tests/auto/qtextblock/tst_qtextblock.cpp
@@ -75,6 +75,7 @@ private slots:
void fragmentOverBlockBoundaries();
void excludeParagraphSeparatorFragment();
void backwardsBlockIterator();
+ void previousBlock_qtbug18026();
private:
QTextDocument *doc;
@@ -174,5 +175,11 @@ void tst_QTextBlock::backwardsBlockIterator()
QCOMPARE(it.fragment().position(), 0);
}
+void tst_QTextBlock::previousBlock_qtbug18026()
+{
+ QTextBlock last = doc->end().previous();
+ QVERIFY(last.isValid());
+}
+
QTEST_MAIN(tst_QTextBlock)
#include "tst_qtextblock.moc"
diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp
index d6cf54c..2d15566 100644
--- a/tests/auto/qtextlayout/tst_qtextlayout.cpp
+++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp
@@ -123,7 +123,8 @@ private slots:
void testLineBreakingAllSpaces();
void lineWidthFromBOM();
void textWidthVsWIdth();
-
+ void textWidthWithStackedTextEngine();
+ void textWidthWithLineSeparator();
private:
QFont testFont;
@@ -1388,6 +1389,32 @@ void tst_QTextLayout::textWidthVsWIdth()
}
}
+void tst_QTextLayout::textWidthWithStackedTextEngine()
+{
+ QString text = QString::fromUtf8("คลิก ถัดไป เพื่อดำเนินการต่อ");
+ QTextLayout layout(text);
+ layout.beginLayout();
+ QTextLine line = layout.createLine();
+ layout.endLayout();
+ QFontMetricsF fm(layout.font());
+ QCOMPARE(line.naturalTextWidth(), fm.width(text));
+}
+
+void tst_QTextLayout::textWidthWithLineSeparator()
+{
+ QString s1("Save Project"), s2("Save Project\ntest");
+ s2.replace('\n', QChar::LineSeparator);
+
+ QTextLayout layout1(s1), layout2(s2);
+ layout1.beginLayout();
+ layout2.beginLayout();
+
+ QTextLine line1 = layout1.createLine();
+ QTextLine line2 = layout2.createLine();
+ line1.setLineWidth(0x1000);
+ line2.setLineWidth(0x1000);
+ QCOMPARE(line1.naturalTextWidth(), line2.naturalTextWidth());
+}
QTEST_MAIN(tst_QTextLayout)
#include "tst_qtextlayout.moc"
diff --git a/tests/auto/qvolatileimage/qvolatileimage.pro b/tests/auto/qvolatileimage/qvolatileimage.pro
new file mode 100644
index 0000000..5a0a613
--- /dev/null
+++ b/tests/auto/qvolatileimage/qvolatileimage.pro
@@ -0,0 +1,7 @@
+load(qttest_p4)
+SOURCES += tst_qvolatileimage.cpp
+
+symbian {
+ TARGET.EPOCHEAPSIZE = 0x200000 0x800000
+ LIBS += -lfbscli
+}
diff --git a/tests/auto/qvolatileimage/tst_qvolatileimage.cpp b/tests/auto/qvolatileimage/tst_qvolatileimage.cpp
new file mode 100644
index 0000000..b91a150
--- /dev/null
+++ b/tests/auto/qvolatileimage/tst_qvolatileimage.cpp
@@ -0,0 +1,403 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite 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 <QtTest/QtTest>
+#include <QtGui/qpainter.h>
+#include <QtGui/qpaintengine.h>
+#include <QtGui/private/qvolatileimage_p.h>
+#ifdef Q_OS_SYMBIAN
+#include <fbs.h>
+#endif
+
+class tst_QVolatileImage : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_QVolatileImage() { }
+
+private slots:
+ void create();
+ void ensureFormat();
+ void dataAccess();
+ void sharing();
+ void paint();
+ void fill();
+ void copy();
+ void bitmap();
+};
+
+void tst_QVolatileImage::create()
+{
+ QVolatileImage nullImg;
+ QVERIFY(nullImg.isNull());
+
+ QVolatileImage img(100, 200, QImage::Format_ARGB32);
+ QVERIFY(!img.isNull());
+ QCOMPARE(img.width(), 100);
+ QCOMPARE(img.height(), 200);
+ QCOMPARE(img.format(), QImage::Format_ARGB32);
+ QCOMPARE(img.byteCount(), img.bytesPerLine() * img.height());
+ QCOMPARE(img.hasAlphaChannel(), true);
+ QCOMPARE(img.depth(), 32);
+
+ QImage source(12, 23, QImage::Format_ARGB32_Premultiplied);
+ img = QVolatileImage(source);
+ QVERIFY(!img.isNull());
+ QCOMPARE(img.width(), 12);
+ QCOMPARE(img.height(), 23);
+ QCOMPARE(img.format(), source.format());
+ QCOMPARE(img.byteCount(), img.bytesPerLine() * img.height());
+ QVERIFY(img.imageRef() == source);
+ QVERIFY(img.toImage() == source);
+ QCOMPARE(img.hasAlphaChannel(), true);
+ QCOMPARE(img.hasAlphaChannel(), img.imageRef().hasAlphaChannel());
+ QCOMPARE(img.hasAlphaChannel(), img.toImage().hasAlphaChannel());
+ QCOMPARE(img.depth(), 32);
+
+#ifdef Q_OS_SYMBIAN
+ CFbsBitmap *bmp = new CFbsBitmap;
+ QVERIFY(bmp->Create(TSize(100, 50), EColor16MAP) == KErrNone);
+ QVolatileImage bmpimg(bmp);
+ QVERIFY(!bmpimg.isNull());
+ QCOMPARE(bmpimg.width(), 100);
+ QCOMPARE(bmpimg.height(), 50);
+ // Verify that we only did handle duplication, not pixel data copying.
+ QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
+ delete bmp;
+ // Check if content is still valid.
+ QImage copyimg = bmpimg.toImage();
+ QCOMPARE(copyimg.format(), QImage::Format_ARGB32_Premultiplied);
+#endif
+}
+
+void tst_QVolatileImage::ensureFormat()
+{
+ QImage source(12, 23, QImage::Format_ARGB32_Premultiplied);
+ QVolatileImage img(source);
+ QVERIFY(!img.isNull());
+ QVERIFY(img.imageRef() == source);
+ QVERIFY(img.toImage() == source);
+
+ QVERIFY(img.ensureFormat(QImage::Format_ARGB32_Premultiplied)); // no-op
+ QVERIFY(img.imageRef() == source);
+ QVERIFY(img.toImage() == source);
+ QVERIFY(img.format() == QImage::Format_ARGB32_Premultiplied);
+
+ QVERIFY(img.ensureFormat(QImage::Format_RGB32)); // new data under-the-hood
+ QVERIFY(img.imageRef() != source);
+ QVERIFY(img.toImage() != source);
+ QVERIFY(img.format() == QImage::Format_RGB32);
+
+#ifdef Q_OS_SYMBIAN
+ CFbsBitmap *bmp = new CFbsBitmap;
+ QVERIFY(bmp->Create(TSize(100, 50), EColor16MAP) == KErrNone);
+ QVolatileImage bmpimg(bmp);
+ QVERIFY(bmpimg.ensureFormat(QImage::Format_ARGB32_Premultiplied)); // no-op
+ QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
+
+ // A different format should cause data copying.
+ QVERIFY(bmpimg.ensureFormat(QImage::Format_RGB32));
+ QVERIFY(bmpimg.constBits() != (const uchar *) bmp->DataAddress());
+ const uchar *prevBits = bmpimg.constBits();
+
+ QVERIFY(bmpimg.ensureFormat(QImage::Format_RGB16));
+ QVERIFY(bmpimg.constBits() != (const uchar *) bmp->DataAddress());
+ QVERIFY(bmpimg.constBits() != prevBits);
+ prevBits = bmpimg.constBits();
+
+ QVERIFY(bmpimg.ensureFormat(QImage::Format_MonoLSB));
+ QVERIFY(bmpimg.constBits() != (const uchar *) bmp->DataAddress());
+ QVERIFY(bmpimg.constBits() != prevBits);
+
+ delete bmp;
+#endif
+}
+
+void tst_QVolatileImage::dataAccess()
+{
+ QImage source(12, 23, QImage::Format_ARGB32_Premultiplied);
+ QVolatileImage img(source);
+ QVERIFY(!img.isNull());
+ img.beginDataAccess();
+ QVERIFY(img.constBits());
+ QVERIFY(img.imageRef().constBits());
+ QVERIFY(img.bits());
+ QVERIFY(img.imageRef().bits());
+ img.endDataAccess();
+
+ img = QVolatileImage(12, 23, QImage::Format_ARGB32);
+ img.beginDataAccess();
+ QVERIFY(img.constBits() && img.bits());
+ img.endDataAccess();
+}
+
+void tst_QVolatileImage::sharing()
+{
+ QVolatileImage img1(100, 100, QImage::Format_ARGB32);
+ QVolatileImage img2 = img1;
+ img1.beginDataAccess();
+ img2.beginDataAccess();
+ QVERIFY(img1.constBits() == img2.constBits());
+ img2.endDataAccess();
+ img1.endDataAccess();
+ img1.imageRef(); // non-const call, should detach
+ img1.beginDataAccess();
+ img2.beginDataAccess();
+ QVERIFY(img1.constBits() != img2.constBits());
+ img2.endDataAccess();
+ img1.endDataAccess();
+
+ // toImage() should return a copy of the internal QImage.
+ // imageRef() is a reference to the internal QImage.
+ QVERIFY(img1.imageRef().constBits() != img1.toImage().constBits());
+
+#ifdef Q_OS_SYMBIAN
+ CFbsBitmap *bmp = new CFbsBitmap;
+ QVERIFY(bmp->Create(TSize(100, 50), EColor16MAP) == KErrNone);
+ QVolatileImage bmpimg(bmp);
+ QVolatileImage bmpimg2;
+ bmpimg2 = bmpimg;
+ QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
+ QCOMPARE(bmpimg2.constBits(), (const uchar *) bmp->DataAddress());
+ // Now force a detach, which should copy the pixel data under-the-hood.
+ bmpimg.imageRef();
+ QVERIFY(bmpimg.constBits() != (const uchar *) bmp->DataAddress());
+ QCOMPARE(bmpimg2.constBits(), (const uchar *) bmp->DataAddress());
+ delete bmp;
+#endif
+}
+
+bool fuzzyCompareImages(const QImage &image1, const QImage &image2, int tolerance)
+{
+ if (image1.bytesPerLine() != image2.bytesPerLine()
+ || image1.width() != image2.width()
+ || image1.height() != image2.height()) {
+ return false;
+ }
+ for (int i = 0; i < image1.height(); i++) {
+ const uchar *line1 = image1.scanLine(i);
+ const uchar *line2 = image2.scanLine(i);
+ int bytes = image1.bytesPerLine();
+ for (int j = 0; j < bytes; j++) {
+ int delta = line1[j] - line2[j];
+ if (qAbs(delta) > tolerance)
+ return false;
+ }
+ }
+ return true;
+}
+
+void tst_QVolatileImage::paint()
+{
+#ifdef Q_OS_SYMBIAN
+ QVolatileImage img(100, 100, QImage::Format_ARGB32);
+ img.beginDataAccess();
+ img.imageRef().fill(QColor(Qt::green).rgba());
+ QPainter p(&img.imageRef());
+ p.drawRect(10, 10, 50, 50);
+ p.end();
+ img.endDataAccess();
+ QImage imgA = img.toImage();
+
+ // The following assumes that on openvg the pixmapdata is backed by QVolatileImage)
+ // (and that openvg is in use)
+ // It should pass with any engine nonetheless.
+ // See if painting into the underlying QImage succeeds.
+ QPixmap pm(100, 100);
+ if (pm.paintEngine()->type() == QPaintEngine::Raster) {
+ pm.fill(Qt::green);
+ QPainter pmp(&pm);
+ pmp.drawRect(10, 10, 50, 50);
+ pmp.end();
+ QImage imgB = pm.toImage();
+ QVERIFY(fuzzyCompareImages(imgA, imgB, 0));
+ // Exercise the accelerated QVolatileImagePaintEngine::drawPixmap() a bit.
+ QPixmap targetPm(pm.size());
+ targetPm.fill(Qt::black);
+ pmp.begin(&targetPm);
+ pmp.drawPixmap(QPointF(0, 0), pm);
+ pmp.end();
+ imgB = targetPm.toImage();
+ QVERIFY(fuzzyCompareImages(imgA, imgB, 0));
+ // Now the overload taking rects.
+ targetPm.fill(Qt::black);
+ pmp.begin(&targetPm);
+ QRectF rect(QPointF(0, 0), pm.size());
+ pmp.drawPixmap(rect, pm, rect);
+ pmp.end();
+ imgB = targetPm.toImage();
+ QVERIFY(fuzzyCompareImages(imgA, imgB, 0));
+ } else {
+ QSKIP("Pixmaps not painted via raster, skipping paint test", SkipSingle);
+ }
+#endif
+}
+
+void tst_QVolatileImage::fill()
+{
+ QVolatileImage img(100, 100, QImage::Format_ARGB32_Premultiplied);
+ QColor col = QColor(10, 20, 30);
+ img.fill(col.rgba());
+ QVERIFY(img.imageRef().pixel(1, 1) == col.rgba());
+ QVERIFY(img.toImage().pixel(1, 1) == col.rgba());
+
+#ifdef Q_OS_SYMBIAN
+ CFbsBitmap *bmp = static_cast<CFbsBitmap *>(img.duplicateNativeImage());
+ QVERIFY(bmp);
+ TRgb pix;
+ bmp->GetPixel(pix, TPoint(1, 1));
+ QCOMPARE(pix.Red(), col.red());
+ QCOMPARE(pix.Green(), col.green());
+ QCOMPARE(pix.Blue(), col.blue());
+ delete bmp;
+#endif
+}
+
+void tst_QVolatileImage::copy()
+{
+ QVolatileImage img(100, 100, QImage::Format_RGB32);
+ img.beginDataAccess();
+ img.imageRef().fill(QColor(Qt::green).rgba());
+ QPainter p(&img.imageRef());
+ p.drawRect(10, 10, 50, 50);
+ p.end();
+ img.endDataAccess();
+
+ QVolatileImage img2(100, 100, QImage::Format_RGB32);
+ img2.copyFrom(&img, QRect());
+ QImage imgA = img.toImage();
+ QImage imgB = img2.toImage();
+ QCOMPARE(imgA.size(), imgB.size());
+ QVERIFY(fuzzyCompareImages(imgA, imgB, 0));
+
+ img2 = QVolatileImage(20, 20, QImage::Format_RGB32);
+ img2.copyFrom(&img, QRect(5, 5, 20, 20));
+ imgA = img.toImage().copy(5, 5, 20, 20);
+ imgB = img2.toImage();
+ QCOMPARE(imgA.size(), imgB.size());
+ QVERIFY(fuzzyCompareImages(imgA, imgB, 0));
+}
+
+void tst_QVolatileImage::bitmap()
+{
+#ifdef Q_OS_SYMBIAN
+ CFbsBitmap *bmp = new CFbsBitmap;
+ QVERIFY(bmp->Create(TSize(100, 50), EColor64K) == KErrNone);
+ QVolatileImage bmpimg(bmp);
+ CFbsBitmap *dupbmp = static_cast<CFbsBitmap *>(bmpimg.duplicateNativeImage());
+ QVERIFY(dupbmp);
+ QVERIFY(dupbmp != bmp);
+ QCOMPARE(dupbmp->DataAddress(), bmp->DataAddress());
+ delete dupbmp;
+ delete bmp;
+ bmpimg.beginDataAccess();
+ qMemSet(bmpimg.bits(), 0, bmpimg.byteCount());
+ qMemSet(bmpimg.bits(), 1, bmpimg.bytesPerLine() * bmpimg.height());
+ bmpimg.endDataAccess();
+
+ // Test bgr->rgb conversion in case of EColor16M.
+ bmp = new CFbsBitmap;
+ QVERIFY(bmp->Create(TSize(101, 89), EColor16M) == KErrNone);
+ bmp->BeginDataAccess();
+ TUint32 *addr = bmp->DataAddress();
+ uint rgb = QColor(10, 20, 30).rgb();
+ qMemCopy(bmp->DataAddress(), &rgb, 3);
+ bmp->EndDataAccess();
+ TRgb symrgb;
+ bmp->GetPixel(symrgb, TPoint(0, 0));
+ QVERIFY(symrgb.Red() == 10 && symrgb.Green() == 20 && symrgb.Blue() == 30);
+ bmpimg = QVolatileImage(bmp);
+ QVERIFY(bmpimg.toImage().pixel(0, 0) == rgb);
+ // check if there really was a conversion
+ bmp->BeginDataAccess();
+ bmpimg.beginDataAccess();
+ qMemCopy(&rgb, bmpimg.constBits(), 3);
+ uint rgb2 = rgb;
+ qMemCopy(&rgb2, bmp->DataAddress(), 3);
+ QVERIFY(rgb != rgb2);
+ bmpimg.endDataAccess(true);
+ bmp->EndDataAccess(true);
+ delete bmp;
+
+ bmp = new CFbsBitmap;
+ QVERIFY(bmp->Create(TSize(101, 89), EGray2) == KErrNone);
+ bmpimg = QVolatileImage(bmp); // inverts pixels, but should do it in place
+ QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
+ QCOMPARE(bmpimg.format(), QImage::Format_MonoLSB);
+ bmpimg.ensureFormat(QImage::Format_ARGB32_Premultiplied);
+ QVERIFY(bmpimg.constBits() != (const uchar *) bmp->DataAddress());
+ QCOMPARE(bmpimg.format(), QImage::Format_ARGB32_Premultiplied);
+ delete bmp;
+
+ // The following two formats must be optimal always.
+ bmp = new CFbsBitmap;
+ QVERIFY(bmp->Create(TSize(101, 89), EColor16MAP) == KErrNone);
+ bmpimg = QVolatileImage(bmp);
+ QCOMPARE(bmpimg.format(), QImage::Format_ARGB32_Premultiplied);
+ QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
+ bmpimg.ensureFormat(QImage::Format_ARGB32_Premultiplied);
+ QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
+ delete bmp;
+ bmp = new CFbsBitmap;
+ QVERIFY(bmp->Create(TSize(101, 89), EColor16MU) == KErrNone);
+ bmpimg = QVolatileImage(bmp);
+ QCOMPARE(bmpimg.format(), QImage::Format_RGB32);
+ QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
+ bmpimg.ensureFormat(QImage::Format_RGB32);
+ QCOMPARE(bmpimg.constBits(), (const uchar *) bmp->DataAddress());
+ delete bmp;
+
+#else
+ QSKIP("CFbsBitmap is only available on Symbian, skipping bitmap test", SkipSingle);
+#endif
+}
+
+int main(int argc, char *argv[])
+{
+ QApplication::setGraphicsSystem("openvg");
+ QApplication app(argc, argv);
+ tst_QVolatileImage tc;
+ return QTest::qExec(&tc, argc, argv);
+}
+
+#include "tst_qvolatileimage.moc"
diff --git a/tests/auto/selftests/expected_cmptest.txt b/tests/auto/selftests/expected_cmptest.txt
index fccaca3..a0d3485 100644
--- a/tests/auto/selftests/expected_cmptest.txt
+++ b/tests/auto/selftests/expected_cmptest.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_Cmptest *********
-Config: Using QTest library 4.7.2, Qt 4.7.2
+Config: Using QTest library 4.7.4, Qt 4.7.4
PASS : tst_Cmptest::initTestCase()
PASS : tst_Cmptest::compare_boolfuncs()
PASS : tst_Cmptest::compare_pointerfuncs()
diff --git a/tests/auto/selftests/expected_crashes_3.txt b/tests/auto/selftests/expected_crashes_3.txt
index 2558f68..88ba69f 100644
--- a/tests/auto/selftests/expected_crashes_3.txt
+++ b/tests/auto/selftests/expected_crashes_3.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_Crashes *********
-Config: Using QTest library 4.7.2, Qt 4.7.2
+Config: Using QTest library 4.7.4, Qt 4.7.4
PASS : tst_Crashes::initTestCase()
QFATAL : tst_Crashes::crash() Received signal 11
FAIL! : tst_Crashes::crash() Received a fatal error.
diff --git a/tests/auto/selftests/expected_longstring.txt b/tests/auto/selftests/expected_longstring.txt
index c56244b..7f50020 100644
--- a/tests/auto/selftests/expected_longstring.txt
+++ b/tests/auto/selftests/expected_longstring.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_LongString *********
-Config: Using QTest library 4.7.2, Qt 4.7.2
+Config: Using QTest library 4.7.4, Qt 4.7.4
PASS : tst_LongString::initTestCase()
FAIL! : tst_LongString::failWithLongString() Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui.
diff --git a/tests/auto/selftests/expected_maxwarnings.txt b/tests/auto/selftests/expected_maxwarnings.txt
index 7846435..cd80a04 100644
--- a/tests/auto/selftests/expected_maxwarnings.txt
+++ b/tests/auto/selftests/expected_maxwarnings.txt
@@ -1,5 +1,5 @@
********* Start testing of MaxWarnings *********
-Config: Using QTest library 4.7.2, Qt 4.7.2
+Config: Using QTest library 4.7.4, Qt 4.7.4
PASS : MaxWarnings::initTestCase()
QWARN : MaxWarnings::warn() 0
QWARN : MaxWarnings::warn() 1
diff --git a/tests/auto/selftests/expected_skip.txt b/tests/auto/selftests/expected_skip.txt
index 5c9e497..c259c68 100644
--- a/tests/auto/selftests/expected_skip.txt
+++ b/tests/auto/selftests/expected_skip.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_Skip *********
-Config: Using QTest library 4.7.2, Qt 4.7.2
+Config: Using QTest library 4.7.4, Qt 4.7.4
PASS : tst_Skip::initTestCase()
SKIP : tst_Skip::test() skipping all
Loc: [/home/user/depot/qt-git/mainline/tests/auto/selftests/skip/tst_skip.cpp(68)]
diff --git a/tools/assistant/tools/assistant/doc/assistant.qdocconf b/tools/assistant/tools/assistant/doc/assistant.qdocconf
index 57abeae..45ad76a 100644
--- a/tools/assistant/tools/assistant/doc/assistant.qdocconf
+++ b/tools/assistant/tools/assistant/doc/assistant.qdocconf
@@ -10,7 +10,7 @@ description = "Qt Assistant"
HTML.{postheader,address} = ""
HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \
"<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \
- "<td width=\"30%\" align=\"left\">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \
+ "<td width=\"30%\" align=\"left\">Copyright &copy; 2011 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \
"<td width=\"40%\" align=\"center\">Trademarks</td>\n" \
- "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt 4.7.2</div></td>\n" \
+ "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt 4.7.4</div></td>\n" \
"</tr></table></div></address>"
diff --git a/tools/designer/src/components/formeditor/qdesigner_resource.cpp b/tools/designer/src/components/formeditor/qdesigner_resource.cpp
index 430b070..6d718bb 100644
--- a/tools/designer/src/components/formeditor/qdesigner_resource.cpp
+++ b/tools/designer/src/components/formeditor/qdesigner_resource.cpp
@@ -1190,7 +1190,7 @@ QWidget *QDesignerResource::createWidget(const QString &widgetName, QWidget *par
parentWidget->setProperty("_q_widgetOrder", qVariantFromValue(list));
QList<QWidget *> zOrder = qVariantValue<QWidgetList>(parentWidget->property("_q_zOrder"));
zOrder.append(w);
- parentWidget->setProperty("_q_zOrder", qVariantFromValue(list));
+ parentWidget->setProperty("_q_zOrder", qVariantFromValue(zOrder));
}
} else {
core()->metaDataBase()->add(w);
diff --git a/tools/designer/src/lib/shared/widgetfactory.cpp b/tools/designer/src/lib/shared/widgetfactory.cpp
index 887bb04..36f795e 100644
--- a/tools/designer/src/lib/shared/widgetfactory.cpp
+++ b/tools/designer/src/lib/shared/widgetfactory.cpp
@@ -412,8 +412,10 @@ QWidget *WidgetFactory::createWidget(const QString &widgetName, QWidget *parentW
// Currently happens in the case of Q3-Support widgets
baseClass =fallBackBaseClass;
}
- w = createWidget(baseClass, parentWidget);
- promoteWidget(core(),w,widgetName);
+ if (QWidget *promotedWidget = createWidget(baseClass, parentWidget)) {
+ promoteWidget(core(), promotedWidget, widgetName);
+ return promotedWidget; // Do not initialize twice.
+ }
} while (false);
Q_ASSERT(w != 0);
diff --git a/tools/qdoc3/codemarker.cpp b/tools/qdoc3/codemarker.cpp
index 58642ef..84a09ce 100644
--- a/tools/qdoc3/codemarker.cpp
+++ b/tools/qdoc3/codemarker.cpp
@@ -491,7 +491,7 @@ static QString encode(const QString &string)
#endif
}
-QStringList CodeMarker::macRefsForNode(const Node *node)
+QStringList CodeMarker::macRefsForNode(Node *node)
{
QString result = QLatin1String("cpp/");
switch (node->type()) {
@@ -583,7 +583,7 @@ QStringList CodeMarker::macRefsForNode(const Node *node)
{
NodeList list = static_cast<const PropertyNode*>(node)->functions();
QStringList stringList;
- foreach (const Node *node, list) {
+ foreach (Node* node, list) {
stringList += macRefsForNode(node);
}
return stringList;
diff --git a/tools/qdoc3/codemarker.h b/tools/qdoc3/codemarker.h
index 65fcdd4..21bc31f 100644
--- a/tools/qdoc3/codemarker.h
+++ b/tools/qdoc3/codemarker.h
@@ -155,7 +155,7 @@ class CodeMarker
const Tree* tree,
const Node* relative,
const Node* self = 0);
- virtual QStringList macRefsForNode(const Node* node);
+ virtual QStringList macRefsForNode(Node* node);
static void initialize(const Config& config);
static void terminate();
diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp
index 595756a..4d04085 100644
--- a/tools/qdoc3/cppcodeparser.cpp
+++ b/tools/qdoc3/cppcodeparser.cpp
@@ -97,6 +97,22 @@ QT_BEGIN_NAMESPACE
#define COMMAND_QMLBASICTYPE Doc::alias("qmlbasictype")
#endif
+#define COMMAND_AUDIENCE Doc::alias("audience")
+#define COMMAND_CATEGORY Doc::alias("category")
+#define COMMAND_PRODNAME Doc::alias("prodname")
+#define COMMAND_COMPONENT Doc::alias("component")
+#define COMMAND_AUTHOR Doc::alias("author")
+#define COMMAND_PUBLISHER Doc::alias("publisher")
+#define COMMAND_COPYRYEAR Doc::alias("copyryear")
+#define COMMAND_COPYRHOLDER Doc::alias("copyrholder")
+#define COMMAND_PERMISSIONS Doc::alias("permissions")
+#define COMMAND_LIFECYCLEVERSION Doc::alias("lifecycleversion")
+#define COMMAND_LIFECYCLEWSTATUS Doc::alias("lifecyclestatus")
+#define COMMAND_LICENSEYEAR Doc::alias("licenseyear")
+#define COMMAND_LICENSENAME Doc::alias("licensename")
+#define COMMAND_LICENSEDESCRIPTION Doc::alias("licensedescription")
+#define COMMAND_RELEASEDATE Doc::alias("releasedate")
+
QStringList CppCodeParser::exampleFiles;
QStringList CppCodeParser::exampleDirs;
@@ -1811,7 +1827,7 @@ bool CppCodeParser::matchProperty(InnerNode *parent)
!match(Tok_QDOC_PROPERTY)) {
return false;
}
-
+
if (!match(expected_tok))
return false;
@@ -1893,9 +1909,9 @@ bool CppCodeParser::matchProperty(InnerNode *parent)
property->setRuntimeScrFunc(value);
}
}
- else if (key == "CONSTANT")
+ else if (key == "CONSTANT")
property->setConstant();
- else if (key == "FINAL")
+ else if (key == "FINAL")
property->setFinal();
}
match(Tok_RightParen);
diff --git a/tools/qdoc3/declarativeparser/parser.pri b/tools/qdoc3/declarativeparser/parser.pri
new file mode 100644
index 0000000..fd4361c
--- /dev/null
+++ b/tools/qdoc3/declarativeparser/parser.pri
@@ -0,0 +1,21 @@
+INCLUDEPATH += $$PWD
+
+HEADERS += \
+ $$PWD/qdeclarativejsast_p.h \
+ $$PWD/qdeclarativejsastfwd_p.h \
+ $$PWD/qdeclarativejsastvisitor_p.h \
+ $$PWD/qdeclarativejsengine_p.h \
+ $$PWD/qdeclarativejsgrammar_p.h \
+ $$PWD/qdeclarativejslexer_p.h \
+ $$PWD/qdeclarativejsmemorypool_p.h \
+ $$PWD/qdeclarativejsnodepool_p.h \
+ $$PWD/qdeclarativejsparser_p.h \
+ $$PWD/qdeclarativejsglobal_p.h
+
+SOURCES += \
+ $$PWD/qdeclarativejsast.cpp \
+ $$PWD/qdeclarativejsastvisitor.cpp \
+ $$PWD/qdeclarativejsengine_p.cpp \
+ $$PWD/qdeclarativejsgrammar.cpp \
+ $$PWD/qdeclarativejslexer.cpp \
+ $$PWD/qdeclarativejsparser.cpp
diff --git a/tools/qdoc3/declarativeparser/qdeclarativejs.g b/tools/qdoc3/declarativeparser/qdeclarativejs.g
new file mode 100644
index 0000000..0e7454e
--- /dev/null
+++ b/tools/qdoc3/declarativeparser/qdeclarativejs.g
@@ -0,0 +1,3149 @@
+----------------------------------------------------------------------------
+--
+-- Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+-- All rights reserved.
+-- Contact: Nokia Corporation (qt-info@nokia.com)
+--
+-- This file is part of the QtDeclarative module of the Qt Toolkit.
+--
+-- $QT_BEGIN_LICENSE:LGPL-ONLY$
+-- GNU Lesser General Public License Usage
+-- This file may be used under the terms of the GNU Lesser
+-- General Public License version 2.1 as published by the Free Software
+-- Foundation and appearing in the file LICENSE.LGPL included in the
+-- packaging of this file. Please review the following information to
+-- ensure the GNU Lesser General Public License version 2.1 requirements
+-- will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+--
+-- If you have questions regarding the use of this file, please contact
+-- Nokia at qt-info@nokia.com.
+-- $QT_END_LICENSE$
+--
+----------------------------------------------------------------------------
+
+%parser QDeclarativeJSGrammar
+%decl qdeclarativejsparser_p.h
+%impl qdeclarativejsparser.cpp
+%expect 2
+%expect-rr 2
+
+%token T_AND "&" T_AND_AND "&&" T_AND_EQ "&="
+%token T_BREAK "break" T_CASE "case" T_CATCH "catch"
+%token T_COLON ":" T_COMMA ";" T_CONTINUE "continue"
+%token T_DEFAULT "default" T_DELETE "delete" T_DIVIDE_ "/"
+%token T_DIVIDE_EQ "/=" T_DO "do" T_DOT "."
+%token T_ELSE "else" T_EQ "=" T_EQ_EQ "=="
+%token T_EQ_EQ_EQ "===" T_FINALLY "finally" T_FOR "for"
+%token T_FUNCTION "function" T_GE ">=" T_GT ">"
+%token T_GT_GT ">>" T_GT_GT_EQ ">>=" T_GT_GT_GT ">>>"
+%token T_GT_GT_GT_EQ ">>>=" T_IDENTIFIER "identifier" T_IF "if"
+%token T_IN "in" T_INSTANCEOF "instanceof" T_LBRACE "{"
+%token T_LBRACKET "[" T_LE "<=" T_LPAREN "("
+%token T_LT "<" T_LT_LT "<<" T_LT_LT_EQ "<<="
+%token T_MINUS "-" T_MINUS_EQ "-=" T_MINUS_MINUS "--"
+%token T_NEW "new" T_NOT "!" T_NOT_EQ "!="
+%token T_NOT_EQ_EQ "!==" T_NUMERIC_LITERAL "numeric literal" T_OR "|"
+%token T_OR_EQ "|=" T_OR_OR "||" T_PLUS "+"
+%token T_PLUS_EQ "+=" T_PLUS_PLUS "++" T_QUESTION "?"
+%token T_RBRACE "}" T_RBRACKET "]" T_REMAINDER "%"
+%token T_REMAINDER_EQ "%=" T_RETURN "return" T_RPAREN ")"
+%token T_SEMICOLON ";" T_AUTOMATIC_SEMICOLON T_STAR "*"
+%token T_STAR_EQ "*=" T_STRING_LITERAL "string literal"
+%token T_PROPERTY "property" T_SIGNAL "signal" T_READONLY "readonly"
+%token T_SWITCH "switch" T_THIS "this" T_THROW "throw"
+%token T_TILDE "~" T_TRY "try" T_TYPEOF "typeof"
+%token T_VAR "var" T_VOID "void" T_WHILE "while"
+%token T_WITH "with" T_XOR "^" T_XOR_EQ "^="
+%token T_NULL "null" T_TRUE "true" T_FALSE "false"
+%token T_CONST "const"
+%token T_DEBUGGER "debugger"
+%token T_RESERVED_WORD "reserved word"
+%token T_MULTILINE_STRING_LITERAL "multiline string literal"
+%token T_COMMENT "comment"
+
+--- context keywords.
+%token T_PUBLIC "public"
+%token T_IMPORT "import"
+%token T_AS "as"
+%token T_ON "on"
+
+--- feed tokens
+%token T_FEED_UI_PROGRAM
+%token T_FEED_UI_OBJECT_MEMBER
+%token T_FEED_JS_STATEMENT
+%token T_FEED_JS_EXPRESSION
+%token T_FEED_JS_SOURCE_ELEMENT
+%token T_FEED_JS_PROGRAM
+
+%nonassoc SHIFT_THERE
+%nonassoc T_IDENTIFIER T_COLON T_SIGNAL T_PROPERTY T_READONLY
+%nonassoc REDUCE_HERE
+
+%start TopLevel
+
+/./****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative 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 <QtCore/QtDebug>
+#include <QtGui/QApplication>
+
+#include <string.h>
+
+#include "private/qdeclarativejsengine_p.h"
+#include "private/qdeclarativejslexer_p.h"
+#include "private/qdeclarativejsast_p.h"
+#include "private/qdeclarativejsnodepool_p.h"
+
+./
+
+/:/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative 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$
+**
+****************************************************************************/
+
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+//
+// This file is automatically generated from qmljs.g.
+// Changes will be lost.
+//
+
+#ifndef QDECLARATIVEJSPARSER_P_H
+#define QDECLARATIVEJSPARSER_P_H
+
+#include "private/qdeclarativejsglobal_p.h"
+#include "private/qdeclarativejsgrammar_p.h"
+#include "private/qdeclarativejsast_p.h"
+#include "private/qdeclarativejsengine_p.h"
+
+#include <QtCore/QList>
+#include <QtCore/QString>
+
+QT_QML_BEGIN_NAMESPACE
+
+namespace QDeclarativeJS {
+
+class Engine;
+class NameId;
+
+class QML_PARSER_EXPORT Parser: protected $table
+{
+public:
+ union Value {
+ int ival;
+ double dval;
+ NameId *sval;
+ AST::ArgumentList *ArgumentList;
+ AST::CaseBlock *CaseBlock;
+ AST::CaseClause *CaseClause;
+ AST::CaseClauses *CaseClauses;
+ AST::Catch *Catch;
+ AST::DefaultClause *DefaultClause;
+ AST::ElementList *ElementList;
+ AST::Elision *Elision;
+ AST::ExpressionNode *Expression;
+ AST::Finally *Finally;
+ AST::FormalParameterList *FormalParameterList;
+ AST::FunctionBody *FunctionBody;
+ AST::FunctionDeclaration *FunctionDeclaration;
+ AST::Node *Node;
+ AST::PropertyName *PropertyName;
+ AST::PropertyNameAndValueList *PropertyNameAndValueList;
+ AST::SourceElement *SourceElement;
+ AST::SourceElements *SourceElements;
+ AST::Statement *Statement;
+ AST::StatementList *StatementList;
+ AST::Block *Block;
+ AST::VariableDeclaration *VariableDeclaration;
+ AST::VariableDeclarationList *VariableDeclarationList;
+
+ AST::UiProgram *UiProgram;
+ AST::UiImportList *UiImportList;
+ AST::UiImport *UiImport;
+ AST::UiParameterList *UiParameterList;
+ AST::UiPublicMember *UiPublicMember;
+ AST::UiObjectDefinition *UiObjectDefinition;
+ AST::UiObjectInitializer *UiObjectInitializer;
+ AST::UiObjectBinding *UiObjectBinding;
+ AST::UiScriptBinding *UiScriptBinding;
+ AST::UiArrayBinding *UiArrayBinding;
+ AST::UiObjectMember *UiObjectMember;
+ AST::UiObjectMemberList *UiObjectMemberList;
+ AST::UiArrayMemberList *UiArrayMemberList;
+ AST::UiQualifiedId *UiQualifiedId;
+ AST::UiSignature *UiSignature;
+ AST::UiFormalList *UiFormalList;
+ AST::UiFormal *UiFormal;
+ };
+
+public:
+ Parser(Engine *engine);
+ ~Parser();
+
+ // parse a UI program
+ bool parse() { return parse(T_FEED_UI_PROGRAM); }
+ bool parseStatement() { return parse(T_FEED_JS_STATEMENT); }
+ bool parseExpression() { return parse(T_FEED_JS_EXPRESSION); }
+ bool parseSourceElement() { return parse(T_FEED_JS_SOURCE_ELEMENT); }
+ bool parseUiObjectMember() { return parse(T_FEED_UI_OBJECT_MEMBER); }
+ bool parseProgram() { return parse(T_FEED_JS_PROGRAM); }
+
+ AST::UiProgram *ast() const
+ { return AST::cast<AST::UiProgram *>(program); }
+
+ AST::Statement *statement() const
+ {
+ if (! program)
+ return 0;
+
+ return program->statementCast();
+ }
+
+ AST::ExpressionNode *expression() const
+ {
+ if (! program)
+ return 0;
+
+ return program->expressionCast();
+ }
+
+ AST::UiObjectMember *uiObjectMember() const
+ {
+ if (! program)
+ return 0;
+
+ return program->uiObjectMemberCast();
+ }
+
+ AST::Node *rootNode() const
+ { return program; }
+
+ QList<DiagnosticMessage> diagnosticMessages() const
+ { return diagnostic_messages; }
+
+ inline DiagnosticMessage diagnosticMessage() const
+ {
+ foreach (const DiagnosticMessage &d, diagnostic_messages) {
+ if (! d.kind == DiagnosticMessage::Warning)
+ return d;
+ }
+
+ return DiagnosticMessage();
+ }
+
+ inline QString errorMessage() const
+ { return diagnosticMessage().message; }
+
+ inline int errorLineNumber() const
+ { return diagnosticMessage().loc.startLine; }
+
+ inline int errorColumnNumber() const
+ { return diagnosticMessage().loc.startColumn; }
+
+protected:
+ bool parse(int startToken);
+
+ void reallocateStack();
+
+ inline Value &sym(int index)
+ { return sym_stack [tos + index - 1]; }
+
+ inline AST::SourceLocation &loc(int index)
+ { return location_stack [tos + index - 1]; }
+
+ AST::UiQualifiedId *reparseAsQualifiedId(AST::ExpressionNode *expr);
+
+protected:
+ Engine *driver;
+ int tos;
+ int stack_size;
+ Value *sym_stack;
+ int *state_stack;
+ AST::SourceLocation *location_stack;
+
+ AST::Node *program;
+
+ // error recovery
+ enum { TOKEN_BUFFER_SIZE = 3 };
+
+ struct SavedToken {
+ int token;
+ double dval;
+ AST::SourceLocation loc;
+ };
+
+ double yylval;
+ AST::SourceLocation yylloc;
+ AST::SourceLocation yyprevlloc;
+
+ SavedToken token_buffer[TOKEN_BUFFER_SIZE];
+ SavedToken *first_token;
+ SavedToken *last_token;
+
+ QList<DiagnosticMessage> diagnostic_messages;
+};
+
+} // end of namespace QDeclarativeJS
+
+
+:/
+
+
+/.
+
+#include "private/qdeclarativejsparser_p.h"
+#include <QVarLengthArray>
+
+//
+// This file is automatically generated from qmljs.g.
+// Changes will be lost.
+//
+
+using namespace QDeclarativeJS;
+
+QT_QML_BEGIN_NAMESPACE
+
+void Parser::reallocateStack()
+{
+ if (! stack_size)
+ stack_size = 128;
+ else
+ stack_size <<= 1;
+
+ sym_stack = reinterpret_cast<Value*> (qRealloc(sym_stack, stack_size * sizeof(Value)));
+ state_stack = reinterpret_cast<int*> (qRealloc(state_stack, stack_size * sizeof(int)));
+ location_stack = reinterpret_cast<AST::SourceLocation*> (qRealloc(location_stack, stack_size * sizeof(AST::SourceLocation)));
+}
+
+inline static bool automatic(Engine *driver, int token)
+{
+ return token == $table::T_RBRACE
+ || token == 0
+ || driver->lexer()->prevTerminator();
+}
+
+
+Parser::Parser(Engine *engine):
+ driver(engine),
+ tos(0),
+ stack_size(0),
+ sym_stack(0),
+ state_stack(0),
+ location_stack(0),
+ first_token(0),
+ last_token(0)
+{
+}
+
+Parser::~Parser()
+{
+ if (stack_size) {
+ qFree(sym_stack);
+ qFree(state_stack);
+ qFree(location_stack);
+ }
+}
+
+static inline AST::SourceLocation location(Lexer *lexer)
+{
+ AST::SourceLocation loc;
+ loc.offset = lexer->tokenOffset();
+ loc.length = lexer->tokenLength();
+ loc.startLine = lexer->startLineNo();
+ loc.startColumn = lexer->startColumnNo();
+ return loc;
+}
+
+AST::UiQualifiedId *Parser::reparseAsQualifiedId(AST::ExpressionNode *expr)
+{
+ QVarLengthArray<NameId *, 4> nameIds;
+ QVarLengthArray<AST::SourceLocation, 4> locations;
+
+ AST::ExpressionNode *it = expr;
+ while (AST::FieldMemberExpression *m = AST::cast<AST::FieldMemberExpression *>(it)) {
+ nameIds.append(m->name);
+ locations.append(m->identifierToken);
+ it = m->base;
+ }
+
+ if (AST::IdentifierExpression *idExpr = AST::cast<AST::IdentifierExpression *>(it)) {
+ AST::UiQualifiedId *q = makeAstNode<AST::UiQualifiedId>(driver->nodePool(), idExpr->name);
+ q->identifierToken = idExpr->identifierToken;
+
+ AST::UiQualifiedId *currentId = q;
+ for (int i = nameIds.size() - 1; i != -1; --i) {
+ currentId = makeAstNode<AST::UiQualifiedId>(driver->nodePool(), currentId, nameIds[i]);
+ currentId->identifierToken = locations[i];
+ }
+
+ return currentId->finish();
+ }
+
+ return 0;
+}
+
+bool Parser::parse(int startToken)
+{
+ Lexer *lexer = driver->lexer();
+ bool hadErrors = false;
+ int yytoken = -1;
+ int action = 0;
+
+ token_buffer[0].token = startToken;
+ first_token = &token_buffer[0];
+ last_token = &token_buffer[1];
+
+ tos = -1;
+ program = 0;
+
+ do {
+ if (++tos == stack_size)
+ reallocateStack();
+
+ state_stack[tos] = action;
+
+ _Lcheck_token:
+ if (yytoken == -1 && -TERMINAL_COUNT != action_index[action]) {
+ yyprevlloc = yylloc;
+
+ if (first_token == last_token) {
+ yytoken = lexer->lex();
+ yylval = lexer->dval();
+ yylloc = location(lexer);
+ } else {
+ yytoken = first_token->token;
+ yylval = first_token->dval;
+ yylloc = first_token->loc;
+ ++first_token;
+ }
+ }
+
+ action = t_action(action, yytoken);
+ if (action > 0) {
+ if (action != ACCEPT_STATE) {
+ yytoken = -1;
+ sym(1).dval = yylval;
+ loc(1) = yylloc;
+ } else {
+ --tos;
+ return ! hadErrors;
+ }
+ } else if (action < 0) {
+ const int r = -action - 1;
+ tos -= rhs[r];
+
+ switch (r) {
+./
+
+--------------------------------------------------------------------------------------------------------
+-- Declarative UI
+--------------------------------------------------------------------------------------------------------
+
+TopLevel: T_FEED_UI_PROGRAM UiProgram ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+./
+
+TopLevel: T_FEED_JS_STATEMENT Statement ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+./
+
+TopLevel: T_FEED_JS_EXPRESSION Expression ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+./
+
+TopLevel: T_FEED_JS_SOURCE_ELEMENT SourceElement ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+./
+
+TopLevel: T_FEED_UI_OBJECT_MEMBER UiObjectMember ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+./
+
+TopLevel: T_FEED_JS_PROGRAM Program ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+./
+
+UiProgram: UiImportListOpt UiRootMember ;
+/.
+case $rule_number: {
+ sym(1).UiProgram = makeAstNode<AST::UiProgram> (driver->nodePool(), sym(1).UiImportList,
+ sym(2).UiObjectMemberList->finish());
+} break;
+./
+
+UiImportListOpt: Empty ;
+UiImportListOpt: UiImportList ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(1).UiImportList->finish();
+} break;
+./
+
+UiImportList: UiImport ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::UiImportList> (driver->nodePool(), sym(1).UiImport);
+} break;
+./
+
+UiImportList: UiImportList UiImport ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::UiImportList> (driver->nodePool(),
+ sym(1).UiImportList, sym(2).UiImport);
+} break;
+./
+
+ImportId: MemberExpression ;
+
+UiImport: UiImportHead T_AUTOMATIC_SEMICOLON ;
+UiImport: UiImportHead T_SEMICOLON ;
+/.
+case $rule_number: {
+ sym(1).UiImport->semicolonToken = loc(2);
+} break;
+./
+
+UiImport: UiImportHead T_NUMERIC_LITERAL T_AUTOMATIC_SEMICOLON ;
+UiImport: UiImportHead T_NUMERIC_LITERAL T_SEMICOLON ;
+/.
+case $rule_number: {
+ sym(1).UiImport->versionToken = loc(2);
+ sym(1).UiImport->semicolonToken = loc(3);
+} break;
+./
+
+UiImport: UiImportHead T_NUMERIC_LITERAL T_AS JsIdentifier T_AUTOMATIC_SEMICOLON ;
+UiImport: UiImportHead T_NUMERIC_LITERAL T_AS JsIdentifier T_SEMICOLON ;
+/.
+case $rule_number: {
+ sym(1).UiImport->versionToken = loc(2);
+ sym(1).UiImport->asToken = loc(3);
+ sym(1).UiImport->importIdToken = loc(4);
+ sym(1).UiImport->importId = sym(4).sval;
+ sym(1).UiImport->semicolonToken = loc(5);
+} break;
+./
+
+UiImport: UiImportHead T_AS JsIdentifier T_AUTOMATIC_SEMICOLON ;
+UiImport: UiImportHead T_AS JsIdentifier T_SEMICOLON ;
+/.
+case $rule_number: {
+ sym(1).UiImport->asToken = loc(2);
+ sym(1).UiImport->importIdToken = loc(3);
+ sym(1).UiImport->importId = sym(3).sval;
+ sym(1).UiImport->semicolonToken = loc(4);
+} break;
+./
+
+
+UiImportHead: T_IMPORT ImportId ;
+/.
+case $rule_number: {
+ AST::UiImport *node = 0;
+
+ if (AST::StringLiteral *importIdLiteral = AST::cast<AST::StringLiteral *>(sym(2).Expression)) {
+ node = makeAstNode<AST::UiImport>(driver->nodePool(), importIdLiteral->value);
+ node->fileNameToken = loc(2);
+ } else if (AST::UiQualifiedId *qualifiedId = reparseAsQualifiedId(sym(2).Expression)) {
+ node = makeAstNode<AST::UiImport>(driver->nodePool(), qualifiedId);
+ node->fileNameToken = loc(2);
+ }
+
+ sym(1).Node = node;
+
+ if (node) {
+ node->importToken = loc(1);
+ } else {
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, loc(1),
+ QLatin1String("Expected a qualified name id or a string literal")));
+
+ return false; // ### remove me
+ }
+} break;
+./
+
+Empty: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+UiRootMember: UiObjectDefinition ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::UiObjectMemberList> (driver->nodePool(), sym(1).UiObjectMember);
+} break;
+./
+
+UiObjectMemberList: UiObjectMember ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::UiObjectMemberList> (driver->nodePool(), sym(1).UiObjectMember);
+} break;
+./
+
+UiObjectMemberList: UiObjectMemberList UiObjectMember ;
+/.
+case $rule_number: {
+ AST::UiObjectMemberList *node = makeAstNode<AST:: UiObjectMemberList> (driver->nodePool(),
+ sym(1).UiObjectMemberList, sym(2).UiObjectMember);
+ sym(1).Node = node;
+} break;
+./
+
+UiArrayMemberList: UiObjectDefinition ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::UiArrayMemberList> (driver->nodePool(), sym(1).UiObjectMember);
+} break;
+./
+
+UiArrayMemberList: UiArrayMemberList T_COMMA UiObjectDefinition ;
+/.
+case $rule_number: {
+ AST::UiArrayMemberList *node = makeAstNode<AST::UiArrayMemberList> (driver->nodePool(),
+ sym(1).UiArrayMemberList, sym(3).UiObjectMember);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectInitializer: T_LBRACE T_RBRACE ;
+/.
+case $rule_number: {
+ AST::UiObjectInitializer *node = makeAstNode<AST::UiObjectInitializer> (driver->nodePool(), (AST::UiObjectMemberList*)0);
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectInitializer: T_LBRACE UiObjectMemberList T_RBRACE ;
+/.
+case $rule_number: {
+ AST::UiObjectInitializer *node = makeAstNode<AST::UiObjectInitializer> (driver->nodePool(), sym(2).UiObjectMemberList->finish());
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectDefinition: UiQualifiedId UiObjectInitializer ;
+/.
+case $rule_number: {
+ AST::UiObjectDefinition *node = makeAstNode<AST::UiObjectDefinition> (driver->nodePool(), sym(1).UiQualifiedId,
+ sym(2).UiObjectInitializer);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: UiObjectDefinition ;
+
+UiObjectMember: UiQualifiedId T_COLON T_LBRACKET UiArrayMemberList T_RBRACKET ;
+/.
+case $rule_number: {
+ AST::UiArrayBinding *node = makeAstNode<AST::UiArrayBinding> (driver->nodePool(),
+ sym(1).UiQualifiedId, sym(4).UiArrayMemberList->finish());
+ node->colonToken = loc(2);
+ node->lbracketToken = loc(3);
+ node->rbracketToken = loc(5);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: UiQualifiedId T_COLON UiQualifiedId UiObjectInitializer ;
+/.
+case $rule_number: {
+ AST::UiObjectBinding *node = makeAstNode<AST::UiObjectBinding> (driver->nodePool(),
+ sym(1).UiQualifiedId, sym(3).UiQualifiedId, sym(4).UiObjectInitializer);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: UiQualifiedId T_ON UiQualifiedId UiObjectInitializer ;
+/.
+case $rule_number: {
+ AST::UiObjectBinding *node = makeAstNode<AST::UiObjectBinding> (driver->nodePool(),
+ sym(3).UiQualifiedId, sym(1).UiQualifiedId, sym(4).UiObjectInitializer);
+ node->colonToken = loc(2);
+ node->hasOnToken = true;
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: UiQualifiedId T_COLON Block ;
+/.case $rule_number:./
+
+UiObjectMember: UiQualifiedId T_COLON EmptyStatement ;
+/.case $rule_number:./
+
+UiObjectMember: UiQualifiedId T_COLON ExpressionStatement ;
+/.case $rule_number:./
+
+UiObjectMember: UiQualifiedId T_COLON IfStatement ; --- ### do we really want if statement in a binding?
+/.case $rule_number:./
+
+/.
+{
+ AST::UiScriptBinding *node = makeAstNode<AST::UiScriptBinding> (driver->nodePool(),
+ sym(1).UiQualifiedId, sym(3).Statement);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+UiPropertyType: T_VAR ;
+/.
+case $rule_number:
+./
+UiPropertyType: T_RESERVED_WORD ;
+/.
+case $rule_number: {
+ sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount());
+ break;
+}
+./
+
+UiPropertyType: T_IDENTIFIER ;
+
+UiParameterListOpt: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+UiParameterListOpt: UiParameterList ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(1).UiParameterList->finish ();
+} break;
+./
+
+UiParameterList: UiPropertyType JsIdentifier ;
+/.
+case $rule_number: {
+ AST::UiParameterList *node = makeAstNode<AST::UiParameterList> (driver->nodePool(), sym(1).sval, sym(2).sval);
+ node->identifierToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+UiParameterList: UiParameterList T_COMMA UiPropertyType JsIdentifier ;
+/.
+case $rule_number: {
+ AST::UiParameterList *node = makeAstNode<AST::UiParameterList> (driver->nodePool(), sym(1).UiParameterList, sym(3).sval, sym(4).sval);
+ node->commaToken = loc(2);
+ node->identifierToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: T_SIGNAL T_IDENTIFIER T_LPAREN UiParameterListOpt T_RPAREN T_AUTOMATIC_SEMICOLON ;
+UiObjectMember: T_SIGNAL T_IDENTIFIER T_LPAREN UiParameterListOpt T_RPAREN T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), (NameId *)0, sym(2).sval);
+ node->type = AST::UiPublicMember::Signal;
+ node->propertyToken = loc(1);
+ node->typeToken = loc(2);
+ node->identifierToken = loc(2);
+ node->parameters = sym(4).UiParameterList;
+ node->semicolonToken = loc(6);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: T_SIGNAL T_IDENTIFIER T_AUTOMATIC_SEMICOLON ;
+UiObjectMember: T_SIGNAL T_IDENTIFIER T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), (NameId *)0, sym(2).sval);
+ node->type = AST::UiPublicMember::Signal;
+ node->propertyToken = loc(1);
+ node->typeToken = loc(2);
+ node->identifierToken = loc(2);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: T_PROPERTY T_IDENTIFIER T_LT UiPropertyType T_GT JsIdentifier T_AUTOMATIC_SEMICOLON ;
+UiObjectMember: T_PROPERTY T_IDENTIFIER T_LT UiPropertyType T_GT JsIdentifier T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(4).sval, sym(6).sval);
+ node->typeModifier = sym(2).sval;
+ node->propertyToken = loc(1);
+ node->typeModifierToken = loc(2);
+ node->typeToken = loc(4);
+ node->identifierToken = loc(6);
+ node->semicolonToken = loc(7);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: T_PROPERTY UiPropertyType JsIdentifier T_AUTOMATIC_SEMICOLON ;
+UiObjectMember: T_PROPERTY UiPropertyType JsIdentifier T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(2).sval, sym(3).sval);
+ node->propertyToken = loc(1);
+ node->typeToken = loc(2);
+ node->identifierToken = loc(3);
+ node->semicolonToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType JsIdentifier T_AUTOMATIC_SEMICOLON ;
+UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType JsIdentifier T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval);
+ node->isDefaultMember = true;
+ node->defaultToken = loc(1);
+ node->propertyToken = loc(2);
+ node->typeToken = loc(3);
+ node->identifierToken = loc(4);
+ node->semicolonToken = loc(5);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: T_PROPERTY UiPropertyType JsIdentifier T_COLON Expression T_AUTOMATIC_SEMICOLON ;
+UiObjectMember: T_PROPERTY UiPropertyType JsIdentifier T_COLON Expression T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(2).sval, sym(3).sval,
+ sym(5).Expression);
+ node->propertyToken = loc(1);
+ node->typeToken = loc(2);
+ node->identifierToken = loc(3);
+ node->colonToken = loc(4);
+ node->semicolonToken = loc(6);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: T_READONLY T_PROPERTY UiPropertyType JsIdentifier T_COLON Expression T_AUTOMATIC_SEMICOLON ;
+UiObjectMember: T_READONLY T_PROPERTY UiPropertyType JsIdentifier T_COLON Expression T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval,
+ sym(6).Expression);
+ node->isReadonlyMember = true;
+ node->readonlyToken = loc(1);
+ node->propertyToken = loc(2);
+ node->typeToken = loc(3);
+ node->identifierToken = loc(4);
+ node->colonToken = loc(5);
+ node->semicolonToken = loc(7);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType JsIdentifier T_COLON Expression T_AUTOMATIC_SEMICOLON ;
+UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType JsIdentifier T_COLON Expression T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval,
+ sym(6).Expression);
+ node->isDefaultMember = true;
+ node->defaultToken = loc(1);
+ node->propertyToken = loc(2);
+ node->typeToken = loc(3);
+ node->identifierToken = loc(4);
+ node->colonToken = loc(5);
+ node->semicolonToken = loc(7);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: T_PROPERTY T_IDENTIFIER T_LT UiPropertyType T_GT JsIdentifier T_COLON T_LBRACKET UiArrayMemberList T_RBRACKET ;
+/.
+case $rule_number: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(4).sval, sym(6).sval);
+ node->typeModifier = sym(2).sval;
+ node->propertyToken = loc(1);
+ node->typeModifierToken = loc(2);
+ node->typeToken = loc(4);
+ node->identifierToken = loc(6);
+ node->semicolonToken = loc(7); // insert a fake ';' before ':'
+
+ AST::UiQualifiedId *propertyName = makeAstNode<AST::UiQualifiedId>(driver->nodePool(), sym(6).sval);
+ propertyName->identifierToken = loc(6);
+ propertyName->next = 0;
+
+ AST::UiArrayBinding *binding = makeAstNode<AST::UiArrayBinding> (driver->nodePool(),
+ propertyName, sym(9).UiArrayMemberList->finish());
+ binding->colonToken = loc(7);
+ binding->lbracketToken = loc(8);
+ binding->rbracketToken = loc(10);
+
+ node->binding = binding;
+
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: T_PROPERTY UiPropertyType JsIdentifier T_COLON UiQualifiedId UiObjectInitializer ;
+/.
+case $rule_number: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(2).sval, sym(3).sval);
+ node->propertyToken = loc(1);
+ node->typeToken = loc(2);
+ node->identifierToken = loc(3);
+ node->semicolonToken = loc(4); // insert a fake ';' before ':'
+
+ AST::UiQualifiedId *propertyName = makeAstNode<AST::UiQualifiedId>(driver->nodePool(), sym(3).sval);
+ propertyName->identifierToken = loc(3);
+ propertyName->next = 0;
+
+ AST::UiObjectBinding *binding = makeAstNode<AST::UiObjectBinding> (driver->nodePool(),
+ propertyName, sym(5).UiQualifiedId, sym(6).UiObjectInitializer);
+ binding->colonToken = loc(4);
+
+ node->binding = binding;
+
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: FunctionDeclaration ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::UiSourceElement>(driver->nodePool(), sym(1).Node);
+} break;
+./
+
+UiObjectMember: VariableStatement ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::UiSourceElement>(driver->nodePool(), sym(1).Node);
+} break;
+./
+
+JsIdentifier: T_IDENTIFIER;
+
+JsIdentifier: T_PROPERTY ;
+/.
+case $rule_number: {
+ QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_PROPERTY]);
+ sym(1).sval = driver->intern(s.constData(), s.length());
+ break;
+}
+./
+
+JsIdentifier: T_SIGNAL ;
+/.
+case $rule_number: {
+ QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_SIGNAL]);
+ sym(1).sval = driver->intern(s.constData(), s.length());
+ break;
+}
+./
+
+JsIdentifier: T_READONLY ;
+/.
+case $rule_number: {
+ QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_READONLY]);
+ sym(1).sval = driver->intern(s.constData(), s.length());
+ break;
+}
+./
+
+JsIdentifier: T_ON ;
+/.
+case $rule_number: {
+ QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_ON]);
+ sym(1).sval = driver->intern(s.constData(), s.length());
+ break;
+}
+./
+
+--------------------------------------------------------------------------------------------------------
+-- Expressions
+--------------------------------------------------------------------------------------------------------
+
+PrimaryExpression: T_THIS ;
+/.
+case $rule_number: {
+ AST::ThisExpression *node = makeAstNode<AST::ThisExpression> (driver->nodePool());
+ node->thisToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: JsIdentifier ;
+/.
+case $rule_number: {
+ AST::IdentifierExpression *node = makeAstNode<AST::IdentifierExpression> (driver->nodePool(), sym(1).sval);
+ node->identifierToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_NULL ;
+/.
+case $rule_number: {
+ AST::NullExpression *node = makeAstNode<AST::NullExpression> (driver->nodePool());
+ node->nullToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_TRUE ;
+/.
+case $rule_number: {
+ AST::TrueLiteral *node = makeAstNode<AST::TrueLiteral> (driver->nodePool());
+ node->trueToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_FALSE ;
+/.
+case $rule_number: {
+ AST::FalseLiteral *node = makeAstNode<AST::FalseLiteral> (driver->nodePool());
+ node->falseToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_NUMERIC_LITERAL ;
+/.
+case $rule_number: {
+ AST::NumericLiteral *node = makeAstNode<AST::NumericLiteral> (driver->nodePool(), sym(1).dval);
+ node->literalToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_MULTILINE_STRING_LITERAL ;
+/.case $rule_number:./
+
+PrimaryExpression: T_STRING_LITERAL ;
+/.
+case $rule_number: {
+ AST::StringLiteral *node = makeAstNode<AST::StringLiteral> (driver->nodePool(), sym(1).sval);
+ node->literalToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_DIVIDE_ ;
+/:
+#define J_SCRIPT_REGEXPLITERAL_RULE1 $rule_number
+:/
+/.
+case $rule_number: {
+ bool rx = lexer->scanRegExp(Lexer::NoPrefix);
+ if (!rx) {
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage()));
+ return false; // ### remove me
+ }
+
+ loc(1).length = lexer->tokenLength();
+
+ AST::RegExpLiteral *node = makeAstNode<AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
+ node->literalToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_DIVIDE_EQ ;
+/:
+#define J_SCRIPT_REGEXPLITERAL_RULE2 $rule_number
+:/
+/.
+case $rule_number: {
+ bool rx = lexer->scanRegExp(Lexer::EqualPrefix);
+ if (!rx) {
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage()));
+ return false;
+ }
+
+ loc(1).length = lexer->tokenLength();
+
+ AST::RegExpLiteral *node = makeAstNode<AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
+ node->literalToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_LBRACKET T_RBRACKET ;
+/.
+case $rule_number: {
+ AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), (AST::Elision *) 0);
+ node->lbracketToken = loc(1);
+ node->rbracketToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_LBRACKET Elision T_RBRACKET ;
+/.
+case $rule_number: {
+ AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).Elision->finish());
+ node->lbracketToken = loc(1);
+ node->rbracketToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_LBRACKET ElementList T_RBRACKET ;
+/.
+case $rule_number: {
+ AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish ());
+ node->lbracketToken = loc(1);
+ node->rbracketToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_LBRACKET ElementList T_COMMA T_RBRACKET ;
+/.
+case $rule_number: {
+ AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish (),
+ (AST::Elision *) 0);
+ node->lbracketToken = loc(1);
+ node->commaToken = loc(3);
+ node->rbracketToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_LBRACKET ElementList T_COMMA Elision T_RBRACKET ;
+/.
+case $rule_number: {
+ AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish (),
+ sym(4).Elision->finish());
+ node->lbracketToken = loc(1);
+ node->commaToken = loc(3);
+ node->rbracketToken = loc(5);
+ sym(1).Node = node;
+} break;
+./
+
+-- PrimaryExpression: T_LBRACE T_RBRACE ;
+-- /.
+-- case $rule_number: {
+-- sym(1).Node = makeAstNode<AST::ObjectLiteral> (driver->nodePool());
+-- } break;
+-- ./
+
+PrimaryExpression: T_LBRACE PropertyNameAndValueListOpt T_RBRACE ;
+/.
+case $rule_number: {
+ AST::ObjectLiteral *node = 0;
+ if (sym(2).Node)
+ node = makeAstNode<AST::ObjectLiteral> (driver->nodePool(),
+ sym(2).PropertyNameAndValueList->finish ());
+ else
+ node = makeAstNode<AST::ObjectLiteral> (driver->nodePool());
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_LBRACE PropertyNameAndValueList T_COMMA T_RBRACE ;
+/.
+case $rule_number: {
+ AST::ObjectLiteral *node = makeAstNode<AST::ObjectLiteral> (driver->nodePool(),
+ sym(2).PropertyNameAndValueList->finish ());
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_LPAREN Expression T_RPAREN ;
+/.
+case $rule_number: {
+ AST::NestedExpression *node = makeAstNode<AST::NestedExpression>(driver->nodePool(), sym(2).Expression);
+ node->lparenToken = loc(1);
+ node->rparenToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+UiQualifiedId: MemberExpression ;
+/.
+case $rule_number: {
+ if (AST::ArrayMemberExpression *mem = AST::cast<AST::ArrayMemberExpression *>(sym(1).Expression)) {
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, mem->lbracketToken,
+ QLatin1String("Ignored annotation")));
+
+ sym(1).Expression = mem->base;
+ }
+
+ if (AST::UiQualifiedId *qualifiedId = reparseAsQualifiedId(sym(1).Expression)) {
+ sym(1).UiQualifiedId = qualifiedId;
+ } else {
+ sym(1).UiQualifiedId = 0;
+
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, loc(1),
+ QLatin1String("Expected a qualified name id")));
+
+ return false; // ### recover
+ }
+} break;
+./
+
+ElementList: AssignmentExpression ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::ElementList> (driver->nodePool(), (AST::Elision *) 0, sym(1).Expression);
+} break;
+./
+
+ElementList: Elision AssignmentExpression ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).Elision->finish(), sym(2).Expression);
+} break;
+./
+
+ElementList: ElementList T_COMMA AssignmentExpression ;
+/.
+case $rule_number: {
+ AST::ElementList *node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).ElementList,
+ (AST::Elision *) 0, sym(3).Expression);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+ElementList: ElementList T_COMMA Elision AssignmentExpression ;
+/.
+case $rule_number: {
+ AST::ElementList *node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).ElementList, sym(3).Elision->finish(),
+ sym(4).Expression);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+Elision: T_COMMA ;
+/.
+case $rule_number: {
+ AST::Elision *node = makeAstNode<AST::Elision> (driver->nodePool());
+ node->commaToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+Elision: Elision T_COMMA ;
+/.
+case $rule_number: {
+ AST::Elision *node = makeAstNode<AST::Elision> (driver->nodePool(), sym(1).Elision);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+PropertyNameAndValueList: PropertyName T_COLON AssignmentExpression ;
+/.
+case $rule_number: {
+ AST::PropertyNameAndValueList *node = makeAstNode<AST::PropertyNameAndValueList> (driver->nodePool(),
+ sym(1).PropertyName, sym(3).Expression);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+PropertyNameAndValueList: PropertyNameAndValueList T_COMMA PropertyName T_COLON AssignmentExpression ;
+/.
+case $rule_number: {
+ AST::PropertyNameAndValueList *node = makeAstNode<AST::PropertyNameAndValueList> (driver->nodePool(),
+ sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression);
+ node->commaToken = loc(2);
+ node->colonToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+PropertyName: T_IDENTIFIER %prec SHIFT_THERE ;
+/.
+case $rule_number: {
+ AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
+ node->propertyNameToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PropertyName: T_SIGNAL ;
+/.case $rule_number:./
+
+PropertyName: T_PROPERTY ;
+/.
+case $rule_number: {
+ AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount()));
+ node->propertyNameToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PropertyName: T_STRING_LITERAL ;
+/.
+case $rule_number: {
+ AST::StringLiteralPropertyName *node = makeAstNode<AST::StringLiteralPropertyName> (driver->nodePool(), sym(1).sval);
+ node->propertyNameToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PropertyName: T_NUMERIC_LITERAL ;
+/.
+case $rule_number: {
+ AST::NumericLiteralPropertyName *node = makeAstNode<AST::NumericLiteralPropertyName> (driver->nodePool(), sym(1).dval);
+ node->propertyNameToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PropertyName: ReservedIdentifier ;
+/.
+case $rule_number: {
+ AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
+ node->propertyNameToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+ReservedIdentifier: T_BREAK ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_CASE ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_CATCH ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_CONTINUE ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_DEFAULT ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_DELETE ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_DO ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_ELSE ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_FALSE ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_FINALLY ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_FOR ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_FUNCTION ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_IF ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_IN ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_INSTANCEOF ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_NEW ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_NULL ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_RETURN ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_SWITCH ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_THIS ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_THROW ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_TRUE ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_TRY ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_TYPEOF ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_VAR ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_VOID ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_WHILE ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_CONST ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_DEBUGGER ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_RESERVED_WORD ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_WITH ;
+/.
+case $rule_number:
+{
+ sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount());
+} break;
+./
+
+PropertyIdentifier: JsIdentifier ;
+PropertyIdentifier: ReservedIdentifier ;
+
+MemberExpression: PrimaryExpression ;
+MemberExpression: FunctionExpression ;
+
+MemberExpression: MemberExpression T_LBRACKET Expression T_RBRACKET ;
+/.
+case $rule_number: {
+ AST::ArrayMemberExpression *node = makeAstNode<AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+ node->lbracketToken = loc(2);
+ node->rbracketToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+MemberExpression: MemberExpression T_DOT PropertyIdentifier ;
+/.
+case $rule_number: {
+ AST::FieldMemberExpression *node = makeAstNode<AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval);
+ node->dotToken = loc(2);
+ node->identifierToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+MemberExpression: T_NEW MemberExpression T_LPAREN ArgumentListOpt T_RPAREN ;
+/.
+case $rule_number: {
+ AST::NewMemberExpression *node = makeAstNode<AST::NewMemberExpression> (driver->nodePool(), sym(2).Expression, sym(4).ArgumentList);
+ node->newToken = loc(1);
+ node->lparenToken = loc(3);
+ node->rparenToken = loc(5);
+ sym(1).Node = node;
+} break;
+./
+
+NewExpression: MemberExpression ;
+
+NewExpression: T_NEW NewExpression ;
+/.
+case $rule_number: {
+ AST::NewExpression *node = makeAstNode<AST::NewExpression> (driver->nodePool(), sym(2).Expression);
+ node->newToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+CallExpression: MemberExpression T_LPAREN ArgumentListOpt T_RPAREN ;
+/.
+case $rule_number: {
+ AST::CallExpression *node = makeAstNode<AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+CallExpression: CallExpression T_LPAREN ArgumentListOpt T_RPAREN ;
+/.
+case $rule_number: {
+ AST::CallExpression *node = makeAstNode<AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+CallExpression: CallExpression T_LBRACKET Expression T_RBRACKET ;
+/.
+case $rule_number: {
+ AST::ArrayMemberExpression *node = makeAstNode<AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+ node->lbracketToken = loc(2);
+ node->rbracketToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+CallExpression: CallExpression T_DOT PropertyIdentifier ;
+/.
+case $rule_number: {
+ AST::FieldMemberExpression *node = makeAstNode<AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval);
+ node->dotToken = loc(2);
+ node->identifierToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+ArgumentListOpt: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+ArgumentListOpt: ArgumentList ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(1).ArgumentList->finish();
+} break;
+./
+
+ArgumentList: AssignmentExpression ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::ArgumentList> (driver->nodePool(), sym(1).Expression);
+} break;
+./
+
+ArgumentList: ArgumentList T_COMMA AssignmentExpression ;
+/.
+case $rule_number: {
+ AST::ArgumentList *node = makeAstNode<AST::ArgumentList> (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+LeftHandSideExpression: NewExpression ;
+LeftHandSideExpression: CallExpression ;
+PostfixExpression: LeftHandSideExpression ;
+
+PostfixExpression: LeftHandSideExpression T_PLUS_PLUS ;
+/.
+case $rule_number: {
+ AST::PostIncrementExpression *node = makeAstNode<AST::PostIncrementExpression> (driver->nodePool(), sym(1).Expression);
+ node->incrementToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+PostfixExpression: LeftHandSideExpression T_MINUS_MINUS ;
+/.
+case $rule_number: {
+ AST::PostDecrementExpression *node = makeAstNode<AST::PostDecrementExpression> (driver->nodePool(), sym(1).Expression);
+ node->decrementToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+UnaryExpression: PostfixExpression ;
+
+UnaryExpression: T_DELETE UnaryExpression ;
+/.
+case $rule_number: {
+ AST::DeleteExpression *node = makeAstNode<AST::DeleteExpression> (driver->nodePool(), sym(2).Expression);
+ node->deleteToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+UnaryExpression: T_VOID UnaryExpression ;
+/.
+case $rule_number: {
+ AST::VoidExpression *node = makeAstNode<AST::VoidExpression> (driver->nodePool(), sym(2).Expression);
+ node->voidToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+UnaryExpression: T_TYPEOF UnaryExpression ;
+/.
+case $rule_number: {
+ AST::TypeOfExpression *node = makeAstNode<AST::TypeOfExpression> (driver->nodePool(), sym(2).Expression);
+ node->typeofToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+UnaryExpression: T_PLUS_PLUS UnaryExpression ;
+/.
+case $rule_number: {
+ AST::PreIncrementExpression *node = makeAstNode<AST::PreIncrementExpression> (driver->nodePool(), sym(2).Expression);
+ node->incrementToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+UnaryExpression: T_MINUS_MINUS UnaryExpression ;
+/.
+case $rule_number: {
+ AST::PreDecrementExpression *node = makeAstNode<AST::PreDecrementExpression> (driver->nodePool(), sym(2).Expression);
+ node->decrementToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+UnaryExpression: T_PLUS UnaryExpression ;
+/.
+case $rule_number: {
+ AST::UnaryPlusExpression *node = makeAstNode<AST::UnaryPlusExpression> (driver->nodePool(), sym(2).Expression);
+ node->plusToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+UnaryExpression: T_MINUS UnaryExpression ;
+/.
+case $rule_number: {
+ AST::UnaryMinusExpression *node = makeAstNode<AST::UnaryMinusExpression> (driver->nodePool(), sym(2).Expression);
+ node->minusToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+UnaryExpression: T_TILDE UnaryExpression ;
+/.
+case $rule_number: {
+ AST::TildeExpression *node = makeAstNode<AST::TildeExpression> (driver->nodePool(), sym(2).Expression);
+ node->tildeToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+UnaryExpression: T_NOT UnaryExpression ;
+/.
+case $rule_number: {
+ AST::NotExpression *node = makeAstNode<AST::NotExpression> (driver->nodePool(), sym(2).Expression);
+ node->notToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+MultiplicativeExpression: UnaryExpression ;
+
+MultiplicativeExpression: MultiplicativeExpression T_STAR UnaryExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Mul, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+MultiplicativeExpression: MultiplicativeExpression T_DIVIDE_ UnaryExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Div, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+MultiplicativeExpression: MultiplicativeExpression T_REMAINDER UnaryExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Mod, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+AdditiveExpression: MultiplicativeExpression ;
+
+AdditiveExpression: AdditiveExpression T_PLUS MultiplicativeExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Add, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+AdditiveExpression: AdditiveExpression T_MINUS MultiplicativeExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Sub, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+ShiftExpression: AdditiveExpression ;
+
+ShiftExpression: ShiftExpression T_LT_LT AdditiveExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::LShift, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+ShiftExpression: ShiftExpression T_GT_GT AdditiveExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::RShift, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+ShiftExpression: ShiftExpression T_GT_GT_GT AdditiveExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::URShift, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+RelationalExpression: ShiftExpression ;
+
+RelationalExpression: RelationalExpression T_LT ShiftExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Lt, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+RelationalExpression: RelationalExpression T_GT ShiftExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Gt, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+RelationalExpression: RelationalExpression T_LE ShiftExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Le, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+RelationalExpression: RelationalExpression T_GE ShiftExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Ge, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+RelationalExpression: RelationalExpression T_INSTANCEOF ShiftExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::InstanceOf, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+RelationalExpression: RelationalExpression T_IN ShiftExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::In, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+RelationalExpressionNotIn: ShiftExpression ;
+
+RelationalExpressionNotIn: RelationalExpressionNotIn T_LT ShiftExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Lt, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+RelationalExpressionNotIn: RelationalExpressionNotIn T_GT ShiftExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Gt, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+RelationalExpressionNotIn: RelationalExpressionNotIn T_LE ShiftExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Le, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+RelationalExpressionNotIn: RelationalExpressionNotIn T_GE ShiftExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Ge, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+RelationalExpressionNotIn: RelationalExpressionNotIn T_INSTANCEOF ShiftExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::InstanceOf, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+EqualityExpression: RelationalExpression ;
+
+EqualityExpression: EqualityExpression T_EQ_EQ RelationalExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Equal, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+EqualityExpression: EqualityExpression T_NOT_EQ RelationalExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::NotEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+EqualityExpression: EqualityExpression T_EQ_EQ_EQ RelationalExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::StrictEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+EqualityExpression: EqualityExpression T_NOT_EQ_EQ RelationalExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::StrictNotEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+EqualityExpressionNotIn: RelationalExpressionNotIn ;
+
+EqualityExpressionNotIn: EqualityExpressionNotIn T_EQ_EQ RelationalExpressionNotIn ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Equal, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+EqualityExpressionNotIn: EqualityExpressionNotIn T_NOT_EQ RelationalExpressionNotIn;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::NotEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+EqualityExpressionNotIn: EqualityExpressionNotIn T_EQ_EQ_EQ RelationalExpressionNotIn ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::StrictEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+EqualityExpressionNotIn: EqualityExpressionNotIn T_NOT_EQ_EQ RelationalExpressionNotIn ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::StrictNotEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+BitwiseANDExpression: EqualityExpression ;
+
+BitwiseANDExpression: BitwiseANDExpression T_AND EqualityExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitAnd, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+BitwiseANDExpressionNotIn: EqualityExpressionNotIn ;
+
+BitwiseANDExpressionNotIn: BitwiseANDExpressionNotIn T_AND EqualityExpressionNotIn ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitAnd, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+BitwiseXORExpression: BitwiseANDExpression ;
+
+BitwiseXORExpression: BitwiseXORExpression T_XOR BitwiseANDExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitXor, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+BitwiseXORExpressionNotIn: BitwiseANDExpressionNotIn ;
+
+BitwiseXORExpressionNotIn: BitwiseXORExpressionNotIn T_XOR BitwiseANDExpressionNotIn ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitXor, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+BitwiseORExpression: BitwiseXORExpression ;
+
+BitwiseORExpression: BitwiseORExpression T_OR BitwiseXORExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitOr, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+BitwiseORExpressionNotIn: BitwiseXORExpressionNotIn ;
+
+BitwiseORExpressionNotIn: BitwiseORExpressionNotIn T_OR BitwiseXORExpressionNotIn ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitOr, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+LogicalANDExpression: BitwiseORExpression ;
+
+LogicalANDExpression: LogicalANDExpression T_AND_AND BitwiseORExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::And, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+LogicalANDExpressionNotIn: BitwiseORExpressionNotIn ;
+
+LogicalANDExpressionNotIn: LogicalANDExpressionNotIn T_AND_AND BitwiseORExpressionNotIn ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::And, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+LogicalORExpression: LogicalANDExpression ;
+
+LogicalORExpression: LogicalORExpression T_OR_OR LogicalANDExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Or, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+LogicalORExpressionNotIn: LogicalANDExpressionNotIn ;
+
+LogicalORExpressionNotIn: LogicalORExpressionNotIn T_OR_OR LogicalANDExpressionNotIn ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Or, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+ConditionalExpression: LogicalORExpression ;
+
+ConditionalExpression: LogicalORExpression T_QUESTION AssignmentExpression T_COLON AssignmentExpression ;
+/.
+case $rule_number: {
+ AST::ConditionalExpression *node = makeAstNode<AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression,
+ sym(3).Expression, sym(5).Expression);
+ node->questionToken = loc(2);
+ node->colonToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+ConditionalExpressionNotIn: LogicalORExpressionNotIn ;
+
+ConditionalExpressionNotIn: LogicalORExpressionNotIn T_QUESTION AssignmentExpressionNotIn T_COLON AssignmentExpressionNotIn ;
+/.
+case $rule_number: {
+ AST::ConditionalExpression *node = makeAstNode<AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression,
+ sym(3).Expression, sym(5).Expression);
+ node->questionToken = loc(2);
+ node->colonToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+AssignmentExpression: ConditionalExpression ;
+
+AssignmentExpression: LeftHandSideExpression AssignmentOperator AssignmentExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ sym(2).ival, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+AssignmentExpressionNotIn: ConditionalExpressionNotIn ;
+
+AssignmentExpressionNotIn: LeftHandSideExpression AssignmentOperator AssignmentExpressionNotIn ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ sym(2).ival, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+AssignmentOperator: T_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::Assign;
+} break;
+./
+
+AssignmentOperator: T_STAR_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::InplaceMul;
+} break;
+./
+
+AssignmentOperator: T_DIVIDE_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::InplaceDiv;
+} break;
+./
+
+AssignmentOperator: T_REMAINDER_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::InplaceMod;
+} break;
+./
+
+AssignmentOperator: T_PLUS_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::InplaceAdd;
+} break;
+./
+
+AssignmentOperator: T_MINUS_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::InplaceSub;
+} break;
+./
+
+AssignmentOperator: T_LT_LT_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::InplaceLeftShift;
+} break;
+./
+
+AssignmentOperator: T_GT_GT_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::InplaceRightShift;
+} break;
+./
+
+AssignmentOperator: T_GT_GT_GT_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::InplaceURightShift;
+} break;
+./
+
+AssignmentOperator: T_AND_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::InplaceAnd;
+} break;
+./
+
+AssignmentOperator: T_XOR_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::InplaceXor;
+} break;
+./
+
+AssignmentOperator: T_OR_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::InplaceOr;
+} break;
+./
+
+Expression: AssignmentExpression ;
+
+Expression: Expression T_COMMA AssignmentExpression ;
+/.
+case $rule_number: {
+ AST::Expression *node = makeAstNode<AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+ExpressionOpt: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+ExpressionOpt: Expression ;
+
+ExpressionNotIn: AssignmentExpressionNotIn ;
+
+ExpressionNotIn: ExpressionNotIn T_COMMA AssignmentExpressionNotIn ;
+/.
+case $rule_number: {
+ AST::Expression *node = makeAstNode<AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+ExpressionNotInOpt: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+ExpressionNotInOpt: ExpressionNotIn ;
+
+Statement: Block ;
+Statement: VariableStatement ;
+Statement: EmptyStatement ;
+Statement: ExpressionStatement ;
+Statement: IfStatement ;
+Statement: IterationStatement ;
+Statement: ContinueStatement ;
+Statement: BreakStatement ;
+Statement: ReturnStatement ;
+Statement: WithStatement ;
+Statement: LabelledStatement ;
+Statement: SwitchStatement ;
+Statement: ThrowStatement ;
+Statement: TryStatement ;
+Statement: DebuggerStatement ;
+
+
+Block: T_LBRACE StatementListOpt T_RBRACE ;
+/.
+case $rule_number: {
+ AST::Block *node = makeAstNode<AST::Block> (driver->nodePool(), sym(2).StatementList);
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+StatementList: Statement ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::StatementList> (driver->nodePool(), sym(1).Statement);
+} break;
+./
+
+StatementList: StatementList Statement ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::StatementList> (driver->nodePool(), sym(1).StatementList, sym(2).Statement);
+} break;
+./
+
+StatementListOpt: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+StatementListOpt: StatementList ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(1).StatementList->finish ();
+} break;
+./
+
+VariableStatement: VariableDeclarationKind VariableDeclarationList T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
+VariableStatement: VariableDeclarationKind VariableDeclarationList T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::VariableStatement *node = makeAstNode<AST::VariableStatement> (driver->nodePool(),
+ sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST));
+ node->declarationKindToken = loc(1);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+VariableDeclarationKind: T_CONST ;
+/.
+case $rule_number: {
+ sym(1).ival = T_CONST;
+} break;
+./
+
+VariableDeclarationKind: T_VAR ;
+/.
+case $rule_number: {
+ sym(1).ival = T_VAR;
+} break;
+./
+
+VariableDeclarationList: VariableDeclaration ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration);
+} break;
+./
+
+VariableDeclarationList: VariableDeclarationList T_COMMA VariableDeclaration ;
+/.
+case $rule_number: {
+ AST::VariableDeclarationList *node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(),
+ sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+VariableDeclarationListNotIn: VariableDeclarationNotIn ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration);
+} break;
+./
+
+VariableDeclarationListNotIn: VariableDeclarationListNotIn T_COMMA VariableDeclarationNotIn ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
+} break;
+./
+
+VariableDeclaration: JsIdentifier InitialiserOpt ;
+/.
+case $rule_number: {
+ AST::VariableDeclaration *node = makeAstNode<AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression);
+ node->identifierToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+VariableDeclarationNotIn: JsIdentifier InitialiserNotInOpt ;
+/.
+case $rule_number: {
+ AST::VariableDeclaration *node = makeAstNode<AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression);
+ node->identifierToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+Initialiser: T_EQ AssignmentExpression ;
+/.
+case $rule_number: {
+ // ### TODO: AST for initializer
+ sym(1) = sym(2);
+} break;
+./
+
+InitialiserOpt: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+InitialiserOpt: Initialiser ;
+
+InitialiserNotIn: T_EQ AssignmentExpressionNotIn ;
+/.
+case $rule_number: {
+ // ### TODO: AST for initializer
+ sym(1) = sym(2);
+} break;
+./
+
+InitialiserNotInOpt: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+InitialiserNotInOpt: InitialiserNotIn ;
+
+EmptyStatement: T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::EmptyStatement *node = makeAstNode<AST::EmptyStatement> (driver->nodePool());
+ node->semicolonToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+ExpressionStatement: Expression T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
+ExpressionStatement: Expression T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::ExpressionStatement *node = makeAstNode<AST::ExpressionStatement> (driver->nodePool(), sym(1).Expression);
+ node->semicolonToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+IfStatement: T_IF T_LPAREN Expression T_RPAREN Statement T_ELSE Statement ;
+/.
+case $rule_number: {
+ AST::IfStatement *node = makeAstNode<AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement);
+ node->ifToken = loc(1);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ node->elseToken = loc(5);
+ sym(1).Node = node;
+} break;
+./
+
+IfStatement: T_IF T_LPAREN Expression T_RPAREN Statement ;
+/.
+case $rule_number: {
+ AST::IfStatement *node = makeAstNode<AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
+ node->ifToken = loc(1);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+
+IterationStatement: T_DO Statement T_WHILE T_LPAREN Expression T_RPAREN T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
+IterationStatement: T_DO Statement T_WHILE T_LPAREN Expression T_RPAREN T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::DoWhileStatement *node = makeAstNode<AST::DoWhileStatement> (driver->nodePool(), sym(2).Statement, sym(5).Expression);
+ node->doToken = loc(1);
+ node->whileToken = loc(3);
+ node->lparenToken = loc(4);
+ node->rparenToken = loc(6);
+ node->semicolonToken = loc(7);
+ sym(1).Node = node;
+} break;
+./
+
+IterationStatement: T_WHILE T_LPAREN Expression T_RPAREN Statement ;
+/.
+case $rule_number: {
+ AST::WhileStatement *node = makeAstNode<AST::WhileStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
+ node->whileToken = loc(1);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+IterationStatement: T_FOR T_LPAREN ExpressionNotInOpt T_SEMICOLON ExpressionOpt T_SEMICOLON ExpressionOpt T_RPAREN Statement ;
+/.
+case $rule_number: {
+ AST::ForStatement *node = makeAstNode<AST::ForStatement> (driver->nodePool(), sym(3).Expression,
+ sym(5).Expression, sym(7).Expression, sym(9).Statement);
+ node->forToken = loc(1);
+ node->lparenToken = loc(2);
+ node->firstSemicolonToken = loc(4);
+ node->secondSemicolonToken = loc(6);
+ node->rparenToken = loc(8);
+ sym(1).Node = node;
+} break;
+./
+
+IterationStatement: T_FOR T_LPAREN T_VAR VariableDeclarationListNotIn T_SEMICOLON ExpressionOpt T_SEMICOLON ExpressionOpt T_RPAREN Statement ;
+/.
+case $rule_number: {
+ AST::LocalForStatement *node = makeAstNode<AST::LocalForStatement> (driver->nodePool(),
+ sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression,
+ sym(8).Expression, sym(10).Statement);
+ node->forToken = loc(1);
+ node->lparenToken = loc(2);
+ node->varToken = loc(3);
+ node->firstSemicolonToken = loc(5);
+ node->secondSemicolonToken = loc(7);
+ node->rparenToken = loc(9);
+ sym(1).Node = node;
+} break;
+./
+
+IterationStatement: T_FOR T_LPAREN LeftHandSideExpression T_IN Expression T_RPAREN Statement ;
+/.
+case $rule_number: {
+ AST:: ForEachStatement *node = makeAstNode<AST::ForEachStatement> (driver->nodePool(), sym(3).Expression,
+ sym(5).Expression, sym(7).Statement);
+ node->forToken = loc(1);
+ node->lparenToken = loc(2);
+ node->inToken = loc(4);
+ node->rparenToken = loc(6);
+ sym(1).Node = node;
+} break;
+./
+
+IterationStatement: T_FOR T_LPAREN T_VAR VariableDeclarationNotIn T_IN Expression T_RPAREN Statement ;
+/.
+case $rule_number: {
+ AST::LocalForEachStatement *node = makeAstNode<AST::LocalForEachStatement> (driver->nodePool(),
+ sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement);
+ node->forToken = loc(1);
+ node->lparenToken = loc(2);
+ node->varToken = loc(3);
+ node->inToken = loc(5);
+ node->rparenToken = loc(7);
+ sym(1).Node = node;
+} break;
+./
+
+ContinueStatement: T_CONTINUE T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
+ContinueStatement: T_CONTINUE T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::ContinueStatement *node = makeAstNode<AST::ContinueStatement> (driver->nodePool());
+ node->continueToken = loc(1);
+ node->semicolonToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+ContinueStatement: T_CONTINUE JsIdentifier T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
+ContinueStatement: T_CONTINUE JsIdentifier T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::ContinueStatement *node = makeAstNode<AST::ContinueStatement> (driver->nodePool(), sym(2).sval);
+ node->continueToken = loc(1);
+ node->identifierToken = loc(2);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+BreakStatement: T_BREAK T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
+BreakStatement: T_BREAK T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::BreakStatement *node = makeAstNode<AST::BreakStatement> (driver->nodePool());
+ node->breakToken = loc(1);
+ node->semicolonToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+BreakStatement: T_BREAK JsIdentifier T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
+BreakStatement: T_BREAK JsIdentifier T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::BreakStatement *node = makeAstNode<AST::BreakStatement> (driver->nodePool(), sym(2).sval);
+ node->breakToken = loc(1);
+ node->identifierToken = loc(2);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+ReturnStatement: T_RETURN ExpressionOpt T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
+ReturnStatement: T_RETURN ExpressionOpt T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::ReturnStatement *node = makeAstNode<AST::ReturnStatement> (driver->nodePool(), sym(2).Expression);
+ node->returnToken = loc(1);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+WithStatement: T_WITH T_LPAREN Expression T_RPAREN Statement ;
+/.
+case $rule_number: {
+ AST::WithStatement *node = makeAstNode<AST::WithStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
+ node->withToken = loc(1);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+SwitchStatement: T_SWITCH T_LPAREN Expression T_RPAREN CaseBlock ;
+/.
+case $rule_number: {
+ AST::SwitchStatement *node = makeAstNode<AST::SwitchStatement> (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock);
+ node->switchToken = loc(1);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+CaseBlock: T_LBRACE CaseClausesOpt T_RBRACE ;
+/.
+case $rule_number: {
+ AST::CaseBlock *node = makeAstNode<AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses);
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+CaseBlock: T_LBRACE CaseClausesOpt DefaultClause CaseClausesOpt T_RBRACE ;
+/.
+case $rule_number: {
+ AST::CaseBlock *node = makeAstNode<AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses);
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(5);
+ sym(1).Node = node;
+} break;
+./
+
+CaseClauses: CaseClause ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::CaseClauses> (driver->nodePool(), sym(1).CaseClause);
+} break;
+./
+
+CaseClauses: CaseClauses CaseClause ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::CaseClauses> (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause);
+} break;
+./
+
+CaseClausesOpt: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+CaseClausesOpt: CaseClauses ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(1).CaseClauses->finish ();
+} break;
+./
+
+CaseClause: T_CASE Expression T_COLON StatementListOpt ;
+/.
+case $rule_number: {
+ AST::CaseClause *node = makeAstNode<AST::CaseClause> (driver->nodePool(), sym(2).Expression, sym(4).StatementList);
+ node->caseToken = loc(1);
+ node->colonToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+DefaultClause: T_DEFAULT T_COLON StatementListOpt ;
+/.
+case $rule_number: {
+ AST::DefaultClause *node = makeAstNode<AST::DefaultClause> (driver->nodePool(), sym(3).StatementList);
+ node->defaultToken = loc(1);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+LabelledStatement: T_SIGNAL T_COLON Statement ;
+/.case $rule_number:./
+
+LabelledStatement: T_PROPERTY T_COLON Statement ;
+/.
+case $rule_number: {
+ AST::LabelledStatement *node = makeAstNode<AST::LabelledStatement> (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount()), sym(3).Statement);
+ node->identifierToken = loc(1);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+LabelledStatement: T_IDENTIFIER T_COLON Statement ;
+/.
+case $rule_number: {
+ AST::LabelledStatement *node = makeAstNode<AST::LabelledStatement> (driver->nodePool(), sym(1).sval, sym(3).Statement);
+ node->identifierToken = loc(1);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+ThrowStatement: T_THROW Expression T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
+ThrowStatement: T_THROW Expression T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::ThrowStatement *node = makeAstNode<AST::ThrowStatement> (driver->nodePool(), sym(2).Expression);
+ node->throwToken = loc(1);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+TryStatement: T_TRY Block Catch ;
+/.
+case $rule_number: {
+ AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch);
+ node->tryToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+TryStatement: T_TRY Block Finally ;
+/.
+case $rule_number: {
+ AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Finally);
+ node->tryToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+TryStatement: T_TRY Block Catch Finally ;
+/.
+case $rule_number: {
+ AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally);
+ node->tryToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+Catch: T_CATCH T_LPAREN JsIdentifier T_RPAREN Block ;
+/.
+case $rule_number: {
+ AST::Catch *node = makeAstNode<AST::Catch> (driver->nodePool(), sym(3).sval, sym(5).Block);
+ node->catchToken = loc(1);
+ node->lparenToken = loc(2);
+ node->identifierToken = loc(3);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+Finally: T_FINALLY Block ;
+/.
+case $rule_number: {
+ AST::Finally *node = makeAstNode<AST::Finally> (driver->nodePool(), sym(2).Block);
+ node->finallyToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+DebuggerStatement: T_DEBUGGER T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
+DebuggerStatement: T_DEBUGGER T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::DebuggerStatement *node = makeAstNode<AST::DebuggerStatement> (driver->nodePool());
+ node->debuggerToken = loc(1);
+ node->semicolonToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+FunctionDeclaration: T_FUNCTION JsIdentifier T_LPAREN FormalParameterListOpt T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ;
+/.
+case $rule_number: {
+ AST::FunctionDeclaration *node = makeAstNode<AST::FunctionDeclaration> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody);
+ node->functionToken = loc(1);
+ node->identifierToken = loc(2);
+ node->lparenToken = loc(3);
+ node->rparenToken = loc(5);
+ node->lbraceToken = loc(6);
+ node->rbraceToken = loc(8);
+ sym(1).Node = node;
+} break;
+./
+
+FunctionExpression: T_FUNCTION IdentifierOpt T_LPAREN FormalParameterListOpt T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ;
+/.
+case $rule_number: {
+ AST::FunctionExpression *node = makeAstNode<AST::FunctionExpression> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody);
+ node->functionToken = loc(1);
+ if (sym(2).sval)
+ node->identifierToken = loc(2);
+ node->lparenToken = loc(3);
+ node->rparenToken = loc(5);
+ node->lbraceToken = loc(6);
+ node->rbraceToken = loc(8);
+ sym(1).Node = node;
+} break;
+./
+
+FormalParameterList: JsIdentifier ;
+/.
+case $rule_number: {
+ AST::FormalParameterList *node = makeAstNode<AST::FormalParameterList> (driver->nodePool(), sym(1).sval);
+ node->identifierToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+FormalParameterList: FormalParameterList T_COMMA JsIdentifier ;
+/.
+case $rule_number: {
+ AST::FormalParameterList *node = makeAstNode<AST::FormalParameterList> (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval);
+ node->commaToken = loc(2);
+ node->identifierToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+FormalParameterListOpt: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+FormalParameterListOpt: FormalParameterList ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(1).FormalParameterList->finish ();
+} break;
+./
+
+FunctionBodyOpt: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+FunctionBodyOpt: FunctionBody ;
+
+FunctionBody: SourceElements ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::FunctionBody> (driver->nodePool(), sym(1).SourceElements->finish ());
+} break;
+./
+
+Program: SourceElements ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::Program> (driver->nodePool(), sym(1).SourceElements->finish ());
+} break;
+./
+
+SourceElements: SourceElement ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::SourceElements> (driver->nodePool(), sym(1).SourceElement);
+} break;
+./
+
+SourceElements: SourceElements SourceElement ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::SourceElements> (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement);
+} break;
+./
+
+SourceElement: Statement ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::StatementSourceElement> (driver->nodePool(), sym(1).Statement);
+} break;
+./
+
+SourceElement: FunctionDeclaration ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::FunctionSourceElement> (driver->nodePool(), sym(1).FunctionDeclaration);
+} break;
+./
+
+IdentifierOpt: ;
+/.
+case $rule_number: {
+ sym(1).sval = 0;
+} break;
+./
+
+IdentifierOpt: JsIdentifier ;
+
+PropertyNameAndValueListOpt: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+PropertyNameAndValueListOpt: PropertyNameAndValueList ;
+
+/.
+ } // switch
+ action = nt_action(state_stack[tos], lhs[r] - TERMINAL_COUNT);
+ } // if
+ } while (action != 0);
+
+ if (first_token == last_token) {
+ const int errorState = state_stack[tos];
+
+ // automatic insertion of `;'
+ if (yytoken != -1 && t_action(errorState, T_AUTOMATIC_SEMICOLON) && automatic(driver, yytoken)) {
+ SavedToken &tk = token_buffer[0];
+ tk.token = yytoken;
+ tk.dval = yylval;
+ tk.loc = yylloc;
+
+ yylloc = yyprevlloc;
+ yylloc.offset += yylloc.length;
+ yylloc.startColumn += yylloc.length;
+ yylloc.length = 0;
+
+ //const QString msg = qApp->translate("QDeclarativeParser", "Missing `;'");
+ //diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, yylloc, msg));
+
+ first_token = &token_buffer[0];
+ last_token = &token_buffer[1];
+
+ yytoken = T_SEMICOLON;
+ yylval = 0;
+
+ action = errorState;
+
+ goto _Lcheck_token;
+ }
+
+ hadErrors = true;
+
+ token_buffer[0].token = yytoken;
+ token_buffer[0].dval = yylval;
+ token_buffer[0].loc = yylloc;
+
+ token_buffer[1].token = yytoken = lexer->lex();
+ token_buffer[1].dval = yylval = lexer->dval();
+ token_buffer[1].loc = yylloc = location(lexer);
+
+ if (t_action(errorState, yytoken)) {
+ QString msg;
+ int token = token_buffer[0].token;
+ if (token < 0 || token >= TERMINAL_COUNT)
+ msg = qApp->translate("QDeclarativeParser", "Syntax error");
+ else
+ msg = qApp->translate("QDeclarativeParser", "Unexpected token `%1'").arg(QLatin1String(spell[token]));
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
+
+ action = errorState;
+ goto _Lcheck_token;
+ }
+
+ static int tokens[] = {
+ T_PLUS,
+ T_EQ,
+
+ T_COMMA,
+ T_COLON,
+ T_SEMICOLON,
+
+ T_RPAREN, T_RBRACKET, T_RBRACE,
+
+ T_NUMERIC_LITERAL,
+ T_IDENTIFIER,
+
+ T_LPAREN, T_LBRACKET, T_LBRACE,
+
+ EOF_SYMBOL
+ };
+
+ for (int *tk = tokens; *tk != EOF_SYMBOL; ++tk) {
+ int a = t_action(errorState, *tk);
+ if (a > 0 && t_action(a, yytoken)) {
+ const QString msg = qApp->translate("QDeclarativeParser", "Expected token `%1'").arg(QLatin1String(spell[*tk]));
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
+
+ yytoken = *tk;
+ yylval = 0;
+ yylloc = token_buffer[0].loc;
+ yylloc.length = 0;
+
+ first_token = &token_buffer[0];
+ last_token = &token_buffer[2];
+
+ action = errorState;
+ goto _Lcheck_token;
+ }
+ }
+
+ for (int tk = 1; tk < TERMINAL_COUNT; ++tk) {
+ if (tk == T_AUTOMATIC_SEMICOLON || tk == T_FEED_UI_PROGRAM ||
+ tk == T_FEED_JS_STATEMENT || tk == T_FEED_JS_EXPRESSION ||
+ tk == T_FEED_JS_SOURCE_ELEMENT)
+ continue;
+
+ int a = t_action(errorState, tk);
+ if (a > 0 && t_action(a, yytoken)) {
+ const QString msg = qApp->translate("QDeclarativeParser", "Expected token `%1'").arg(QLatin1String(spell[tk]));
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
+
+ yytoken = tk;
+ yylval = 0;
+ yylloc = token_buffer[0].loc;
+ yylloc.length = 0;
+
+ action = errorState;
+ goto _Lcheck_token;
+ }
+ }
+
+ const QString msg = qApp->translate("QDeclarativeParser", "Syntax error");
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
+ }
+
+ return false;
+}
+
+QT_QML_END_NAMESPACE
+
+
+./
+/:
+QT_QML_END_NAMESPACE
+
+
+
+#endif // QDECLARATIVEJSPARSER_P_H
+:/
diff --git a/tools/qdoc3/declarativeparser/qdeclarativejsast.cpp b/tools/qdoc3/declarativeparser/qdeclarativejsast.cpp
new file mode 100644
index 0000000..afb399a
--- /dev/null
+++ b/tools/qdoc3/declarativeparser/qdeclarativejsast.cpp
@@ -0,0 +1,956 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativejsast_p.h"
+
+#include "private/qdeclarativejsastvisitor_p.h"
+
+QT_QML_BEGIN_NAMESPACE
+
+namespace QDeclarativeJS { namespace AST {
+
+void Node::accept(Visitor *visitor)
+{
+ if (visitor->preVisit(this)) {
+ accept0(visitor);
+ }
+ visitor->postVisit(this);
+}
+
+void Node::accept(Node *node, Visitor *visitor)
+{
+ if (node)
+ node->accept(visitor);
+}
+
+ExpressionNode *Node::expressionCast()
+{
+ return 0;
+}
+
+BinaryExpression *Node::binaryExpressionCast()
+{
+ return 0;
+}
+
+Statement *Node::statementCast()
+{
+ return 0;
+}
+
+UiObjectMember *Node::uiObjectMemberCast()
+{
+ return 0;
+}
+
+ExpressionNode *ExpressionNode::expressionCast()
+{
+ return this;
+}
+
+BinaryExpression *BinaryExpression::binaryExpressionCast()
+{
+ return this;
+}
+
+Statement *Statement::statementCast()
+{
+ return this;
+}
+
+UiObjectMember *UiObjectMember::uiObjectMemberCast()
+{
+ return this;
+}
+
+void NestedExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+ visitor->endVisit(this);
+}
+
+void ThisExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void IdentifierExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void NullExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void TrueLiteral::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void FalseLiteral::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void StringLiteral::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void NumericLiteral::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void RegExpLiteral::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void ArrayLiteral::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(elements, visitor);
+ accept(elision, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void ObjectLiteral::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(properties, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void ElementList::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ for (ElementList *it = this; it; it = it->next) {
+ accept(it->elision, visitor);
+ accept(it->expression, visitor);
+ }
+ }
+
+ visitor->endVisit(this);
+}
+
+void Elision::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ // ###
+ }
+
+ visitor->endVisit(this);
+}
+
+void PropertyNameAndValueList::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ for (PropertyNameAndValueList *it = this; it; it = it->next) {
+ accept(it->name, visitor);
+ accept(it->value, visitor);
+ }
+ }
+
+ visitor->endVisit(this);
+}
+
+void IdentifierPropertyName::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void StringLiteralPropertyName::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void NumericLiteralPropertyName::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void ArrayMemberExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(base, visitor);
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void FieldMemberExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(base, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void NewMemberExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(base, visitor);
+ accept(arguments, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void NewExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void CallExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(base, visitor);
+ accept(arguments, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void ArgumentList::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ for (ArgumentList *it = this; it; it = it->next) {
+ accept(it->expression, visitor);
+ }
+ }
+
+ visitor->endVisit(this);
+}
+
+void PostIncrementExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(base, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void PostDecrementExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(base, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void DeleteExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void VoidExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void TypeOfExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void PreIncrementExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void PreDecrementExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UnaryPlusExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UnaryMinusExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void TildeExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void NotExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void BinaryExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(left, visitor);
+ accept(right, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void ConditionalExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ accept(ok, visitor);
+ accept(ko, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void Expression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(left, visitor);
+ accept(right, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void Block::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(statements, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void StatementList::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ for (StatementList *it = this; it; it = it->next) {
+ accept(it->statement, visitor);
+ }
+ }
+
+ visitor->endVisit(this);
+}
+
+void VariableStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(declarations, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void VariableDeclarationList::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ for (VariableDeclarationList *it = this; it; it = it->next) {
+ accept(it->declaration, visitor);
+ }
+ }
+
+ visitor->endVisit(this);
+}
+
+void VariableDeclaration::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void EmptyStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void ExpressionStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void IfStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ accept(ok, visitor);
+ accept(ko, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void DoWhileStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(statement, visitor);
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void WhileStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ accept(statement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void ForStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(initialiser, visitor);
+ accept(condition, visitor);
+ accept(expression, visitor);
+ accept(statement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void LocalForStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(declarations, visitor);
+ accept(condition, visitor);
+ accept(expression, visitor);
+ accept(statement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void ForEachStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(initialiser, visitor);
+ accept(expression, visitor);
+ accept(statement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void LocalForEachStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(declaration, visitor);
+ accept(expression, visitor);
+ accept(statement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void ContinueStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void BreakStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void ReturnStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void WithStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ accept(statement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void SwitchStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ accept(block, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void CaseBlock::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(clauses, visitor);
+ accept(defaultClause, visitor);
+ accept(moreClauses, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void CaseClauses::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ for (CaseClauses *it = this; it; it = it->next) {
+ accept(it->clause, visitor);
+ }
+ }
+
+ visitor->endVisit(this);
+}
+
+void CaseClause::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ accept(statements, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void DefaultClause::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(statements, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void LabelledStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(statement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void ThrowStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void TryStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(statement, visitor);
+ accept(catchExpression, visitor);
+ accept(finallyExpression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void Catch::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(statement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void Finally::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(statement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void FunctionDeclaration::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(formals, visitor);
+ accept(body, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void FunctionExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(formals, visitor);
+ accept(body, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void FormalParameterList::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ // ###
+ }
+
+ visitor->endVisit(this);
+}
+
+void FunctionBody::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(elements, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void Program::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(elements, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void SourceElements::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ for (SourceElements *it = this; it; it = it->next) {
+ accept(it->element, visitor);
+ }
+ }
+
+ visitor->endVisit(this);
+}
+
+void FunctionSourceElement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(declaration, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void StatementSourceElement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(statement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void DebuggerStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiProgram::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(imports, visitor);
+ accept(members, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiSignature::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(formals, visitor);
+ }
+ visitor->endVisit(this);
+}
+
+void UiFormalList::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ for (UiFormalList *it = this; it; it = it->next) {
+ accept(it->formal, visitor);
+ }
+ }
+ visitor->endVisit(this);
+}
+
+void UiFormal::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+ visitor->endVisit(this);
+}
+
+void UiPublicMember::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ accept(binding, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiObjectDefinition::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(qualifiedTypeNameId, visitor);
+ accept(initializer, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiObjectInitializer::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(members, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiObjectBinding::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(qualifiedId, visitor);
+ accept(qualifiedTypeNameId, visitor);
+ accept(initializer, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiScriptBinding::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(qualifiedId, visitor);
+ accept(statement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiArrayBinding::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(qualifiedId, visitor);
+ accept(members, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiObjectMemberList::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ for (UiObjectMemberList *it = this; it; it = it->next)
+ accept(it->member, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiArrayMemberList::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ for (UiArrayMemberList *it = this; it; it = it->next)
+ accept(it->member, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiQualifiedId::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiImport::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(importUri, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiImportList::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(import, visitor);
+ accept(next, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiSourceElement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(sourceElement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+} } // namespace QDeclarativeJS::AST
+
+QT_QML_END_NAMESPACE
+
+
diff --git a/tools/qdoc3/declarativeparser/qdeclarativejsast_p.h b/tools/qdoc3/declarativeparser/qdeclarativejsast_p.h
new file mode 100644
index 0000000..956d6e7
--- /dev/null
+++ b/tools/qdoc3/declarativeparser/qdeclarativejsast_p.h
@@ -0,0 +1,2546 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative 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 QDECLARATIVEJSAST_P_H
+#define QDECLARATIVEJSAST_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativejsastvisitor_p.h"
+#include "private/qdeclarativejsglobal_p.h"
+
+#include <QtCore/QString>
+
+QT_QML_BEGIN_NAMESPACE
+
+#define QDECLARATIVEJS_DECLARE_AST_NODE(name) \
+ enum { K = Kind_##name };
+
+namespace QSOperator // ### rename
+{
+
+enum Op {
+ Add,
+ And,
+ InplaceAnd,
+ Assign,
+ BitAnd,
+ BitOr,
+ BitXor,
+ InplaceSub,
+ Div,
+ InplaceDiv,
+ Equal,
+ Ge,
+ Gt,
+ In,
+ InplaceAdd,
+ InstanceOf,
+ Le,
+ LShift,
+ InplaceLeftShift,
+ Lt,
+ Mod,
+ InplaceMod,
+ Mul,
+ InplaceMul,
+ NotEqual,
+ Or,
+ InplaceOr,
+ RShift,
+ InplaceRightShift,
+ StrictEqual,
+ StrictNotEqual,
+ Sub,
+ URShift,
+ InplaceURightShift,
+ InplaceXor
+};
+
+} // namespace QSOperator
+
+namespace QDeclarativeJS {
+class NameId;
+namespace AST {
+
+template <typename _T1, typename _T2>
+_T1 cast(_T2 *ast)
+{
+ if (ast && ast->kind == static_cast<_T1>(0)->K)
+ return static_cast<_T1>(ast);
+
+ return 0;
+}
+
+class QML_PARSER_EXPORT Node
+{
+public:
+ enum Kind {
+ Kind_Undefined,
+
+ Kind_ArgumentList,
+ Kind_ArrayLiteral,
+ Kind_ArrayMemberExpression,
+ Kind_BinaryExpression,
+ Kind_Block,
+ Kind_BreakStatement,
+ Kind_CallExpression,
+ Kind_CaseBlock,
+ Kind_CaseClause,
+ Kind_CaseClauses,
+ Kind_Catch,
+ Kind_ConditionalExpression,
+ Kind_ContinueStatement,
+ Kind_DebuggerStatement,
+ Kind_DefaultClause,
+ Kind_DeleteExpression,
+ Kind_DoWhileStatement,
+ Kind_ElementList,
+ Kind_Elision,
+ Kind_EmptyStatement,
+ Kind_Expression,
+ Kind_ExpressionStatement,
+ Kind_FalseLiteral,
+ Kind_FieldMemberExpression,
+ Kind_Finally,
+ Kind_ForEachStatement,
+ Kind_ForStatement,
+ Kind_FormalParameterList,
+ Kind_FunctionBody,
+ Kind_FunctionDeclaration,
+ Kind_FunctionExpression,
+ Kind_FunctionSourceElement,
+ Kind_IdentifierExpression,
+ Kind_IdentifierPropertyName,
+ Kind_IfStatement,
+ Kind_LabelledStatement,
+ Kind_LocalForEachStatement,
+ Kind_LocalForStatement,
+ Kind_NewExpression,
+ Kind_NewMemberExpression,
+ Kind_NotExpression,
+ Kind_NullExpression,
+ Kind_NumericLiteral,
+ Kind_NumericLiteralPropertyName,
+ Kind_ObjectLiteral,
+ Kind_PostDecrementExpression,
+ Kind_PostIncrementExpression,
+ Kind_PreDecrementExpression,
+ Kind_PreIncrementExpression,
+ Kind_Program,
+ Kind_PropertyName,
+ Kind_PropertyNameAndValueList,
+ Kind_RegExpLiteral,
+ Kind_ReturnStatement,
+ Kind_SourceElement,
+ Kind_SourceElements,
+ Kind_StatementList,
+ Kind_StatementSourceElement,
+ Kind_StringLiteral,
+ Kind_StringLiteralPropertyName,
+ Kind_SwitchStatement,
+ Kind_ThisExpression,
+ Kind_ThrowStatement,
+ Kind_TildeExpression,
+ Kind_TrueLiteral,
+ Kind_TryStatement,
+ Kind_TypeOfExpression,
+ Kind_UnaryMinusExpression,
+ Kind_UnaryPlusExpression,
+ Kind_VariableDeclaration,
+ Kind_VariableDeclarationList,
+ Kind_VariableStatement,
+ Kind_VoidExpression,
+ Kind_WhileStatement,
+ Kind_WithStatement,
+ Kind_NestedExpression,
+
+ Kind_UiArrayBinding,
+ Kind_UiImport,
+ Kind_UiImportList,
+ Kind_UiObjectBinding,
+ Kind_UiObjectDefinition,
+ Kind_UiObjectInitializer,
+ Kind_UiObjectMemberList,
+ Kind_UiArrayMemberList,
+ Kind_UiProgram,
+ Kind_UiParameterList,
+ Kind_UiPublicMember,
+ Kind_UiQualifiedId,
+ Kind_UiScriptBinding,
+ Kind_UiSourceElement,
+ Kind_UiFormal,
+ Kind_UiFormalList,
+ Kind_UiSignature
+ };
+
+ inline Node()
+ : kind(Kind_Undefined) {}
+
+ // NOTE: node destructors are never called,
+ // instead we block free the memory
+ // (see the NodePool class)
+ virtual ~Node() {}
+
+ virtual ExpressionNode *expressionCast();
+ virtual BinaryExpression *binaryExpressionCast();
+ virtual Statement *statementCast();
+ virtual UiObjectMember *uiObjectMemberCast();
+
+ void accept(Visitor *visitor);
+ static void accept(Node *node, Visitor *visitor);
+
+ inline static void acceptChild(Node *node, Visitor *visitor)
+ { return accept(node, visitor); } // ### remove
+
+ virtual void accept0(Visitor *visitor) = 0;
+
+// attributes
+ int kind;
+};
+
+class QML_PARSER_EXPORT ExpressionNode: public Node
+{
+public:
+ ExpressionNode() {}
+
+ virtual ExpressionNode *expressionCast();
+
+ virtual SourceLocation firstSourceLocation() const = 0;
+ virtual SourceLocation lastSourceLocation() const = 0;
+};
+
+class QML_PARSER_EXPORT Statement: public Node
+{
+public:
+ Statement() {}
+
+ virtual Statement *statementCast();
+
+ virtual SourceLocation firstSourceLocation() const = 0;
+ virtual SourceLocation lastSourceLocation() const = 0;
+};
+
+class QML_PARSER_EXPORT UiFormal: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiFormal)
+
+ UiFormal(NameId *name, NameId *alias = 0)
+ : name(name), alias(alias)
+ { }
+
+ virtual SourceLocation firstSourceLocation() const
+ { return SourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return SourceLocation(); }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ NameId *name;
+ NameId *alias;
+ SourceLocation identifierToken;
+ SourceLocation asToken;
+ SourceLocation aliasToken;
+};
+
+class QML_PARSER_EXPORT UiFormalList: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiFormalList)
+
+ UiFormalList(UiFormal *formal)
+ : formal(formal), next(this) {}
+
+ UiFormalList(UiFormalList *previous, UiFormal *formal)
+ : formal(formal)
+ {
+ next = previous->next;
+ previous->next = this;
+ }
+
+ UiFormalList *finish()
+ {
+ UiFormalList *head = next;
+ next = 0;
+ return head;
+ }
+
+ virtual SourceLocation firstSourceLocation() const
+ { return SourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return SourceLocation(); }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ UiFormal *formal;
+ UiFormalList *next;
+};
+
+class QML_PARSER_EXPORT UiSignature: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiSignature)
+
+ UiSignature(UiFormalList *formals = 0)
+ : formals(formals)
+ { }
+
+ virtual SourceLocation firstSourceLocation() const
+ { return SourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return SourceLocation(); }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ SourceLocation lparenToken;
+ UiFormalList *formals;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT NestedExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(NestedExpression)
+
+ NestedExpression(ExpressionNode *expression)
+ : expression(expression)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return lparenToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return rparenToken; }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation lparenToken;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT ThisExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ThisExpression)
+
+ ThisExpression() { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return thisToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return thisToken; }
+
+// attributes
+ SourceLocation thisToken;
+};
+
+class QML_PARSER_EXPORT IdentifierExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(IdentifierExpression)
+
+ IdentifierExpression(NameId *n):
+ name (n) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return identifierToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return identifierToken; }
+
+// attributes
+ NameId *name;
+ SourceLocation identifierToken;
+};
+
+class QML_PARSER_EXPORT NullExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(NullExpression)
+
+ NullExpression() { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return nullToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return nullToken; }
+
+// attributes
+ SourceLocation nullToken;
+};
+
+class QML_PARSER_EXPORT TrueLiteral: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(TrueLiteral)
+
+ TrueLiteral() { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return trueToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return trueToken; }
+
+// attributes
+ SourceLocation trueToken;
+};
+
+class QML_PARSER_EXPORT FalseLiteral: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(FalseLiteral)
+
+ FalseLiteral() { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return falseToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return falseToken; }
+
+// attributes
+ SourceLocation falseToken;
+};
+
+class QML_PARSER_EXPORT NumericLiteral: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(NumericLiteral)
+
+ NumericLiteral(double v):
+ value(v) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return literalToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return literalToken; }
+
+// attributes:
+ double value;
+ SourceLocation literalToken;
+};
+
+class QML_PARSER_EXPORT StringLiteral: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(StringLiteral)
+
+ StringLiteral(NameId *v):
+ value (v) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return literalToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return literalToken; }
+
+// attributes:
+ NameId *value;
+ SourceLocation literalToken;
+};
+
+class QML_PARSER_EXPORT RegExpLiteral: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(RegExpLiteral)
+
+ RegExpLiteral(NameId *p, int f):
+ pattern (p), flags (f) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return literalToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return literalToken; }
+
+// attributes:
+ NameId *pattern;
+ int flags;
+ SourceLocation literalToken;
+};
+
+class QML_PARSER_EXPORT ArrayLiteral: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ArrayLiteral)
+
+ ArrayLiteral(Elision *e):
+ elements (0), elision (e)
+ { kind = K; }
+
+ ArrayLiteral(ElementList *elts):
+ elements (elts), elision (0)
+ { kind = K; }
+
+ ArrayLiteral(ElementList *elts, Elision *e):
+ elements (elts), elision (e)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return lbracketToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return rbracketToken; }
+
+// attributes
+ ElementList *elements;
+ Elision *elision;
+ SourceLocation lbracketToken;
+ SourceLocation commaToken;
+ SourceLocation rbracketToken;
+};
+
+class QML_PARSER_EXPORT ObjectLiteral: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ObjectLiteral)
+
+ ObjectLiteral():
+ properties (0) { kind = K; }
+
+ ObjectLiteral(PropertyNameAndValueList *plist):
+ properties (plist) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return lbraceToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return rbraceToken; }
+
+// attributes
+ PropertyNameAndValueList *properties;
+ SourceLocation lbraceToken;
+ SourceLocation rbraceToken;
+};
+
+class QML_PARSER_EXPORT ElementList: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ElementList)
+
+ ElementList(Elision *e, ExpressionNode *expr):
+ elision (e), expression (expr), next (this)
+ { kind = K; }
+
+ ElementList(ElementList *previous, Elision *e, ExpressionNode *expr):
+ elision (e), expression (expr)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ inline ElementList *finish ()
+ {
+ ElementList *front = next;
+ next = 0;
+ return front;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ Elision *elision;
+ ExpressionNode *expression;
+ ElementList *next;
+ SourceLocation commaToken;
+};
+
+class QML_PARSER_EXPORT Elision: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(Elision)
+
+ Elision():
+ next (this) { kind = K; }
+
+ Elision(Elision *previous)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+ inline Elision *finish ()
+ {
+ Elision *front = next;
+ next = 0;
+ return front;
+ }
+
+// attributes
+ Elision *next;
+ SourceLocation commaToken;
+};
+
+class QML_PARSER_EXPORT PropertyNameAndValueList: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(PropertyNameAndValueList)
+
+ PropertyNameAndValueList(PropertyName *n, ExpressionNode *v):
+ name (n), value (v), next (this)
+ { kind = K; }
+
+ PropertyNameAndValueList(PropertyNameAndValueList *previous, PropertyName *n, ExpressionNode *v):
+ name (n), value (v)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+ inline PropertyNameAndValueList *finish ()
+ {
+ PropertyNameAndValueList *front = next;
+ next = 0;
+ return front;
+ }
+
+// attributes
+ PropertyName *name;
+ ExpressionNode *value;
+ PropertyNameAndValueList *next;
+ SourceLocation colonToken;
+ SourceLocation commaToken;
+};
+
+class QML_PARSER_EXPORT PropertyName: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(PropertyName)
+
+ PropertyName() { kind = K; }
+
+// attributes
+ SourceLocation propertyNameToken;
+};
+
+class QML_PARSER_EXPORT IdentifierPropertyName: public PropertyName
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(IdentifierPropertyName)
+
+ IdentifierPropertyName(NameId *n):
+ id (n) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ NameId *id;
+};
+
+class QML_PARSER_EXPORT StringLiteralPropertyName: public PropertyName
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(StringLiteralPropertyName)
+
+ StringLiteralPropertyName(NameId *n):
+ id (n) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ NameId *id;
+};
+
+class QML_PARSER_EXPORT NumericLiteralPropertyName: public PropertyName
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(NumericLiteralPropertyName)
+
+ NumericLiteralPropertyName(double n):
+ id (n) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ double id;
+};
+
+class QML_PARSER_EXPORT ArrayMemberExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ArrayMemberExpression)
+
+ ArrayMemberExpression(ExpressionNode *b, ExpressionNode *e):
+ base (b), expression (e)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return base->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return rbracketToken; }
+
+// attributes
+ ExpressionNode *base;
+ ExpressionNode *expression;
+ SourceLocation lbracketToken;
+ SourceLocation rbracketToken;
+};
+
+class QML_PARSER_EXPORT FieldMemberExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(FieldMemberExpression)
+
+ FieldMemberExpression(ExpressionNode *b, NameId *n):
+ base (b), name (n)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return base->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return identifierToken; }
+
+ // attributes
+ ExpressionNode *base;
+ NameId *name;
+ SourceLocation dotToken;
+ SourceLocation identifierToken;
+};
+
+class QML_PARSER_EXPORT NewMemberExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(NewMemberExpression)
+
+ NewMemberExpression(ExpressionNode *b, ArgumentList *a):
+ base (b), arguments (a)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return newToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return rparenToken; }
+
+ // attributes
+ ExpressionNode *base;
+ ArgumentList *arguments;
+ SourceLocation newToken;
+ SourceLocation lparenToken;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT NewExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(NewExpression)
+
+ NewExpression(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return newToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return expression->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation newToken;
+};
+
+class QML_PARSER_EXPORT CallExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(CallExpression)
+
+ CallExpression(ExpressionNode *b, ArgumentList *a):
+ base (b), arguments (a)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return base->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return rparenToken; }
+
+// attributes
+ ExpressionNode *base;
+ ArgumentList *arguments;
+ SourceLocation lparenToken;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT ArgumentList: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ArgumentList)
+
+ ArgumentList(ExpressionNode *e):
+ expression (e), next (this)
+ { kind = K; }
+
+ ArgumentList(ArgumentList *previous, ExpressionNode *e):
+ expression (e)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+ inline ArgumentList *finish ()
+ {
+ ArgumentList *front = next;
+ next = 0;
+ return front;
+ }
+
+// attributes
+ ExpressionNode *expression;
+ ArgumentList *next;
+ SourceLocation commaToken;
+};
+
+class QML_PARSER_EXPORT PostIncrementExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(PostIncrementExpression)
+
+ PostIncrementExpression(ExpressionNode *b):
+ base (b) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return base->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return incrementToken; }
+
+// attributes
+ ExpressionNode *base;
+ SourceLocation incrementToken;
+};
+
+class QML_PARSER_EXPORT PostDecrementExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(PostDecrementExpression)
+
+ PostDecrementExpression(ExpressionNode *b):
+ base (b) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return base->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return decrementToken; }
+
+// attributes
+ ExpressionNode *base;
+ SourceLocation decrementToken;
+};
+
+class QML_PARSER_EXPORT DeleteExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(DeleteExpression)
+
+ DeleteExpression(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return deleteToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return expression->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation deleteToken;
+};
+
+class QML_PARSER_EXPORT VoidExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(VoidExpression)
+
+ VoidExpression(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return voidToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return expression->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation voidToken;
+};
+
+class QML_PARSER_EXPORT TypeOfExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(TypeOfExpression)
+
+ TypeOfExpression(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return typeofToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return expression->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation typeofToken;
+};
+
+class QML_PARSER_EXPORT PreIncrementExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(PreIncrementExpression)
+
+ PreIncrementExpression(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return incrementToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return expression->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation incrementToken;
+};
+
+class QML_PARSER_EXPORT PreDecrementExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(PreDecrementExpression)
+
+ PreDecrementExpression(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return decrementToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return expression->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation decrementToken;
+};
+
+class QML_PARSER_EXPORT UnaryPlusExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UnaryPlusExpression)
+
+ UnaryPlusExpression(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return plusToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return expression->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation plusToken;
+};
+
+class QML_PARSER_EXPORT UnaryMinusExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UnaryMinusExpression)
+
+ UnaryMinusExpression(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return minusToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return expression->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation minusToken;
+};
+
+class QML_PARSER_EXPORT TildeExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(TildeExpression)
+
+ TildeExpression(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return tildeToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return expression->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation tildeToken;
+};
+
+class QML_PARSER_EXPORT NotExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(NotExpression)
+
+ NotExpression(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return notToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return expression->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation notToken;
+};
+
+class QML_PARSER_EXPORT BinaryExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(BinaryExpression)
+
+ BinaryExpression(ExpressionNode *l, int o, ExpressionNode *r):
+ left (l), op (o), right (r)
+ { kind = K; }
+
+ virtual BinaryExpression *binaryExpressionCast();
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return left->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return right->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *left;
+ int op;
+ ExpressionNode *right;
+ SourceLocation operatorToken;
+};
+
+class QML_PARSER_EXPORT ConditionalExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ConditionalExpression)
+
+ ConditionalExpression(ExpressionNode *e, ExpressionNode *t, ExpressionNode *f):
+ expression (e), ok (t), ko (f)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return expression->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return ko->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ ExpressionNode *ok;
+ ExpressionNode *ko;
+ SourceLocation questionToken;
+ SourceLocation colonToken;
+};
+
+class QML_PARSER_EXPORT Expression: public ExpressionNode // ### rename
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(Expression)
+
+ Expression(ExpressionNode *l, ExpressionNode *r):
+ left (l), right (r) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return left->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return right->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *left;
+ ExpressionNode *right;
+ SourceLocation commaToken;
+};
+
+class QML_PARSER_EXPORT Block: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(Block)
+
+ Block(StatementList *slist):
+ statements (slist) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return lbraceToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return rbraceToken; }
+
+ // attributes
+ StatementList *statements;
+ SourceLocation lbraceToken;
+ SourceLocation rbraceToken;
+};
+
+class QML_PARSER_EXPORT StatementList: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(StatementList)
+
+ StatementList(Statement *stmt):
+ statement (stmt), next (this)
+ { kind = K; }
+
+ StatementList(StatementList *previous, Statement *stmt):
+ statement (stmt)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+ inline StatementList *finish ()
+ {
+ StatementList *front = next;
+ next = 0;
+ return front;
+ }
+
+// attributes
+ Statement *statement;
+ StatementList *next;
+};
+
+class QML_PARSER_EXPORT VariableStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(VariableStatement)
+
+ VariableStatement(VariableDeclarationList *vlist):
+ declarations (vlist)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return declarationKindToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return semicolonToken; }
+
+// attributes
+ VariableDeclarationList *declarations;
+ SourceLocation declarationKindToken;
+ SourceLocation semicolonToken;
+};
+
+class QML_PARSER_EXPORT VariableDeclaration: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(VariableDeclaration)
+
+ VariableDeclaration(NameId *n, ExpressionNode *e):
+ name (n), expression (e), readOnly(false)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ NameId *name;
+ ExpressionNode *expression;
+ bool readOnly;
+ SourceLocation identifierToken;
+};
+
+class QML_PARSER_EXPORT VariableDeclarationList: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(VariableDeclarationList)
+
+ VariableDeclarationList(VariableDeclaration *decl):
+ declaration (decl), next (this)
+ { kind = K; }
+
+ VariableDeclarationList(VariableDeclarationList *previous, VariableDeclaration *decl):
+ declaration (decl)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+ inline VariableDeclarationList *finish (bool readOnly)
+ {
+ VariableDeclarationList *front = next;
+ next = 0;
+ if (readOnly) {
+ VariableDeclarationList *vdl;
+ for (vdl = front; vdl != 0; vdl = vdl->next)
+ vdl->declaration->readOnly = true;
+ }
+ return front;
+ }
+
+// attributes
+ VariableDeclaration *declaration;
+ VariableDeclarationList *next;
+ SourceLocation commaToken;
+};
+
+class QML_PARSER_EXPORT EmptyStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(EmptyStatement)
+
+ EmptyStatement() { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return semicolonToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return semicolonToken; }
+
+// attributes
+ SourceLocation semicolonToken;
+};
+
+class QML_PARSER_EXPORT ExpressionStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ExpressionStatement)
+
+ ExpressionStatement(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return expression->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return semicolonToken; }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation semicolonToken;
+};
+
+class QML_PARSER_EXPORT IfStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(IfStatement)
+
+ IfStatement(ExpressionNode *e, Statement *t, Statement *f = 0):
+ expression (e), ok (t), ko (f)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return ifToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ {
+ if (ko)
+ return ko->lastSourceLocation();
+
+ return ok->lastSourceLocation();
+ }
+
+// attributes
+ ExpressionNode *expression;
+ Statement *ok;
+ Statement *ko;
+ SourceLocation ifToken;
+ SourceLocation lparenToken;
+ SourceLocation rparenToken;
+ SourceLocation elseToken;
+};
+
+class QML_PARSER_EXPORT DoWhileStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(DoWhileStatement)
+
+ DoWhileStatement(Statement *stmt, ExpressionNode *e):
+ statement (stmt), expression (e)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return doToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return semicolonToken; }
+
+// attributes
+ Statement *statement;
+ ExpressionNode *expression;
+ SourceLocation doToken;
+ SourceLocation whileToken;
+ SourceLocation lparenToken;
+ SourceLocation rparenToken;
+ SourceLocation semicolonToken;
+};
+
+class QML_PARSER_EXPORT WhileStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(WhileStatement)
+
+ WhileStatement(ExpressionNode *e, Statement *stmt):
+ expression (e), statement (stmt)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return whileToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return statement->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ Statement *statement;
+ SourceLocation whileToken;
+ SourceLocation lparenToken;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT ForStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ForStatement)
+
+ ForStatement(ExpressionNode *i, ExpressionNode *c, ExpressionNode *e, Statement *stmt):
+ initialiser (i), condition (c), expression (e), statement (stmt)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return forToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return statement->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *initialiser;
+ ExpressionNode *condition;
+ ExpressionNode *expression;
+ Statement *statement;
+ SourceLocation forToken;
+ SourceLocation lparenToken;
+ SourceLocation firstSemicolonToken;
+ SourceLocation secondSemicolonToken;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT LocalForStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(LocalForStatement)
+
+ LocalForStatement(VariableDeclarationList *vlist, ExpressionNode *c, ExpressionNode *e, Statement *stmt):
+ declarations (vlist), condition (c), expression (e), statement (stmt)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return forToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return statement->lastSourceLocation(); }
+
+// attributes
+ VariableDeclarationList *declarations;
+ ExpressionNode *condition;
+ ExpressionNode *expression;
+ Statement *statement;
+ SourceLocation forToken;
+ SourceLocation lparenToken;
+ SourceLocation varToken;
+ SourceLocation firstSemicolonToken;
+ SourceLocation secondSemicolonToken;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT ForEachStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ForEachStatement)
+
+ ForEachStatement(ExpressionNode *i, ExpressionNode *e, Statement *stmt):
+ initialiser (i), expression (e), statement (stmt)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return forToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return statement->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *initialiser;
+ ExpressionNode *expression;
+ Statement *statement;
+ SourceLocation forToken;
+ SourceLocation lparenToken;
+ SourceLocation inToken;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT LocalForEachStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(LocalForEachStatement)
+
+ LocalForEachStatement(VariableDeclaration *v, ExpressionNode *e, Statement *stmt):
+ declaration (v), expression (e), statement (stmt)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return forToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return statement->lastSourceLocation(); }
+
+// attributes
+ VariableDeclaration *declaration;
+ ExpressionNode *expression;
+ Statement *statement;
+ SourceLocation forToken;
+ SourceLocation lparenToken;
+ SourceLocation varToken;
+ SourceLocation inToken;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT ContinueStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ContinueStatement)
+
+ ContinueStatement(NameId *l = 0):
+ label (l) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return continueToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return semicolonToken; }
+
+// attributes
+ NameId *label;
+ SourceLocation continueToken;
+ SourceLocation identifierToken;
+ SourceLocation semicolonToken;
+};
+
+class QML_PARSER_EXPORT BreakStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(BreakStatement)
+
+ BreakStatement(NameId *l = 0):
+ label (l) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return breakToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return semicolonToken; }
+
+ // attributes
+ NameId *label;
+ SourceLocation breakToken;
+ SourceLocation identifierToken;
+ SourceLocation semicolonToken;
+};
+
+class QML_PARSER_EXPORT ReturnStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ReturnStatement)
+
+ ReturnStatement(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return returnToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return semicolonToken; }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation returnToken;
+ SourceLocation semicolonToken;
+};
+
+class QML_PARSER_EXPORT WithStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(WithStatement)
+
+ WithStatement(ExpressionNode *e, Statement *stmt):
+ expression (e), statement (stmt)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return withToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return statement->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ Statement *statement;
+ SourceLocation withToken;
+ SourceLocation lparenToken;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT CaseBlock: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(CaseBlock)
+
+ CaseBlock(CaseClauses *c, DefaultClause *d = 0, CaseClauses *r = 0):
+ clauses (c), defaultClause (d), moreClauses (r)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ CaseClauses *clauses;
+ DefaultClause *defaultClause;
+ CaseClauses *moreClauses;
+ SourceLocation lbraceToken;
+ SourceLocation rbraceToken;
+};
+
+class QML_PARSER_EXPORT SwitchStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(SwitchStatement)
+
+ SwitchStatement(ExpressionNode *e, CaseBlock *b):
+ expression (e), block (b)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return switchToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return block->rbraceToken; }
+
+// attributes
+ ExpressionNode *expression;
+ CaseBlock *block;
+ SourceLocation switchToken;
+ SourceLocation lparenToken;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT CaseClauses: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(CaseClauses)
+
+ CaseClauses(CaseClause *c):
+ clause (c), next (this)
+ { kind = K; }
+
+ CaseClauses(CaseClauses *previous, CaseClause *c):
+ clause (c)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+ inline CaseClauses *finish ()
+ {
+ CaseClauses *front = next;
+ next = 0;
+ return front;
+ }
+
+//attributes
+ CaseClause *clause;
+ CaseClauses *next;
+};
+
+class QML_PARSER_EXPORT CaseClause: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(CaseClause)
+
+ CaseClause(ExpressionNode *e, StatementList *slist):
+ expression (e), statements (slist)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ ExpressionNode *expression;
+ StatementList *statements;
+ SourceLocation caseToken;
+ SourceLocation colonToken;
+};
+
+class QML_PARSER_EXPORT DefaultClause: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(DefaultClause)
+
+ DefaultClause(StatementList *slist):
+ statements (slist)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ StatementList *statements;
+ SourceLocation defaultToken;
+ SourceLocation colonToken;
+};
+
+class QML_PARSER_EXPORT LabelledStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(LabelledStatement)
+
+ LabelledStatement(NameId *l, Statement *stmt):
+ label (l), statement (stmt)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return identifierToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return statement->lastSourceLocation(); }
+
+// attributes
+ NameId *label;
+ Statement *statement;
+ SourceLocation identifierToken;
+ SourceLocation colonToken;
+};
+
+class QML_PARSER_EXPORT ThrowStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ThrowStatement)
+
+ ThrowStatement(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return throwToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return semicolonToken; }
+
+ // attributes
+ ExpressionNode *expression;
+ SourceLocation throwToken;
+ SourceLocation semicolonToken;
+};
+
+class QML_PARSER_EXPORT Catch: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(Catch)
+
+ Catch(NameId *n, Block *stmt):
+ name (n), statement (stmt)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ NameId *name;
+ Block *statement;
+ SourceLocation catchToken;
+ SourceLocation lparenToken;
+ SourceLocation identifierToken;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT Finally: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(Finally)
+
+ Finally(Block *stmt):
+ statement (stmt)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ Block *statement;
+ SourceLocation finallyToken;
+};
+
+class QML_PARSER_EXPORT TryStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(TryStatement)
+
+ TryStatement(Statement *stmt, Catch *c, Finally *f):
+ statement (stmt), catchExpression (c), finallyExpression (f)
+ { kind = K; }
+
+ TryStatement(Statement *stmt, Finally *f):
+ statement (stmt), catchExpression (0), finallyExpression (f)
+ { kind = K; }
+
+ TryStatement(Statement *stmt, Catch *c):
+ statement (stmt), catchExpression (c), finallyExpression (0)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return tryToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ {
+ if (finallyExpression)
+ return finallyExpression->statement->rbraceToken;
+ else if (catchExpression)
+ return catchExpression->statement->rbraceToken;
+
+ return statement->lastSourceLocation();
+ }
+
+// attributes
+ Statement *statement;
+ Catch *catchExpression;
+ Finally *finallyExpression;
+ SourceLocation tryToken;
+};
+
+class QML_PARSER_EXPORT FunctionExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(FunctionExpression)
+
+ FunctionExpression(NameId *n, FormalParameterList *f, FunctionBody *b):
+ name (n), formals (f), body (b)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return functionToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return rbraceToken; }
+
+// attributes
+ NameId *name;
+ FormalParameterList *formals;
+ FunctionBody *body;
+ SourceLocation functionToken;
+ SourceLocation identifierToken;
+ SourceLocation lparenToken;
+ SourceLocation rparenToken;
+ SourceLocation lbraceToken;
+ SourceLocation rbraceToken;
+};
+
+class QML_PARSER_EXPORT FunctionDeclaration: public FunctionExpression
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(FunctionDeclaration)
+
+ FunctionDeclaration(NameId *n, FormalParameterList *f, FunctionBody *b):
+ FunctionExpression(n, f, b)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+};
+
+class QML_PARSER_EXPORT FormalParameterList: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(FormalParameterList)
+
+ FormalParameterList(NameId *n):
+ name (n), next (this)
+ { kind = K; }
+
+ FormalParameterList(FormalParameterList *previous, NameId *n):
+ name (n)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+ inline FormalParameterList *finish ()
+ {
+ FormalParameterList *front = next;
+ next = 0;
+ return front;
+ }
+
+// attributes
+ NameId *name;
+ FormalParameterList *next;
+ SourceLocation commaToken;
+ SourceLocation identifierToken;
+};
+
+class QML_PARSER_EXPORT FunctionBody: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(FunctionBody)
+
+ FunctionBody(SourceElements *elts):
+ elements (elts)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ SourceElements *elements;
+};
+
+class QML_PARSER_EXPORT Program: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(Program)
+
+ Program(SourceElements *elts):
+ elements (elts)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ SourceElements *elements;
+};
+
+class QML_PARSER_EXPORT SourceElements: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(SourceElements)
+
+ SourceElements(SourceElement *elt):
+ element (elt), next (this)
+ { kind = K; }
+
+ SourceElements(SourceElements *previous, SourceElement *elt):
+ element (elt)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+ inline SourceElements *finish ()
+ {
+ SourceElements *front = next;
+ next = 0;
+ return front;
+ }
+
+// attributes
+ SourceElement *element;
+ SourceElements *next;
+};
+
+class QML_PARSER_EXPORT SourceElement: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(SourceElement)
+
+ inline SourceElement()
+ { kind = K; }
+};
+
+class QML_PARSER_EXPORT FunctionSourceElement: public SourceElement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(FunctionSourceElement)
+
+ FunctionSourceElement(FunctionDeclaration *f):
+ declaration (f)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ FunctionDeclaration *declaration;
+};
+
+class QML_PARSER_EXPORT StatementSourceElement: public SourceElement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(StatementSourceElement)
+
+ StatementSourceElement(Statement *stmt):
+ statement (stmt)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ Statement *statement;
+};
+
+class QML_PARSER_EXPORT DebuggerStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(DebuggerStatement)
+
+ DebuggerStatement()
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return debuggerToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return semicolonToken; }
+
+// attributes
+ SourceLocation debuggerToken;
+ SourceLocation semicolonToken;
+};
+
+class QML_PARSER_EXPORT UiProgram: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiProgram)
+
+ UiProgram(UiImportList *imports, UiObjectMemberList *members)
+ : imports(imports), members(members)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ UiImportList *imports;
+ UiObjectMemberList *members;
+};
+
+class QML_PARSER_EXPORT UiQualifiedId: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiQualifiedId)
+
+ UiQualifiedId(NameId *name)
+ : next(this), name(name)
+ { kind = K; }
+
+ UiQualifiedId(UiQualifiedId *previous, NameId *name)
+ : name(name)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ UiQualifiedId *finish()
+ {
+ UiQualifiedId *head = next;
+ next = 0;
+ return head;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ UiQualifiedId *next;
+ NameId *name;
+ SourceLocation identifierToken;
+};
+
+class QML_PARSER_EXPORT UiImport: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiImport)
+
+ UiImport(NameId *fileName)
+ : fileName(fileName), importUri(0), importId(0)
+ { kind = K; }
+
+ UiImport(UiQualifiedId *uri)
+ : fileName(0), importUri(uri), importId(0)
+ { kind = K; }
+
+ virtual SourceLocation firstSourceLocation() const
+ { return importToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return semicolonToken; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ NameId *fileName;
+ UiQualifiedId *importUri;
+ NameId *importId;
+ SourceLocation importToken;
+ SourceLocation fileNameToken;
+ SourceLocation versionToken;
+ SourceLocation asToken;
+ SourceLocation importIdToken;
+ SourceLocation semicolonToken;
+};
+
+class QML_PARSER_EXPORT UiImportList: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiImportList)
+
+ UiImportList(UiImport *import)
+ : import(import),
+ next(this)
+ { kind = K; }
+
+ UiImportList(UiImportList *previous, UiImport *import)
+ : import(import)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual SourceLocation firstSourceLocation() const
+ {
+ if (import) return import->firstSourceLocation();
+ else return SourceLocation();
+ }
+
+ virtual SourceLocation lastSourceLocation() const
+ {
+ for (const UiImportList *it = this; it; it = it->next)
+ if (!it->next && it->import)
+ return it->import->lastSourceLocation();
+
+ return SourceLocation();
+ }
+
+ UiImportList *finish()
+ {
+ UiImportList *head = next;
+ next = 0;
+ return head;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ UiImport *import;
+ UiImportList *next;
+};
+
+class QML_PARSER_EXPORT UiObjectMember: public Node
+{
+public:
+ virtual SourceLocation firstSourceLocation() const = 0;
+ virtual SourceLocation lastSourceLocation() const = 0;
+
+ virtual UiObjectMember *uiObjectMemberCast();
+};
+
+class QML_PARSER_EXPORT UiObjectMemberList: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiObjectMemberList)
+
+ UiObjectMemberList(UiObjectMember *member)
+ : next(this), member(member)
+ { kind = K; }
+
+ UiObjectMemberList(UiObjectMemberList *previous, UiObjectMember *member)
+ : member(member)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+ UiObjectMemberList *finish()
+ {
+ UiObjectMemberList *head = next;
+ next = 0;
+ return head;
+ }
+
+// attributes
+ UiObjectMemberList *next;
+ UiObjectMember *member;
+};
+
+class QML_PARSER_EXPORT UiArrayMemberList: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiArrayMemberList)
+
+ UiArrayMemberList(UiObjectMember *member)
+ : next(this), member(member)
+ { kind = K; }
+
+ UiArrayMemberList(UiArrayMemberList *previous, UiObjectMember *member)
+ : member(member)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+ UiArrayMemberList *finish()
+ {
+ UiArrayMemberList *head = next;
+ next = 0;
+ return head;
+ }
+
+// attributes
+ UiArrayMemberList *next;
+ UiObjectMember *member;
+ SourceLocation commaToken;
+};
+
+class QML_PARSER_EXPORT UiObjectInitializer: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiObjectInitializer)
+
+ UiObjectInitializer(UiObjectMemberList *members)
+ : members(members)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ SourceLocation lbraceToken;
+ UiObjectMemberList *members;
+ SourceLocation rbraceToken;
+};
+
+class QML_PARSER_EXPORT UiParameterList: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiParameterList)
+
+ UiParameterList(NameId *t, NameId *n):
+ type (t), name (n), next (this)
+ { kind = K; }
+
+ UiParameterList(UiParameterList *previous, NameId *t, NameId *n):
+ type (t), name (n)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual void accept0(Visitor *) {}
+
+ inline UiParameterList *finish ()
+ {
+ UiParameterList *front = next;
+ next = 0;
+ return front;
+ }
+
+// attributes
+ NameId *type;
+ NameId *name;
+ UiParameterList *next;
+ SourceLocation commaToken;
+ SourceLocation identifierToken;
+};
+
+class QML_PARSER_EXPORT UiPublicMember: public UiObjectMember
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiPublicMember)
+
+ UiPublicMember(NameId *memberType,
+ NameId *name)
+ : type(Property), typeModifier(0), memberType(memberType), name(name), expression(0), binding(0), isDefaultMember(false), isReadonlyMember(false), parameters(0)
+ { kind = K; }
+
+ UiPublicMember(NameId *memberType,
+ NameId *name,
+ ExpressionNode *expression)
+ : type(Property), typeModifier(0), memberType(memberType), name(name), expression(expression), binding(0), isDefaultMember(false), isReadonlyMember(false), parameters(0)
+ { kind = K; }
+
+ virtual SourceLocation firstSourceLocation() const
+ {
+ if (defaultToken.isValid())
+ return defaultToken;
+ else if (readonlyToken.isValid())
+ return readonlyToken;
+
+ return propertyToken;
+ }
+
+ virtual SourceLocation lastSourceLocation() const
+ {
+ if (binding)
+ return binding->lastSourceLocation();
+
+ return semicolonToken;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ enum { Signal, Property } type;
+ NameId *typeModifier;
+ NameId *memberType;
+ NameId *name;
+ ExpressionNode *expression; // initialized with a JS expression
+ UiObjectMember *binding; // initialized with a QML object or array.
+ bool isDefaultMember;
+ bool isReadonlyMember;
+ UiParameterList *parameters;
+ SourceLocation defaultToken;
+ SourceLocation readonlyToken;
+ SourceLocation propertyToken;
+ SourceLocation typeModifierToken;
+ SourceLocation typeToken;
+ SourceLocation identifierToken;
+ SourceLocation colonToken;
+ SourceLocation semicolonToken;
+};
+
+class QML_PARSER_EXPORT UiObjectDefinition: public UiObjectMember
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiObjectDefinition)
+
+ UiObjectDefinition(UiQualifiedId *qualifiedTypeNameId,
+ UiObjectInitializer *initializer)
+ : qualifiedTypeNameId(qualifiedTypeNameId), initializer(initializer)
+ { kind = K; }
+
+ virtual SourceLocation firstSourceLocation() const
+ { return qualifiedTypeNameId->identifierToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return initializer->rbraceToken; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ UiQualifiedId *qualifiedTypeNameId;
+ UiObjectInitializer *initializer;
+};
+
+class QML_PARSER_EXPORT UiSourceElement: public UiObjectMember
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiSourceElement)
+
+ UiSourceElement(Node *sourceElement)
+ : sourceElement(sourceElement)
+ { kind = K; }
+
+ virtual SourceLocation firstSourceLocation() const
+ {
+ if (FunctionDeclaration *funDecl = cast<FunctionDeclaration *>(sourceElement))
+ return funDecl->firstSourceLocation();
+ else if (VariableStatement *varStmt = cast<VariableStatement *>(sourceElement))
+ return varStmt->firstSourceLocation();
+
+ return SourceLocation();
+ }
+
+ virtual SourceLocation lastSourceLocation() const
+ {
+ if (FunctionDeclaration *funDecl = cast<FunctionDeclaration *>(sourceElement))
+ return funDecl->lastSourceLocation();
+ else if (VariableStatement *varStmt = cast<VariableStatement *>(sourceElement))
+ return varStmt->lastSourceLocation();
+
+ return SourceLocation();
+ }
+
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ Node *sourceElement;
+};
+
+class QML_PARSER_EXPORT UiObjectBinding: public UiObjectMember
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiObjectBinding)
+
+ UiObjectBinding(UiQualifiedId *qualifiedId,
+ UiQualifiedId *qualifiedTypeNameId,
+ UiObjectInitializer *initializer)
+ : qualifiedId(qualifiedId),
+ qualifiedTypeNameId(qualifiedTypeNameId),
+ initializer(initializer),
+ hasOnToken(false)
+ { kind = K; }
+
+ virtual SourceLocation firstSourceLocation() const
+ {
+ if (hasOnToken && qualifiedTypeNameId)
+ return qualifiedTypeNameId->identifierToken;
+
+ return qualifiedId->identifierToken;
+ }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return initializer->rbraceToken; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ UiQualifiedId *qualifiedId;
+ UiQualifiedId *qualifiedTypeNameId;
+ UiObjectInitializer *initializer;
+ SourceLocation colonToken;
+ bool hasOnToken;
+};
+
+class QML_PARSER_EXPORT UiScriptBinding: public UiObjectMember
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiScriptBinding)
+
+ UiScriptBinding(UiQualifiedId *qualifiedId,
+ Statement *statement)
+ : qualifiedId(qualifiedId),
+ statement(statement)
+ { kind = K; }
+
+ virtual SourceLocation firstSourceLocation() const
+ { return qualifiedId->identifierToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return statement->lastSourceLocation(); }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ UiQualifiedId *qualifiedId;
+ Statement *statement;
+ SourceLocation colonToken;
+};
+
+class QML_PARSER_EXPORT UiArrayBinding: public UiObjectMember
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiArrayBinding)
+
+ UiArrayBinding(UiQualifiedId *qualifiedId,
+ UiArrayMemberList *members)
+ : qualifiedId(qualifiedId),
+ members(members)
+ { kind = K; }
+
+ virtual SourceLocation firstSourceLocation() const
+ { return qualifiedId->identifierToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return rbracketToken; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ UiQualifiedId *qualifiedId;
+ UiArrayMemberList *members;
+ SourceLocation colonToken;
+ SourceLocation lbracketToken;
+ SourceLocation rbracketToken;
+};
+
+} } // namespace AST
+
+
+
+QT_QML_END_NAMESPACE
+
+#endif
diff --git a/tools/qdoc3/declarativeparser/qdeclarativejsastfwd_p.h b/tools/qdoc3/declarativeparser/qdeclarativejsastfwd_p.h
new file mode 100644
index 0000000..8a20ab2
--- /dev/null
+++ b/tools/qdoc3/declarativeparser/qdeclarativejsastfwd_p.h
@@ -0,0 +1,189 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative 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 QDECLARATIVEJSAST_FWD_P_H
+#define QDECLARATIVEJSAST_FWD_P_H
+
+#include "private/qdeclarativejsglobal_p.h"
+
+#include <QtCore/qglobal.h>
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+QT_QML_BEGIN_NAMESPACE
+
+namespace QDeclarativeJS { namespace AST {
+
+class SourceLocation
+{
+public:
+ SourceLocation(quint32 offset = 0, quint32 length = 0, quint32 line = 0, quint32 column = 0)
+ : offset(offset), length(length),
+ startLine(line), startColumn(column)
+ { }
+
+ bool isValid() const { return length != 0; }
+
+ quint32 begin() const { return offset; }
+ quint32 end() const { return offset + length; }
+
+// attributes
+ // ### encode
+ quint32 offset;
+ quint32 length;
+ quint32 startLine;
+ quint32 startColumn;
+};
+
+class Visitor;
+class Node;
+class ExpressionNode;
+class Statement;
+class ThisExpression;
+class IdentifierExpression;
+class NullExpression;
+class TrueLiteral;
+class FalseLiteral;
+class NumericLiteral;
+class StringLiteral;
+class RegExpLiteral;
+class ArrayLiteral;
+class ObjectLiteral;
+class ElementList;
+class Elision;
+class PropertyNameAndValueList;
+class PropertyName;
+class IdentifierPropertyName;
+class StringLiteralPropertyName;
+class NumericLiteralPropertyName;
+class ArrayMemberExpression;
+class FieldMemberExpression;
+class NewMemberExpression;
+class NewExpression;
+class CallExpression;
+class ArgumentList;
+class PostIncrementExpression;
+class PostDecrementExpression;
+class DeleteExpression;
+class VoidExpression;
+class TypeOfExpression;
+class PreIncrementExpression;
+class PreDecrementExpression;
+class UnaryPlusExpression;
+class UnaryMinusExpression;
+class TildeExpression;
+class NotExpression;
+class BinaryExpression;
+class ConditionalExpression;
+class Expression; // ### rename
+class Block;
+class StatementList;
+class VariableStatement;
+class VariableDeclarationList;
+class VariableDeclaration;
+class EmptyStatement;
+class ExpressionStatement;
+class IfStatement;
+class DoWhileStatement;
+class WhileStatement;
+class ForStatement;
+class LocalForStatement;
+class ForEachStatement;
+class LocalForEachStatement;
+class ContinueStatement;
+class BreakStatement;
+class ReturnStatement;
+class WithStatement;
+class SwitchStatement;
+class CaseBlock;
+class CaseClauses;
+class CaseClause;
+class DefaultClause;
+class LabelledStatement;
+class ThrowStatement;
+class TryStatement;
+class Catch;
+class Finally;
+class FunctionDeclaration;
+class FunctionExpression;
+class FormalParameterList;
+class FunctionBody;
+class Program;
+class SourceElements;
+class SourceElement;
+class FunctionSourceElement;
+class StatementSourceElement;
+class DebuggerStatement;
+class NestedExpression;
+
+// ui elements
+class UiProgram;
+class UiImportList;
+class UiImport;
+class UiPublicMember;
+class UiObjectDefinition;
+class UiObjectInitializer;
+class UiObjectBinding;
+class UiScriptBinding;
+class UiSourceElement;
+class UiArrayBinding;
+class UiObjectMember;
+class UiObjectMemberList;
+class UiArrayMemberList;
+class UiQualifiedId;
+class UiFormalList;
+class UiFormal;
+class UiSignature;
+
+} } // namespace AST
+
+QT_QML_END_NAMESPACE
+
+#endif
diff --git a/tools/qdoc3/declarativeparser/qdeclarativejsastvisitor.cpp b/tools/qdoc3/declarativeparser/qdeclarativejsastvisitor.cpp
new file mode 100644
index 0000000..8df755a
--- /dev/null
+++ b/tools/qdoc3/declarativeparser/qdeclarativejsastvisitor.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativejsastvisitor_p.h"
+
+QT_QML_BEGIN_NAMESPACE
+
+namespace QDeclarativeJS { namespace AST {
+
+Visitor::Visitor()
+{
+}
+
+Visitor::~Visitor()
+{
+}
+
+} } // namespace QDeclarativeJS::AST
+
+QT_QML_END_NAMESPACE
diff --git a/tools/qdoc3/declarativeparser/qdeclarativejsastvisitor_p.h b/tools/qdoc3/declarativeparser/qdeclarativejsastvisitor_p.h
new file mode 100644
index 0000000..519b8c8
--- /dev/null
+++ b/tools/qdoc3/declarativeparser/qdeclarativejsastvisitor_p.h
@@ -0,0 +1,335 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative 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 QDECLARATIVEJSASTVISITOR_P_H
+#define QDECLARATIVEJSASTVISITOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativejsastfwd_p.h"
+#include "private/qdeclarativejsglobal_p.h"
+
+QT_QML_BEGIN_NAMESPACE
+
+namespace QDeclarativeJS { namespace AST {
+
+class QML_PARSER_EXPORT Visitor
+{
+public:
+ Visitor();
+ virtual ~Visitor();
+
+ virtual bool preVisit(Node *) { return true; }
+ virtual void postVisit(Node *) {}
+
+ // Ui
+ virtual bool visit(UiProgram *) { return true; }
+ virtual bool visit(UiImportList *) { return true; }
+ virtual bool visit(UiImport *) { return true; }
+ virtual bool visit(UiPublicMember *) { return true; }
+ virtual bool visit(UiSourceElement *) { return true; }
+ virtual bool visit(UiObjectDefinition *) { return true; }
+ virtual bool visit(UiObjectInitializer *) { return true; }
+ virtual bool visit(UiObjectBinding *) { return true; }
+ virtual bool visit(UiScriptBinding *) { return true; }
+ virtual bool visit(UiArrayBinding *) { return true; }
+ virtual bool visit(UiObjectMemberList *) { return true; }
+ virtual bool visit(UiArrayMemberList *) { return true; }
+ virtual bool visit(UiQualifiedId *) { return true; }
+ virtual bool visit(UiSignature *) { return true; }
+ virtual bool visit(UiFormalList *) { return true; }
+ virtual bool visit(UiFormal *) { return true; }
+
+ virtual void endVisit(UiProgram *) {}
+ virtual void endVisit(UiImportList *) {}
+ virtual void endVisit(UiImport *) {}
+ virtual void endVisit(UiPublicMember *) {}
+ virtual void endVisit(UiSourceElement *) {}
+ virtual void endVisit(UiObjectDefinition *) {}
+ virtual void endVisit(UiObjectInitializer *) {}
+ virtual void endVisit(UiObjectBinding *) {}
+ virtual void endVisit(UiScriptBinding *) {}
+ virtual void endVisit(UiArrayBinding *) {}
+ virtual void endVisit(UiObjectMemberList *) {}
+ virtual void endVisit(UiArrayMemberList *) {}
+ virtual void endVisit(UiQualifiedId *) {}
+ virtual void endVisit(UiSignature *) {}
+ virtual void endVisit(UiFormalList *) {}
+ virtual void endVisit(UiFormal *) {}
+
+ // QDeclarativeJS
+ virtual bool visit(ThisExpression *) { return true; }
+ virtual void endVisit(ThisExpression *) {}
+
+ virtual bool visit(IdentifierExpression *) { return true; }
+ virtual void endVisit(IdentifierExpression *) {}
+
+ virtual bool visit(NullExpression *) { return true; }
+ virtual void endVisit(NullExpression *) {}
+
+ virtual bool visit(TrueLiteral *) { return true; }
+ virtual void endVisit(TrueLiteral *) {}
+
+ virtual bool visit(FalseLiteral *) { return true; }
+ virtual void endVisit(FalseLiteral *) {}
+
+ virtual bool visit(StringLiteral *) { return true; }
+ virtual void endVisit(StringLiteral *) {}
+
+ virtual bool visit(NumericLiteral *) { return true; }
+ virtual void endVisit(NumericLiteral *) {}
+
+ virtual bool visit(RegExpLiteral *) { return true; }
+ virtual void endVisit(RegExpLiteral *) {}
+
+ virtual bool visit(ArrayLiteral *) { return true; }
+ virtual void endVisit(ArrayLiteral *) {}
+
+ virtual bool visit(ObjectLiteral *) { return true; }
+ virtual void endVisit(ObjectLiteral *) {}
+
+ virtual bool visit(ElementList *) { return true; }
+ virtual void endVisit(ElementList *) {}
+
+ virtual bool visit(Elision *) { return true; }
+ virtual void endVisit(Elision *) {}
+
+ virtual bool visit(PropertyNameAndValueList *) { return true; }
+ virtual void endVisit(PropertyNameAndValueList *) {}
+
+ virtual bool visit(NestedExpression *) { return true; }
+ virtual void endVisit(NestedExpression *) {}
+
+ virtual bool visit(IdentifierPropertyName *) { return true; }
+ virtual void endVisit(IdentifierPropertyName *) {}
+
+ virtual bool visit(StringLiteralPropertyName *) { return true; }
+ virtual void endVisit(StringLiteralPropertyName *) {}
+
+ virtual bool visit(NumericLiteralPropertyName *) { return true; }
+ virtual void endVisit(NumericLiteralPropertyName *) {}
+
+ virtual bool visit(ArrayMemberExpression *) { return true; }
+ virtual void endVisit(ArrayMemberExpression *) {}
+
+ virtual bool visit(FieldMemberExpression *) { return true; }
+ virtual void endVisit(FieldMemberExpression *) {}
+
+ virtual bool visit(NewMemberExpression *) { return true; }
+ virtual void endVisit(NewMemberExpression *) {}
+
+ virtual bool visit(NewExpression *) { return true; }
+ virtual void endVisit(NewExpression *) {}
+
+ virtual bool visit(CallExpression *) { return true; }
+ virtual void endVisit(CallExpression *) {}
+
+ virtual bool visit(ArgumentList *) { return true; }
+ virtual void endVisit(ArgumentList *) {}
+
+ virtual bool visit(PostIncrementExpression *) { return true; }
+ virtual void endVisit(PostIncrementExpression *) {}
+
+ virtual bool visit(PostDecrementExpression *) { return true; }
+ virtual void endVisit(PostDecrementExpression *) {}
+
+ virtual bool visit(DeleteExpression *) { return true; }
+ virtual void endVisit(DeleteExpression *) {}
+
+ virtual bool visit(VoidExpression *) { return true; }
+ virtual void endVisit(VoidExpression *) {}
+
+ virtual bool visit(TypeOfExpression *) { return true; }
+ virtual void endVisit(TypeOfExpression *) {}
+
+ virtual bool visit(PreIncrementExpression *) { return true; }
+ virtual void endVisit(PreIncrementExpression *) {}
+
+ virtual bool visit(PreDecrementExpression *) { return true; }
+ virtual void endVisit(PreDecrementExpression *) {}
+
+ virtual bool visit(UnaryPlusExpression *) { return true; }
+ virtual void endVisit(UnaryPlusExpression *) {}
+
+ virtual bool visit(UnaryMinusExpression *) { return true; }
+ virtual void endVisit(UnaryMinusExpression *) {}
+
+ virtual bool visit(TildeExpression *) { return true; }
+ virtual void endVisit(TildeExpression *) {}
+
+ virtual bool visit(NotExpression *) { return true; }
+ virtual void endVisit(NotExpression *) {}
+
+ virtual bool visit(BinaryExpression *) { return true; }
+ virtual void endVisit(BinaryExpression *) {}
+
+ virtual bool visit(ConditionalExpression *) { return true; }
+ virtual void endVisit(ConditionalExpression *) {}
+
+ virtual bool visit(Expression *) { return true; }
+ virtual void endVisit(Expression *) {}
+
+ virtual bool visit(Block *) { return true; }
+ virtual void endVisit(Block *) {}
+
+ virtual bool visit(StatementList *) { return true; }
+ virtual void endVisit(StatementList *) {}
+
+ virtual bool visit(VariableStatement *) { return true; }
+ virtual void endVisit(VariableStatement *) {}
+
+ virtual bool visit(VariableDeclarationList *) { return true; }
+ virtual void endVisit(VariableDeclarationList *) {}
+
+ virtual bool visit(VariableDeclaration *) { return true; }
+ virtual void endVisit(VariableDeclaration *) {}
+
+ virtual bool visit(EmptyStatement *) { return true; }
+ virtual void endVisit(EmptyStatement *) {}
+
+ virtual bool visit(ExpressionStatement *) { return true; }
+ virtual void endVisit(ExpressionStatement *) {}
+
+ virtual bool visit(IfStatement *) { return true; }
+ virtual void endVisit(IfStatement *) {}
+
+ virtual bool visit(DoWhileStatement *) { return true; }
+ virtual void endVisit(DoWhileStatement *) {}
+
+ virtual bool visit(WhileStatement *) { return true; }
+ virtual void endVisit(WhileStatement *) {}
+
+ virtual bool visit(ForStatement *) { return true; }
+ virtual void endVisit(ForStatement *) {}
+
+ virtual bool visit(LocalForStatement *) { return true; }
+ virtual void endVisit(LocalForStatement *) {}
+
+ virtual bool visit(ForEachStatement *) { return true; }
+ virtual void endVisit(ForEachStatement *) {}
+
+ virtual bool visit(LocalForEachStatement *) { return true; }
+ virtual void endVisit(LocalForEachStatement *) {}
+
+ virtual bool visit(ContinueStatement *) { return true; }
+ virtual void endVisit(ContinueStatement *) {}
+
+ virtual bool visit(BreakStatement *) { return true; }
+ virtual void endVisit(BreakStatement *) {}
+
+ virtual bool visit(ReturnStatement *) { return true; }
+ virtual void endVisit(ReturnStatement *) {}
+
+ virtual bool visit(WithStatement *) { return true; }
+ virtual void endVisit(WithStatement *) {}
+
+ virtual bool visit(SwitchStatement *) { return true; }
+ virtual void endVisit(SwitchStatement *) {}
+
+ virtual bool visit(CaseBlock *) { return true; }
+ virtual void endVisit(CaseBlock *) {}
+
+ virtual bool visit(CaseClauses *) { return true; }
+ virtual void endVisit(CaseClauses *) {}
+
+ virtual bool visit(CaseClause *) { return true; }
+ virtual void endVisit(CaseClause *) {}
+
+ virtual bool visit(DefaultClause *) { return true; }
+ virtual void endVisit(DefaultClause *) {}
+
+ virtual bool visit(LabelledStatement *) { return true; }
+ virtual void endVisit(LabelledStatement *) {}
+
+ virtual bool visit(ThrowStatement *) { return true; }
+ virtual void endVisit(ThrowStatement *) {}
+
+ virtual bool visit(TryStatement *) { return true; }
+ virtual void endVisit(TryStatement *) {}
+
+ virtual bool visit(Catch *) { return true; }
+ virtual void endVisit(Catch *) {}
+
+ virtual bool visit(Finally *) { return true; }
+ virtual void endVisit(Finally *) {}
+
+ virtual bool visit(FunctionDeclaration *) { return true; }
+ virtual void endVisit(FunctionDeclaration *) {}
+
+ virtual bool visit(FunctionExpression *) { return true; }
+ virtual void endVisit(FunctionExpression *) {}
+
+ virtual bool visit(FormalParameterList *) { return true; }
+ virtual void endVisit(FormalParameterList *) {}
+
+ virtual bool visit(FunctionBody *) { return true; }
+ virtual void endVisit(FunctionBody *) {}
+
+ virtual bool visit(Program *) { return true; }
+ virtual void endVisit(Program *) {}
+
+ virtual bool visit(SourceElements *) { return true; }
+ virtual void endVisit(SourceElements *) {}
+
+ virtual bool visit(FunctionSourceElement *) { return true; }
+ virtual void endVisit(FunctionSourceElement *) {}
+
+ virtual bool visit(StatementSourceElement *) { return true; }
+ virtual void endVisit(StatementSourceElement *) {}
+
+ virtual bool visit(DebuggerStatement *) { return true; }
+ virtual void endVisit(DebuggerStatement *) {}
+};
+
+} } // namespace AST
+
+QT_QML_END_NAMESPACE
+
+#endif // QDECLARATIVEJSASTVISITOR_P_H
diff --git a/tools/qdoc3/declarativeparser/qdeclarativejsengine_p.cpp b/tools/qdoc3/declarativeparser/qdeclarativejsengine_p.cpp
new file mode 100644
index 0000000..ec9271a
--- /dev/null
+++ b/tools/qdoc3/declarativeparser/qdeclarativejsengine_p.cpp
@@ -0,0 +1,212 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativejsengine_p.h"
+
+#include "private/qdeclarativejsglobal_p.h"
+#include "private/qdeclarativejsnodepool_p.h"
+
+#include <qnumeric.h>
+#include <QHash>
+
+QT_QML_BEGIN_NAMESPACE
+
+namespace QDeclarativeJS {
+
+uint qHash(const QDeclarativeJS::NameId &id)
+{ return qHash(id.asString()); }
+
+QString numberToString(double value)
+{ return QString::number(value); }
+
+int Ecma::RegExp::flagFromChar(const QChar &ch)
+{
+ static QHash<QChar, int> flagsHash;
+ if (flagsHash.isEmpty()) {
+ flagsHash[QLatin1Char('g')] = Global;
+ flagsHash[QLatin1Char('i')] = IgnoreCase;
+ flagsHash[QLatin1Char('m')] = Multiline;
+ }
+ QHash<QChar, int>::const_iterator it;
+ it = flagsHash.constFind(ch);
+ if (it == flagsHash.constEnd())
+ return 0;
+ return it.value();
+}
+
+QString Ecma::RegExp::flagsToString(int flags)
+{
+ QString result;
+ if (flags & Global)
+ result += QLatin1Char('g');
+ if (flags & IgnoreCase)
+ result += QLatin1Char('i');
+ if (flags & Multiline)
+ result += QLatin1Char('m');
+ return result;
+}
+
+NodePool::NodePool(const QString &fileName, Engine *engine)
+ : m_fileName(fileName), m_engine(engine)
+{
+ m_engine->setNodePool(this);
+}
+
+NodePool::~NodePool()
+{
+}
+
+Code *NodePool::createCompiledCode(AST::Node *, CompilationUnit &)
+{
+ Q_ASSERT(0);
+ return 0;
+}
+
+static int toDigit(char c)
+{
+ if ((c >= '0') && (c <= '9'))
+ return c - '0';
+ else if ((c >= 'a') && (c <= 'z'))
+ return 10 + c - 'a';
+ else if ((c >= 'A') && (c <= 'Z'))
+ return 10 + c - 'A';
+ return -1;
+}
+
+double integerFromString(const char *buf, int size, int radix)
+{
+ if (size == 0)
+ return qSNaN();
+
+ double sign = 1.0;
+ int i = 0;
+ if (buf[0] == '+') {
+ ++i;
+ } else if (buf[0] == '-') {
+ sign = -1.0;
+ ++i;
+ }
+
+ if (((size-i) >= 2) && (buf[i] == '0')) {
+ if (((buf[i+1] == 'x') || (buf[i+1] == 'X'))
+ && (radix < 34)) {
+ if ((radix != 0) && (radix != 16))
+ return 0;
+ radix = 16;
+ i += 2;
+ } else {
+ if (radix == 0) {
+ radix = 8;
+ ++i;
+ }
+ }
+ } else if (radix == 0) {
+ radix = 10;
+ }
+
+ int j = i;
+ for ( ; i < size; ++i) {
+ int d = toDigit(buf[i]);
+ if ((d == -1) || (d >= radix))
+ break;
+ }
+ double result;
+ if (j == i) {
+ if (!qstrcmp(buf, "Infinity"))
+ result = qInf();
+ else
+ result = qSNaN();
+ } else {
+ result = 0;
+ double multiplier = 1;
+ for (--i ; i >= j; --i, multiplier *= radix)
+ result += toDigit(buf[i]) * multiplier;
+ }
+ result *= sign;
+ return result;
+}
+
+double integerFromString(const QString &str, int radix)
+{
+ QByteArray ba = str.trimmed().toLatin1();
+ return integerFromString(ba.constData(), ba.size(), radix);
+}
+
+
+Engine::Engine()
+ : _lexer(0), _nodePool(0)
+{ }
+
+Engine::~Engine()
+{ }
+
+QSet<NameId> Engine::literals() const
+{ return _literals; }
+
+void Engine::addComment(int pos, int len, int line, int col)
+{ if (len > 0) _comments.append(QDeclarativeJS::AST::SourceLocation(pos, len, line, col)); }
+
+QList<QDeclarativeJS::AST::SourceLocation> Engine::comments() const
+{ return _comments; }
+
+NameId *Engine::intern(const QChar *u, int s)
+{ return const_cast<NameId *>(&*_literals.insert(NameId(u, s))); }
+
+QString Engine::toString(NameId *id)
+{ return id->asString(); }
+
+Lexer *Engine::lexer() const
+{ return _lexer; }
+
+void Engine::setLexer(Lexer *lexer)
+{ _lexer = lexer; }
+
+NodePool *Engine::nodePool() const
+{ return _nodePool; }
+
+void Engine::setNodePool(NodePool *nodePool)
+{ _nodePool = nodePool; }
+
+
+
+} // end of namespace QDeclarativeJS
+
+QT_QML_END_NAMESPACE
diff --git a/tools/qdoc3/declarativeparser/qdeclarativejsengine_p.h b/tools/qdoc3/declarativeparser/qdeclarativejsengine_p.h
new file mode 100644
index 0000000..6c18b50
--- /dev/null
+++ b/tools/qdoc3/declarativeparser/qdeclarativejsengine_p.h
@@ -0,0 +1,173 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative 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 QDECLARATIVEJSENGINE_P_H
+#define QDECLARATIVEJSENGINE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativejsglobal_p.h"
+#include "private/qdeclarativejsastfwd_p.h"
+
+#include <QString>
+#include <QSet>
+
+QT_QML_BEGIN_NAMESPACE
+
+namespace QDeclarativeJS {
+class QML_PARSER_EXPORT NameId
+{
+ QString _text;
+
+public:
+ NameId(const QChar *u, int s)
+ : _text(u, s)
+ { }
+
+ const QString asString() const
+ { return _text; }
+
+ bool operator == (const NameId &other) const
+ { return _text == other._text; }
+
+ bool operator != (const NameId &other) const
+ { return _text != other._text; }
+
+ bool operator < (const NameId &other) const
+ { return _text < other._text; }
+};
+
+uint qHash(const QDeclarativeJS::NameId &id);
+
+} // end of namespace QDeclarativeJS
+
+#if defined(Q_CC_MSVC) && _MSC_VER <= 1300
+//this ensures that code outside QDeclarativeJS can use the hash function
+//it also a workaround for some compilers
+inline uint qHash(const QDeclarativeJS::NameId &nameId) { return QDeclarativeJS::qHash(nameId); }
+#endif
+
+namespace QDeclarativeJS {
+
+class Lexer;
+class NodePool;
+
+namespace Ecma {
+
+class QML_PARSER_EXPORT RegExp
+{
+public:
+ enum RegExpFlag {
+ Global = 0x01,
+ IgnoreCase = 0x02,
+ Multiline = 0x04
+ };
+
+public:
+ static int flagFromChar(const QChar &);
+ static QString flagsToString(int flags);
+};
+
+} // end of namespace Ecma
+
+class QML_PARSER_EXPORT DiagnosticMessage
+{
+public:
+ enum Kind { Warning, Error };
+
+ DiagnosticMessage()
+ : kind(Error) {}
+
+ DiagnosticMessage(Kind kind, const AST::SourceLocation &loc, const QString &message)
+ : kind(kind), loc(loc), message(message) {}
+
+ bool isWarning() const
+ { return kind == Warning; }
+
+ bool isError() const
+ { return kind == Error; }
+
+ Kind kind;
+ AST::SourceLocation loc;
+ QString message;
+};
+
+class QML_PARSER_EXPORT Engine
+{
+ Lexer *_lexer;
+ NodePool *_nodePool;
+ QSet<NameId> _literals;
+ QList<QDeclarativeJS::AST::SourceLocation> _comments;
+
+public:
+ Engine();
+ ~Engine();
+
+ QSet<NameId> literals() const;
+
+ void addComment(int pos, int len, int line, int col);
+ QList<QDeclarativeJS::AST::SourceLocation> comments() const;
+
+ NameId *intern(const QChar *u, int s);
+
+ static QString toString(NameId *id);
+
+ Lexer *lexer() const;
+ void setLexer(Lexer *lexer);
+
+ NodePool *nodePool() const;
+ void setNodePool(NodePool *nodePool);
+};
+
+} // end of namespace QDeclarativeJS
+
+QT_QML_END_NAMESPACE
+
+#endif // QDECLARATIVEJSENGINE_P_H
diff --git a/tools/qdoc3/declarativeparser/qdeclarativejsglobal_p.h b/tools/qdoc3/declarativeparser/qdeclarativejsglobal_p.h
new file mode 100644
index 0000000..776937c
--- /dev/null
+++ b/tools/qdoc3/declarativeparser/qdeclarativejsglobal_p.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative 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 QDECLARATIVEJSGLOBAL_P_H
+#define QDECLARATIVEJSGLOBAL_P_H
+
+#include <QtCore/qglobal.h>
+
+#ifdef QT_CREATOR
+# define QT_QML_BEGIN_NAMESPACE
+# define QT_QML_END_NAMESPACE
+
+# ifdef QDECLARATIVEJS_BUILD_DIR
+# define QML_PARSER_EXPORT Q_DECL_EXPORT
+# elif QML_BUILD_STATIC_LIB
+# define QML_PARSER_EXPORT
+# else
+# define QML_PARSER_EXPORT Q_DECL_IMPORT
+# endif // QDECLARATIVEJS_BUILD_DIR
+
+#else // !QT_CREATOR
+# define QT_QML_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
+# define QT_QML_END_NAMESPACE QT_END_NAMESPACE
+# define QML_PARSER_EXPORT
+#endif // QT_CREATOR
+
+#endif // QDECLARATIVEJSGLOBAL_P_H
diff --git a/tools/qdoc3/declarativeparser/qdeclarativejsgrammar.cpp b/tools/qdoc3/declarativeparser/qdeclarativejsgrammar.cpp
new file mode 100644
index 0000000..ea19e1c
--- /dev/null
+++ b/tools/qdoc3/declarativeparser/qdeclarativejsgrammar.cpp
@@ -0,0 +1,989 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore 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$
+**
+****************************************************************************/
+
+// This file was generated by qlalr - DO NOT EDIT!
+#include "qdeclarativejsgrammar_p.h"
+
+QT_BEGIN_NAMESPACE
+
+const char *const QDeclarativeJSGrammar::spell [] = {
+ "end of file", "&", "&&", "&=", "break", "case", "catch", ":", ";", "continue",
+ "default", "delete", "/", "/=", "do", ".", "else", "=", "==", "===",
+ "finally", "for", "function", ">=", ">", ">>", ">>=", ">>>", ">>>=", "identifier",
+ "if", "in", "instanceof", "{", "[", "<=", "(", "<", "<<", "<<=",
+ "-", "-=", "--", "new", "!", "!=", "!==", "numeric literal", "|", "|=",
+ "||", "+", "+=", "++", "?", "}", "]", "%", "%=", "return",
+ ")", ";", 0, "*", "*=", "string literal", "property", "signal", "readonly", "switch",
+ "this", "throw", "~", "try", "typeof", "var", "void", "while", "with", "^",
+ "^=", "null", "true", "false", "const", "debugger", "reserved word", "multiline string literal", "comment", "public",
+ "import", "as", "on", 0, 0, 0, 0, 0, 0, 0,
+ 0};
+
+const short QDeclarativeJSGrammar::lhs [] = {
+ 101, 101, 101, 101, 101, 101, 102, 108, 108, 111,
+ 111, 113, 112, 112, 112, 112, 112, 112, 112, 112,
+ 115, 110, 109, 118, 118, 119, 119, 120, 120, 117,
+ 106, 106, 106, 106, 106, 106, 106, 106, 126, 126,
+ 126, 127, 127, 128, 128, 106, 106, 106, 106, 106,
+ 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
+ 106, 106, 106, 106, 106, 116, 116, 116, 116, 116,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 121, 133,
+ 133, 133, 133, 132, 132, 135, 135, 137, 137, 137,
+ 137, 137, 137, 138, 138, 138, 138, 138, 138, 138,
+ 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
+ 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
+ 138, 138, 138, 138, 139, 139, 114, 114, 114, 114,
+ 114, 142, 142, 143, 143, 143, 143, 141, 141, 144,
+ 144, 145, 145, 146, 146, 146, 147, 147, 147, 147,
+ 147, 147, 147, 147, 147, 147, 148, 148, 148, 148,
+ 149, 149, 149, 150, 150, 150, 150, 151, 151, 151,
+ 151, 151, 151, 151, 152, 152, 152, 152, 152, 152,
+ 153, 153, 153, 153, 153, 154, 154, 154, 154, 154,
+ 155, 155, 156, 156, 157, 157, 158, 158, 159, 159,
+ 160, 160, 161, 161, 162, 162, 163, 163, 164, 164,
+ 165, 165, 166, 166, 136, 136, 167, 167, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 104, 104, 169, 169, 170, 170, 171, 171, 103, 103,
+ 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
+ 103, 103, 103, 122, 183, 183, 182, 182, 130, 130,
+ 184, 184, 185, 185, 187, 187, 186, 188, 191, 189,
+ 189, 192, 190, 190, 123, 124, 124, 125, 125, 172,
+ 172, 172, 172, 172, 172, 172, 173, 173, 173, 173,
+ 174, 174, 174, 174, 175, 175, 176, 178, 193, 193,
+ 196, 196, 194, 194, 197, 195, 177, 177, 177, 179,
+ 179, 180, 180, 180, 198, 199, 181, 181, 129, 140,
+ 203, 203, 200, 200, 201, 201, 204, 107, 205, 205,
+ 105, 105, 202, 202, 134, 134, 206};
+
+const short QDeclarativeJSGrammar::rhs [] = {
+ 2, 2, 2, 2, 2, 2, 2, 1, 1, 1,
+ 2, 1, 2, 2, 3, 3, 5, 5, 4, 4,
+ 2, 0, 1, 1, 2, 1, 3, 2, 3, 2,
+ 1, 5, 4, 4, 3, 3, 3, 3, 1, 1,
+ 1, 0, 1, 2, 4, 6, 6, 3, 3, 7,
+ 7, 4, 4, 5, 5, 6, 6, 7, 7, 7,
+ 7, 10, 6, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 2, 3, 3, 4, 5, 3, 4, 3, 1, 1,
+ 2, 3, 4, 1, 2, 3, 5, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 4, 3,
+ 5, 1, 2, 4, 4, 4, 3, 0, 1, 1,
+ 3, 1, 1, 1, 2, 2, 1, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 1, 3, 3, 3,
+ 1, 3, 3, 1, 3, 3, 3, 1, 3, 3,
+ 3, 3, 3, 3, 1, 3, 3, 3, 3, 3,
+ 1, 3, 3, 3, 3, 1, 3, 3, 3, 3,
+ 1, 3, 1, 3, 1, 3, 1, 3, 1, 3,
+ 1, 3, 1, 3, 1, 3, 1, 3, 1, 3,
+ 1, 5, 1, 5, 1, 3, 1, 3, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 3, 0, 1, 1, 3, 0, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 3, 1, 2, 0, 1, 3, 3,
+ 1, 1, 1, 3, 1, 3, 2, 2, 2, 0,
+ 1, 2, 0, 1, 1, 2, 2, 7, 5, 7,
+ 7, 5, 9, 10, 7, 8, 2, 2, 3, 3,
+ 2, 2, 3, 3, 3, 3, 5, 5, 3, 5,
+ 1, 2, 0, 1, 4, 3, 3, 3, 3, 3,
+ 3, 3, 3, 4, 5, 2, 2, 2, 8, 8,
+ 1, 3, 0, 1, 0, 1, 1, 1, 1, 2,
+ 1, 1, 0, 1, 0, 1, 2};
+
+const short QDeclarativeJSGrammar::action_default [] = {
+ 0, 0, 0, 0, 0, 0, 22, 0, 174, 241,
+ 205, 213, 209, 153, 225, 201, 3, 138, 72, 154,
+ 217, 221, 142, 171, 152, 157, 137, 191, 178, 0,
+ 79, 80, 75, 343, 66, 345, 0, 0, 0, 0,
+ 77, 0, 0, 73, 76, 70, 0, 0, 67, 69,
+ 68, 78, 71, 0, 74, 0, 0, 167, 0, 0,
+ 154, 173, 156, 155, 0, 0, 0, 169, 170, 168,
+ 172, 0, 202, 0, 0, 0, 0, 192, 0, 0,
+ 0, 0, 0, 0, 182, 0, 0, 0, 176, 177,
+ 175, 180, 184, 183, 181, 179, 194, 193, 195, 0,
+ 210, 0, 206, 0, 0, 148, 135, 147, 136, 104,
+ 105, 106, 131, 107, 132, 108, 109, 110, 111, 112,
+ 113, 114, 115, 116, 117, 118, 119, 120, 133, 121,
+ 122, 123, 124, 125, 126, 127, 128, 129, 130, 134,
+ 0, 0, 146, 242, 149, 0, 150, 0, 151, 145,
+ 0, 238, 231, 229, 236, 237, 235, 234, 240, 233,
+ 232, 230, 239, 226, 0, 214, 0, 0, 218, 0,
+ 0, 222, 0, 0, 148, 140, 0, 139, 0, 144,
+ 158, 0, 344, 333, 334, 0, 331, 0, 332, 0,
+ 335, 249, 256, 255, 263, 251, 0, 252, 336, 0,
+ 342, 253, 254, 259, 257, 339, 337, 341, 260, 0,
+ 271, 0, 0, 0, 0, 343, 66, 0, 345, 67,
+ 243, 285, 68, 0, 0, 0, 272, 0, 0, 261,
+ 262, 0, 250, 258, 286, 287, 330, 340, 0, 301,
+ 302, 303, 304, 0, 297, 298, 299, 300, 327, 328,
+ 0, 0, 0, 0, 0, 290, 291, 247, 245, 207,
+ 215, 211, 227, 203, 248, 0, 154, 219, 223, 196,
+ 185, 0, 0, 204, 0, 0, 0, 0, 197, 0,
+ 0, 0, 0, 0, 189, 187, 190, 188, 186, 199,
+ 198, 200, 0, 212, 0, 208, 0, 246, 154, 0,
+ 228, 243, 244, 0, 243, 0, 0, 293, 0, 0,
+ 0, 295, 0, 216, 0, 0, 220, 0, 0, 224,
+ 283, 0, 275, 284, 278, 0, 282, 0, 243, 276,
+ 0, 243, 0, 0, 294, 0, 0, 0, 296, 344,
+ 333, 0, 0, 335, 0, 329, 0, 319, 0, 0,
+ 0, 289, 0, 288, 0, 346, 0, 103, 265, 268,
+ 0, 104, 271, 107, 132, 109, 110, 75, 114, 115,
+ 66, 116, 119, 73, 76, 67, 243, 68, 78, 122,
+ 71, 124, 74, 126, 127, 272, 129, 130, 134, 0,
+ 96, 0, 0, 98, 102, 100, 87, 99, 101, 0,
+ 97, 86, 266, 264, 142, 143, 148, 0, 141, 0,
+ 318, 0, 305, 306, 0, 317, 0, 0, 0, 308,
+ 313, 311, 314, 0, 0, 312, 313, 0, 309, 0,
+ 310, 267, 316, 0, 267, 315, 0, 320, 321, 0,
+ 267, 322, 323, 0, 0, 324, 0, 0, 0, 325,
+ 326, 160, 159, 0, 0, 0, 292, 0, 0, 0,
+ 307, 280, 273, 0, 281, 277, 0, 279, 269, 0,
+ 270, 274, 90, 0, 0, 94, 81, 0, 83, 92,
+ 0, 84, 93, 95, 85, 91, 82, 0, 88, 164,
+ 162, 166, 163, 161, 165, 6, 338, 4, 2, 64,
+ 89, 0, 0, 67, 69, 68, 31, 5, 0, 65,
+ 0, 41, 40, 39, 0, 0, 54, 0, 55, 0,
+ 60, 61, 0, 41, 0, 0, 0, 0, 0, 50,
+ 0, 51, 0, 0, 26, 0, 0, 62, 27, 0,
+ 30, 28, 24, 0, 29, 25, 0, 52, 0, 53,
+ 0, 142, 0, 56, 57, 63, 0, 0, 0, 0,
+ 0, 58, 59, 0, 48, 42, 49, 43, 0, 0,
+ 0, 0, 45, 0, 46, 47, 44, 0, 0, 35,
+ 36, 37, 38, 142, 267, 0, 0, 104, 271, 107,
+ 132, 109, 110, 75, 114, 115, 66, 116, 119, 73,
+ 76, 67, 243, 68, 78, 122, 71, 124, 74, 126,
+ 127, 272, 129, 130, 134, 0, 32, 33, 0, 34,
+ 8, 0, 10, 0, 9, 0, 1, 21, 12, 0,
+ 13, 0, 14, 0, 19, 20, 0, 15, 16, 0,
+ 17, 18, 11, 23, 7, 347};
+
+const short QDeclarativeJSGrammar::goto_default [] = {
+ 7, 626, 207, 196, 205, 507, 495, 625, 644, 620,
+ 624, 622, 627, 22, 623, 18, 506, 543, 533, 540,
+ 535, 191, 195, 197, 201, 524, 568, 567, 200, 232,
+ 26, 474, 473, 356, 355, 9, 354, 357, 107, 17,
+ 145, 24, 13, 144, 19, 25, 57, 23, 8, 28,
+ 27, 269, 15, 263, 10, 259, 12, 261, 11, 260,
+ 20, 267, 21, 268, 14, 262, 258, 299, 411, 264,
+ 265, 202, 193, 192, 204, 233, 203, 208, 229, 230,
+ 194, 360, 359, 231, 463, 462, 321, 322, 465, 324,
+ 464, 323, 419, 423, 426, 422, 421, 441, 442, 185,
+ 199, 181, 184, 198, 206, 0};
+
+const short QDeclarativeJSGrammar::action_index [] = {
+ 421, 1288, 2322, 2322, 2419, 1016, -52, 37, 140, -101,
+ 35, -13, -40, 190, -101, 272, 34, -101, -101, 658,
+ 42, 103, 194, 201, -101, -101, -101, 439, 256, 1288,
+ -101, -101, -101, 282, -101, 2128, 1751, 1288, 1288, 1288,
+ -101, 917, 1288, -101, -101, -101, 1288, 1288, -101, -101,
+ -101, -101, -101, 1288, -101, 1288, 1288, -101, 1288, 1288,
+ 109, 245, -101, -101, 1288, 1288, 1288, -101, -101, -101,
+ 185, 1288, 295, 1288, 1288, 1288, 1288, 461, 1288, 1288,
+ 1288, 1288, 1288, 1288, 256, 1288, 1288, 1288, 155, 119,
+ 114, 176, 256, 332, 202, 332, 560, 560, 471, 1288,
+ -23, 1288, 53, 2031, 1288, 1288, -101, -101, -101, -101,
+ -101, -101, -101, -101, -101, -101, -101, -101, -101, -101,
+ -101, -101, -101, -101, -101, -101, -101, -101, -101, -101,
+ -101, -101, -101, -101, -101, -101, -101, -101, -101, -101,
+ 100, 1288, -101, -101, 70, 59, -101, 1288, -101, -101,
+ 1288, -101, -101, -101, -101, -101, -101, -101, -101, -101,
+ -101, -101, -101, -101, 1288, 41, 1288, 1288, 98, 91,
+ 1288, -101, 2031, 1288, 1288, -101, 121, -101, 73, -101,
+ -101, 39, -101, 385, 180, 78, -101, 391, -101, 64,
+ 2322, -101, -101, -101, -101, -101, 208, -101, -101, 82,
+ -101, -101, -101, -101, -101, -101, 2322, -101, -101, 538,
+ -101, 495, 128, 2419, 54, 358, 62, 44, 2613, 67,
+ 1288, -101, 76, 63, 1288, 58, -101, 60, 46, -101,
+ -101, 309, -101, -101, -101, -101, -101, -101, 86, -101,
+ -101, -101, -101, 107, -101, -101, -101, -101, -101, -101,
+ 28, 52, 1288, 101, 102, -101, -101, 1472, -101, 83,
+ 75, 79, -101, 287, 84, 80, 585, 69, 89, 321,
+ 177, 482, 1288, 297, 1288, 1288, 1288, 1288, 331, 1288,
+ 1288, 1288, 1288, 1288, 332, 222, 332, 332, 332, 410,
+ 410, 410, 1288, 57, 1288, 72, 1288, -101, 658, 1288,
+ -101, 1288, 71, 45, 1288, 61, 2419, -101, 1288, 132,
+ 2419, -101, 1288, 47, 1288, 1288, 66, 65, 1288, -101,
+ 68, 112, 81, -101, -101, 1288, -101, 369, 1288, -101,
+ 85, 1288, 74, 2419, -101, 1288, 122, 2419, -101, 77,
+ 294, 16, -29, 2322, -53, -101, 2419, -101, 1288, 127,
+ 2419, -15, 2419, -101, 10, 11, -34, -101, -101, 2419,
+ -48, 504, 4, 476, 113, 1288, 2419, 2, -28, 420,
+ 6, -21, 719, 7, 87, -101, 1382, -101, -4, -16,
+ 5, 1288, 3, -27, 1288, 9, 1288, -18, -31, 1288,
+ -101, 2225, -7, -101, -101, -101, -101, -101, -101, 1288,
+ -101, -101, -101, -101, 246, -101, 1288, -38, -101, 2419,
+ -101, 88, -101, -101, 2419, -101, 1288, 106, 26, -101,
+ 55, -101, 50, 105, 1288, -101, 48, 38, -101, -8,
+ -101, 2419, -101, 94, 2419, -101, 238, -101, -101, 104,
+ 2419, 31, -101, 21, 19, -101, 305, 1, 30, -101,
+ -101, -101, -101, 1288, 136, 2419, -101, 1288, 134, 2419,
+ -101, 49, -101, 173, -101, -101, 1288, -101, -101, 363,
+ -101, -101, -101, 137, 1565, -101, -101, 1658, -101, -101,
+ 1844, -101, -101, -101, -101, -101, -101, 95, -101, -101,
+ -101, -101, -101, -101, -101, -101, 2322, -101, -101, -101,
+ 92, 15, 925, 169, 27, -6, -101, -101, 212, -101,
+ 191, -101, -101, -101, 323, 211, -101, 1288, -101, 214,
+ -101, -101, 216, 40, 317, 210, 43, 259, 236, -101,
+ 36, -101, 747, 96, -101, 29, 747, -101, -101, 1198,
+ -101, -101, -101, 1107, -101, -101, 231, -101, 1288, -101,
+ 217, 286, 32, -101, -101, -101, 188, 340, 51, 1288,
+ 175, -101, -101, 171, -101, 179, -101, 56, -11, 351,
+ 181, 336, -101, 110, -101, -101, -101, 1934, 647, -101,
+ -101, -101, -101, 253, 2516, 1751, -5, 460, 22, 468,
+ 138, 1288, 2419, 24, -2, 412, 23, -3, 836, 20,
+ 87, -101, 1382, -101, 17, -10, 18, 1288, 25, 8,
+ 1288, 33, 1288, 12, 14, 120, -101, -101, 13, -101,
+ -101, 747, -101, 248, -47, 828, -101, -101, 152, 482,
+ -101, 150, -101, 123, -101, -101, 398, -101, -101, 117,
+ -101, -101, -101, -101, -101, -101,
+
+ -106, 6, -92, 10, 5, 278, -106, -106, -106, -106,
+ -106, -106, -106, -106, -106, -106, -106, -106, -106, -42,
+ -106, -106, -106, -106, -106, -106, -106, -106, -106, 109,
+ -106, -106, -106, -10, -106, -106, -35, 24, 73, 90,
+ -106, 219, 181, -106, -106, -106, 171, 120, -106, -106,
+ -106, -106, -106, 174, -106, 170, 167, -106, 175, 163,
+ -106, -106, -106, -106, 184, 177, 180, -106, -106, -106,
+ -106, 125, -106, 132, 134, 162, 130, -106, 121, 124,
+ 123, 141, 142, 152, -106, 154, 161, 160, -106, -106,
+ -106, -106, -106, -106, -106, -106, -106, -106, -106, 139,
+ -106, 143, -106, 156, 91, 55, -106, -106, -106, -106,
+ -106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
+ -106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
+ -106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
+ -106, 32, -106, -106, -106, -106, -106, 33, -106, -106,
+ 26, -106, -106, -106, -106, -106, -106, -106, -106, -106,
+ -106, -106, -106, -106, 96, -106, 119, 52, -106, -106,
+ 66, -106, 220, 69, 71, -106, -106, -106, -106, -106,
+ -106, -106, -106, 25, -106, -106, -106, 64, -106, -106,
+ -106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
+ -106, -106, -106, -106, -106, -106, 70, -106, -106, 61,
+ -106, 41, -106, 39, -106, 37, -106, -106, 42, -106,
+ 79, -106, -106, -106, 81, 72, -106, -106, -106, -106,
+ -106, -5, -106, -106, -106, -106, -106, -106, -106, -106,
+ -106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
+ -106, -106, 21, -106, -106, -106, -106, 112, -106, -106,
+ -106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
+ -106, 17, 237, -106, 192, 236, 224, 225, -106, 97,
+ 98, 101, 99, 113, -106, -106, -106, -106, -106, -106,
+ -106, -106, 204, -106, 223, -106, 235, -106, -106, 239,
+ -106, 197, -106, -106, 228, -106, 27, -106, 13, -106,
+ 2, -106, 233, -106, 190, 198, -106, -106, 196, -106,
+ -106, -106, -106, -106, -106, 200, -106, 107, 135, -106,
+ -106, 186, -106, 84, -106, 80, -106, 76, -106, -106,
+ 89, -106, -106, -49, -106, -106, 47, -106, 40, -106,
+ 44, -106, 68, -106, -106, -106, -106, -106, -106, 53,
+ -106, 35, -106, 49, -106, 87, 63, -106, -106, 30,
+ -106, -106, 103, -106, -106, -106, 51, -106, -106, -106,
+ -106, 86, -106, 67, 114, -106, 74, -106, -106, 65,
+ -106, 56, -106, -106, -106, -106, -106, -106, -106, 62,
+ -106, -106, -106, -106, -106, -106, 95, -106, -106, 78,
+ -106, -106, -106, -106, 75, -106, 88, -106, -106, -106,
+ -106, -106, -54, -106, 45, -106, -40, -106, -106, -106,
+ -106, 94, -106, -106, 100, -106, -106, -106, -106, -106,
+ 150, -41, -106, -106, 54, -106, 43, -106, 48, -106,
+ -106, -106, -106, 59, -106, 57, -106, 60, -106, 58,
+ -106, -106, -106, -106, -106, -106, 38, -106, -106, 144,
+ -106, -106, -106, -106, 31, -106, -106, 202, -106, -106,
+ 50, -106, -106, -106, -106, -106, -106, -106, -106, -106,
+ -106, -106, -106, -106, -106, -106, 77, -106, -106, -106,
+ -106, -106, 82, -106, -106, -106, -106, -106, -106, -106,
+ -17, -106, -106, -106, -4, -106, -106, 12, -106, -106,
+ -106, -106, -106, -106, -14, 46, -106, -13, -106, -106,
+ -106, -106, 108, -106, -106, -106, 243, -106, -106, 295,
+ -106, -106, -106, 290, -106, -106, -106, -106, 346, -106,
+ -106, -106, 16, -106, -106, -106, 22, 23, -106, 34,
+ -106, -106, -106, -106, -106, 11, -106, -106, -106, 7,
+ 1, 8, -106, -106, -106, -106, -106, 307, 179, -106,
+ -106, -106, -106, -106, 18, 281, 9, 15, -106, 4,
+ -106, 83, 29, -106, -106, -2, -106, -106, 85, -106,
+ -106, -106, 3, -106, -106, -106, -106, 14, -106, 0,
+ 105, -106, 93, -106, -106, -106, -106, -106, -1, -106,
+ -106, 20, -106, -106, 28, 92, -106, -106, -106, 19,
+ -106, -106, -106, -106, -106, -106, -12, -106, -106, -106,
+ -106, -106, -106, -106, -106, -106};
+
+const short QDeclarativeJSGrammar::action_info [] = {
+ 399, 352, 345, -101, 343, 457, 440, 403, 257, -112,
+ -125, -131, -123, 346, -120, 348, -128, 389, 453, 391,
+ 416, 401, 408, 563, -101, -123, 416, -120, 539, -131,
+ 346, -112, -125, 348, 257, 99, 71, 645, 621, 101,
+ -128, 440, 141, 621, 164, 431, 539, 430, 453, 573,
+ 457, 444, 440, 424, 71, 424, 101, 446, 559, 420,
+ 424, 448, 539, 440, 570, 539, 466, 527, 312, 346,
+ 532, 312, 318, 272, 409, 183, 342, 525, 147, 141,
+ 348, 510, 457, 414, 272, 325, 0, 0, 252, 99,
+ 257, 440, 296, 556, -102, 292, 453, 190, 170, 416,
+ 164, 434, 141, 141, 536, 251, 304, 172, 141, 141,
+ 443, 0, 335, 340, 141, 427, 0, 0, 0, 149,
+ 327, 306, 0, 292, 444, 0, 173, 0, 536, 141,
+ 141, 0, 0, 179, 333, 141, 294, 236, 189, 314,
+ 141, 301, 141, 315, 141, 477, 331, 242, 241, 413,
+ 412, 62, 537, 166, 58, 488, 142, 167, 294, 58,
+ 428, 254, 63, 256, 255, 59, 418, 172, 247, 246,
+ 59, 575, 574, 328, 249, 248, 616, 177, 641, 640,
+ 58, 469, 337, 141, 635, 634, 173, 350, 187, 249,
+ 248, 59, 310, 478, 459, 58, 455, 64, 523, 249,
+ 248, 85, 85, 86, 86, 103, 59, 565, 511, 172,
+ 511, 638, 637, 64, 87, 87, 141, 511, 517, 577,
+ 511, 0, 141, 0, 104, 141, 105, 85, 173, 86,
+ 174, 172, 566, 564, 470, 468, 562, 561, 548, 511,
+ 87, 636, 65, 530, 513, 539, 141, 85, 66, 86,
+ 173, 0, 406, 0, 513, 512, 513, 64, 65, 0,
+ 87, 172, 0, 513, 66, 512, 513, 512, 172, 235,
+ 234, 0, 518, 516, 512, 521, 520, 512, 554, 553,
+ 173, 85, 406, 86, 0, 513, -89, 173, 34, 174,
+ 73, 74, 549, 547, 87, 631, 512, 531, 529, 438,
+ 437, 172, 65, 0, 578, 274, 275, 0, 66, 632,
+ 630, 34, 0, 73, 74, 274, 275, 75, 76, -89,
+ 173, 0, 174, 34, 0, 48, 50, 49, 0, 0,
+ 0, 0, 276, 277, 34, 0, 0, 0, 34, 629,
+ 75, 76, 276, 277, 279, 280, 34, 0, 48, 50,
+ 49, 45, 34, 281, 279, 280, 282, 85, 283, 86,
+ 48, 50, 49, 281, 0, 34, 282, 0, 283, 34,
+ 87, 48, 50, 49, 45, 48, 50, 49, 0, 0,
+ 34, 0, 0, 48, 50, 49, 45, 34, 0, 48,
+ 50, 49, 34, 0, 0, 0, 0, 45, 34, 0,
+ 0, 45, 48, 50, 49, 0, 48, 50, 49, 45,
+ 0, 0, 0, 0, 34, 45, 0, 48, 50, 49,
+ 34, 0, 0, 0, 48, 50, 49, 34, 45, 48,
+ 50, 49, 45, 279, 280, 48, 50, 49, 0, 0,
+ 0, 34, 281, 45, 0, 282, 0, 283, -343, 34,
+ 45, 48, 50, 49, 0, 45, -343, 48, 50, 49,
+ 0, 45, 78, 79, 48, 50, 49, 0, 0, 0,
+ 80, 81, 0, 0, 82, 0, 83, 45, 48, 50,
+ 49, 0, 0, 45, 78, 79, 48, 50, 49, 34,
+ 45, 0, 80, 81, 78, 79, 82, 34, 83, 0,
+ 0, 0, 80, 81, 45, 34, 82, 0, 83, 0,
+ 0, 34, 45, 0, 6, 5, 4, 1, 3, 2,
+ 0, 240, 239, 0, 34, 0, 48, 50, 49, 245,
+ 244, 0, 0, 34, 48, 50, 49, 245, 244, 0,
+ 0, 0, 48, 50, 49, 0, 0, 0, 48, 50,
+ 49, 0, 45, 0, 0, 0, 245, 244, 0, 0,
+ 45, 48, 50, 49, 0, 240, 239, 34, 45, 0,
+ 48, 50, 49, 0, 45, 0, 0, 0, 0, 0,
+ 0, 0, 0, 78, 79, 0, 0, 45, 151, 0,
+ 0, 80, 81, 0, 0, 82, 45, 83, 152, 240,
+ 239, 0, 153, 0, 48, 50, 49, 0, 0, 0,
+ 0, 154, 0, 155, 0, 0, 308, 0, 0, 0,
+ 0, 0, 0, 0, 156, 0, 157, 62, 0, 0,
+ 45, 0, 0, 0, 158, 0, 0, 159, 63, 0,
+ 0, 0, 0, 160, 0, 0, 0, 0, 0, 161,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 30,
+ 31, 151, 0, 0, 0, 162, 0, 0, 0, 33,
+ 0, 152, 0, 0, 0, 153, 34, 0, 0, 0,
+ 35, 36, 0, 37, 154, 0, 155, 0, 0, 0,
+ 502, 0, 0, 0, 44, 0, 0, 156, 0, 157,
+ 62, 0, 0, 0, 0, 0, 0, 158, 0, 0,
+ 159, 63, 51, 48, 50, 49, 160, 52, 0, 0,
+ 0, 0, 161, 0, 0, 0, 0, 0, 43, 54,
+ 32, 30, 31, 0, 40, 0, 0, 0, 162, 45,
+ 0, 33, 0, 0, 0, 0, 0, 0, 34, 0,
+ 0, 0, 35, 36, 0, 37, 0, 0, 0, 30,
+ 31, 0, 41, 0, 0, 0, 44, 0, 0, 33,
+ 0, 0, 0, 0, 0, 0, 34, 0, 0, 0,
+ 35, 36, 0, 37, 51, 48, 50, 49, 0, 52,
+ 502, 0, 0, 0, 44, 0, 0, 0, 0, 0,
+ 43, 54, 32, 0, 0, 0, 40, 0, 0, 0,
+ 0, 45, 51, 48, 50, 49, 0, 52, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 43, 54,
+ 32, 0, 0, 0, 40, 0, 0, 0, 0, 45,
+ 30, 31, 0, 0, 0, 0, 0, 0, 30, 31,
+ 33, 0, 0, 0, 0, 0, 0, 34, 33, 0,
+ 0, 35, 36, 0, 37, 34, 0, 0, 0, 35,
+ 36, 502, 37, 0, 0, 44, 0, 0, 0, 41,
+ 0, 0, 0, 44, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 51, 48, 50, 49, 0, 52, 0,
+ 0, 51, 48, 50, 49, 0, 52, 0, 0, 43,
+ 54, 32, 0, 0, 0, 40, 0, 43, 54, 32,
+ 45, 0, 0, 40, 0, 0, 0, 0, 45, 30,
+ 31, 0, 0, 0, 0, 0, 0, 30, 31, 33,
+ 0, 0, 0, 0, 0, 0, 34, 33, 0, 0,
+ 35, 36, 0, 37, 34, 0, 0, 0, 35, 36,
+ 41, 37, 0, 0, 44, 0, 0, 0, 502, 0,
+ 0, 0, 44, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 51, 48, 50, 49, 0, 52, 0, 0,
+ 51, 48, 50, 49, 0, 52, 0, 0, 43, 54,
+ 32, 0, 0, 0, 40, 0, 43, 54, 32, 45,
+ 0, 0, 40, 0, 0, 0, 0, 45, 0, 0,
+ 0, 0, 0, 0, 0, 0, 501, 0, 30, 31,
+ 0, 0, 0, 0, 0, 0, 0, 0, 215, 0,
+ 0, 0, 0, 0, 0, 34, 0, 0, 0, 35,
+ 36, 0, 37, 0, 0, 0, 0, 0, 0, 502,
+ 0, 0, 0, 44, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 51, 503, 505, 504, 0, 52, 0, 0, 0,
+ 0, 226, 0, 0, 0, 0, 0, 43, 54, 32,
+ 210, 0, 0, 40, 0, 0, 0, 0, 45, 0,
+ 0, 0, 0, 0, 0, 0, 0, 501, 0, 30,
+ 31, 0, 0, 0, 0, 0, 0, 0, 0, 215,
+ 0, 0, 0, 0, 0, 0, 34, 0, 0, 0,
+ 35, 36, 0, 37, 0, 0, 0, 0, 0, 0,
+ 502, 0, 0, 0, 44, 0, 0, 0, 0, 0,
+ 0, 0, 544, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 51, 503, 505, 504, 0, 52, 0, 0,
+ 0, 0, 226, 0, 0, 0, 0, 0, 43, 54,
+ 32, 210, 0, 0, 40, 0, 0, 0, 0, 45,
+ 0, 0, 0, 0, 0, 0, 0, 0, 501, 0,
+ 30, 31, 0, 0, 0, 0, 0, 0, 0, 0,
+ 215, 0, 0, 0, 0, 0, 0, 34, 0, 0,
+ 0, 35, 36, 0, 37, 0, 0, 0, 0, 0,
+ 0, 502, 0, 0, 0, 44, 0, 0, 0, 0,
+ 0, 0, 0, 541, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 51, 503, 505, 504, 0, 52, 0,
+ 0, 0, 0, 226, 0, 0, 0, 0, 0, 43,
+ 54, 32, 210, 0, 0, 40, 0, 0, 0, 0,
+ 45, 0, 0, 0, 0, 0, 0, 0, 0, 29,
+ 30, 31, 0, 0, 0, 0, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 34, 0, 0,
+ 0, 35, 36, 0, 37, 0, 0, 0, 38, 0,
+ 39, 41, 42, 0, 0, 44, 0, 0, 0, 46,
+ 0, 47, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 51, 48, 50, 49, 0, 52, 0,
+ 53, 0, 55, 0, 56, 0, 0, 0, 0, 43,
+ 54, 32, 0, 0, 0, 40, 0, 0, 0, 0,
+ 45, 0, 0, 0, 0, 0, 0, 0, 0, -121,
+ 0, 0, 0, 29, 30, 31, 0, 0, 0, 0,
+ 0, 0, 0, 0, 33, 0, 0, 0, 0, 0,
+ 0, 34, 0, 0, 0, 35, 36, 0, 37, 0,
+ 0, 0, 38, 0, 39, 41, 42, 0, 0, 44,
+ 0, 0, 0, 46, 0, 47, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 51, 48, 50,
+ 49, 0, 52, 0, 53, 0, 55, 0, 56, 0,
+ 0, 0, 0, 43, 54, 32, 0, 0, 0, 40,
+ 0, 0, 0, 0, 45, 0, 0, 0, 0, 0,
+ 0, 0, 0, 29, 30, 31, 0, 0, 0, 0,
+ 0, 0, 0, 0, 33, 0, 0, 0, 0, 0,
+ 0, 34, 0, 0, 0, 35, 36, 0, 37, 0,
+ 0, 0, 38, 0, 39, 41, 42, 0, 0, 44,
+ 0, 0, 0, 46, 0, 47, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 51, 48, 50,
+ 49, 0, 52, 0, 53, 0, 55, 271, 56, 0,
+ 0, 0, 0, 43, 54, 32, 0, 0, 0, 40,
+ 0, 0, 0, 0, 45, 0, 0, 0, 0, 0,
+ 0, 0, 0, 483, 0, 0, 29, 30, 31, 0,
+ 0, 0, 0, 0, 0, 0, 0, 33, 0, 0,
+ 0, 0, 0, 0, 34, 0, 0, 0, 35, 36,
+ 0, 37, 0, 0, 0, 38, 0, 39, 41, 42,
+ 0, 0, 44, 0, 0, 0, 46, 0, 47, 0,
+ 0, 486, 0, 0, 0, 0, 0, 0, 0, 0,
+ 51, 48, 50, 49, 0, 52, 0, 53, 0, 55,
+ 0, 56, 0, 0, 0, 0, 43, 54, 32, 0,
+ 0, 0, 40, 0, 0, 0, 0, 45, 0, 0,
+ 0, 0, 0, 0, 0, 0, 475, 0, 0, 29,
+ 30, 31, 0, 0, 0, 0, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 34, 0, 0,
+ 0, 35, 36, 0, 37, 0, 0, 0, 38, 0,
+ 39, 41, 42, 0, 0, 44, 0, 0, 0, 46,
+ 0, 47, 0, 0, 481, 0, 0, 0, 0, 0,
+ 0, 0, 0, 51, 48, 50, 49, 0, 52, 0,
+ 53, 0, 55, 0, 56, 0, 0, 0, 0, 43,
+ 54, 32, 0, 0, 0, 40, 0, 0, 0, 0,
+ 45, 0, 0, 0, 0, 0, 0, 0, 0, 475,
+ 0, 0, 29, 30, 31, 0, 0, 0, 0, 0,
+ 0, 0, 0, 33, 0, 0, 0, 0, 0, 0,
+ 34, 0, 0, 0, 35, 36, 0, 37, 0, 0,
+ 0, 38, 0, 39, 41, 42, 0, 0, 44, 0,
+ 0, 0, 46, 0, 47, 0, 0, 476, 0, 0,
+ 0, 0, 0, 0, 0, 0, 51, 48, 50, 49,
+ 0, 52, 0, 53, 0, 55, 0, 56, 0, 0,
+ 0, 0, 43, 54, 32, 0, 0, 0, 40, 0,
+ 0, 0, 0, 45, 0, 0, 0, 0, 0, 0,
+ 0, 0, 483, 0, 0, 29, 30, 31, 0, 0,
+ 0, 0, 0, 0, 0, 0, 33, 0, 0, 0,
+ 0, 0, 0, 34, 0, 0, 0, 35, 36, 0,
+ 37, 0, 0, 0, 38, 0, 39, 41, 42, 0,
+ 0, 44, 0, 0, 0, 46, 0, 47, 0, 0,
+ 484, 0, 0, 0, 0, 0, 0, 0, 0, 51,
+ 48, 50, 49, 0, 52, 0, 53, 0, 55, 0,
+ 56, 0, 0, 0, 0, 43, 54, 32, 0, 0,
+ 0, 40, 0, 0, 0, 0, 45, 0, 0, 0,
+ 0, 0, 0, 0, 0, 29, 30, 31, 0, 0,
+ 0, 0, 0, 0, 0, 0, 33, 0, 0, 0,
+ 0, 0, 0, 34, 217, 0, 0, 584, 585, 0,
+ 37, 0, 0, 0, 38, 0, 39, 41, 42, 0,
+ 0, 44, 0, 0, 0, 46, 0, 47, 0, 0,
+ 0, 0, 0, 0, 0, 221, 0, 0, 0, 51,
+ 48, 50, 49, 0, 52, 0, 53, 0, 55, 0,
+ 56, 0, 0, 0, 0, 43, 54, 32, 0, 0,
+ 0, 40, 0, 0, 0, 0, 45, 0, 0, 0,
+ 0, 0, 0, 0, 0, 109, 110, 111, 0, 0,
+ 113, 115, 116, 0, 0, 117, 0, 118, 0, 0,
+ 0, 120, 121, 122, 0, 0, 0, 0, 0, 0,
+ 34, 123, 124, 125, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 126, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 129, 0, 0, 0, 0, 0, 0, 48, 50, 49,
+ 130, 131, 132, 0, 134, 135, 136, 137, 138, 139,
+ 0, 0, 127, 133, 119, 112, 114, 128, 0, 0,
+ 0, 0, 0, 45, 0, 0, 0, 0, 0, 0,
+ 0, 0, 109, 110, 111, 0, 0, 113, 115, 116,
+ 0, 0, 117, 0, 118, 0, 0, 0, 120, 121,
+ 122, 0, 0, 0, 0, 0, 0, 393, 123, 124,
+ 125, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 126, 0, 0, 0, 394, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 129, 0, 0,
+ 0, 0, 0, 398, 395, 397, 0, 130, 131, 132,
+ 0, 134, 135, 136, 137, 138, 139, 0, 0, 127,
+ 133, 119, 112, 114, 128, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 109,
+ 110, 111, 0, 0, 113, 115, 116, 0, 0, 117,
+ 0, 118, 0, 0, 0, 120, 121, 122, 0, 0,
+ 0, 0, 0, 0, 393, 123, 124, 125, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 126, 0,
+ 0, 0, 394, 0, 0, 0, 0, 0, 0, 0,
+ 396, 0, 0, 0, 129, 0, 0, 0, 0, 0,
+ 398, 395, 397, 0, 130, 131, 132, 0, 134, 135,
+ 136, 137, 138, 139, 0, 0, 127, 133, 119, 112,
+ 114, 128, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 209, 0, 0, 0,
+ 0, 211, 0, 29, 30, 31, 213, 0, 0, 0,
+ 0, 0, 0, 214, 215, 0, 0, 0, 0, 0,
+ 0, 216, 217, 0, 0, 218, 36, 0, 37, 0,
+ 0, 0, 38, 0, 39, 41, 42, 0, 0, 44,
+ 0, 0, 0, 46, 0, 47, 0, 0, 0, 0,
+ 0, 220, 0, 221, 0, 0, 0, 51, 219, 222,
+ 49, 223, 52, 224, 53, 225, 55, 226, 56, 227,
+ 228, 0, 0, 43, 54, 32, 210, 212, 0, 40,
+ 0, 0, 0, 0, 45, 0, 0, 0, 0, 0,
+ 0, 0, 0, 209, 0, 0, 0, 0, 211, 0,
+ 29, 30, 31, 213, 0, 0, 0, 0, 0, 0,
+ 214, 33, 0, 0, 0, 0, 0, 0, 216, 217,
+ 0, 0, 218, 36, 0, 37, 0, 0, 0, 38,
+ 0, 39, 41, 42, 0, 0, 44, 0, 0, 0,
+ 46, 0, 47, 0, 0, 0, 0, 0, 220, 0,
+ 221, 0, 0, 0, 51, 219, 222, 49, 223, 52,
+ 224, 53, 225, 55, 226, 56, 227, 228, 0, 0,
+ 43, 54, 32, 210, 212, 0, 40, 0, 0, 0,
+ 0, 45, 0, 0, 0, 0, 0, 0, 0, 0,
+ 587, 110, 111, 0, 0, 589, 115, 591, 30, 31,
+ 592, 0, 118, 0, 0, 0, 120, 594, 595, 0,
+ 0, 0, 0, 0, 0, 596, 597, 124, 125, 218,
+ 36, 0, 37, 0, 0, 0, 38, 0, 39, 598,
+ 42, 0, 0, 600, 0, 0, 0, 46, 0, 47,
+ 0, 0, 0, 0, 0, 602, 0, 221, 0, 0,
+ 0, 604, 601, 603, 49, 605, 606, 607, 53, 609,
+ 610, 611, 612, 613, 614, 0, 0, 599, 608, 593,
+ 588, 590, 128, 40, 0, 0, 0, 0, 45, 0,
+ 0, 0, 0, 0, 0, 0, 0, 361, 110, 111,
+ 0, 0, 363, 115, 365, 30, 31, 366, 0, 118,
+ 0, 0, 0, 120, 368, 369, 0, 0, 0, 0,
+ 0, 0, 370, 371, 124, 125, 218, 36, 0, 37,
+ 0, 0, 0, 38, 0, 39, 372, 42, 0, 0,
+ 374, 0, 0, 0, 46, 0, 47, 0, -267, 0,
+ 0, 0, 376, 0, 221, 0, 0, 0, 378, 375,
+ 377, 49, 379, 380, 381, 53, 383, 384, 385, 386,
+ 387, 388, 0, 0, 373, 382, 367, 362, 364, 128,
+ 40, 0, 0, 0, 0, 45, 0, 0, 0, 0,
+ 0, 0, 0, 0,
+
+ 472, 546, 528, 639, 311, 182, 302, 498, 514, 16,
+ 461, 515, 496, 182, 497, 519, 309, 436, 619, 243,
+ 358, 439, 576, 572, 253, 150, 571, 487, 617, 307,
+ 238, 250, 320, 628, 633, 555, 569, 560, 558, 642,
+ 186, 250, 425, 349, 358, 182, 351, 557, 433, 347,
+ 238, 344, 339, 429, 302, 402, 243, 445, 447, 456,
+ 460, 163, 454, 458, 243, 250, 485, 143, 148, 449,
+ 353, 526, 176, 467, 237, 450, 238, 415, 338, 188,
+ 410, 237, 302, 336, 436, 482, 334, 169, 439, 436,
+ 146, 417, 392, 439, 140, 522, 358, 400, 404, 0,
+ 390, 171, 358, 0, 186, 500, 146, 0, 643, 0,
+ 0, 178, 0, 0, 0, 0, 404, 60, 60, 489,
+ 452, 500, 320, 0, 534, 0, 405, 60, 0, 180,
+ 146, 60, 0, 180, 60, 407, 490, 60, 302, 452,
+ 60, 60, 60, 60, 405, 60, 284, 285, 287, 60,
+ 286, 451, 358, 60, 165, 180, 266, 60, 60, 461,
+ 451, 270, 288, 60, 60, 60, 493, 60, 60, 60,
+ 84, 106, 92, 91, 60, 432, 60, 72, 60, 168,
+ 98, 435, 77, 60, 96, 60, 60, 60, 341, 302,
+ 93, 94, 500, 108, 329, 100, 60, 102, 60, 618,
+ 302, 95, 88, 330, 60, 60, 60, 60, 90, 89,
+ 70, 60, 97, 452, 60, 60, 451, 492, 60, 60,
+ 494, 60, 61, 68, 60, 60, 69, 491, 60, 471,
+ 67, 302, 404, 480, 60, 106, 60, 479, 0, 270,
+ 298, 270, 298, 278, 298, 270, 0, 270, 60, 270,
+ 0, 316, 0, 270, 332, 0, 500, 108, 175, 538,
+ 405, 293, 319, 0, 317, 303, 326, 60, 60, 60,
+ 0, 0, 270, 270, 270, 290, 291, 60, 295, 298,
+ 60, 60, 270, 298, 270, 270, 270, 289, 270, 0,
+ 273, 500, 313, 0, 551, 545, 305, 534, 508, 615,
+ 542, 297, 0, 500, 0, 300, 499, 509, 500, 0,
+ 508, 0, 0, 0, 0, 508, 472, 0, 499, 509,
+ 583, 0, 0, 499, 509, 0, 0, 586, 579, 580,
+ 581, 582, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 550,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 551,
+ 0, 0, 0, 0, 0, 0, 552, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0};
+
+const short QDeclarativeJSGrammar::action_check [] = {
+ 7, 16, 55, 7, 33, 36, 33, 55, 36, 7,
+ 7, 7, 7, 7, 7, 36, 7, 7, 36, 8,
+ 36, 55, 60, 29, 7, 7, 36, 7, 33, 7,
+ 7, 7, 7, 36, 36, 48, 1, 0, 90, 79,
+ 7, 33, 8, 90, 2, 7, 33, 55, 36, 60,
+ 36, 20, 33, 5, 1, 5, 79, 36, 7, 33,
+ 5, 60, 33, 33, 8, 33, 17, 24, 2, 7,
+ 34, 2, 7, 1, 7, 36, 60, 37, 8, 8,
+ 36, 66, 36, 7, 1, 17, -1, -1, 36, 48,
+ 36, 33, 8, 66, 7, 48, 36, 33, 7, 36,
+ 2, 7, 8, 8, 8, 77, 61, 15, 8, 8,
+ 6, -1, 31, 36, 8, 10, -1, -1, -1, 60,
+ 8, 60, -1, 48, 20, -1, 34, -1, 8, 8,
+ 8, -1, -1, 60, 60, 8, 79, 55, 60, 50,
+ 8, 61, 8, 54, 8, 8, 61, 61, 62, 61,
+ 62, 42, 56, 50, 40, 60, 56, 54, 79, 40,
+ 55, 60, 53, 61, 62, 51, 60, 15, 61, 62,
+ 51, 61, 62, 61, 61, 62, 56, 56, 61, 62,
+ 40, 8, 60, 8, 61, 62, 34, 60, 8, 61,
+ 62, 51, 60, 56, 60, 40, 60, 12, 29, 61,
+ 62, 25, 25, 27, 27, 15, 51, 36, 29, 15,
+ 29, 61, 62, 12, 38, 38, 8, 29, 7, 7,
+ 29, -1, 8, -1, 34, 8, 36, 25, 34, 27,
+ 36, 15, 61, 62, 61, 62, 61, 62, 7, 29,
+ 38, 91, 57, 7, 75, 33, 8, 25, 63, 27,
+ 34, -1, 36, -1, 75, 86, 75, 12, 57, -1,
+ 38, 15, -1, 75, 63, 86, 75, 86, 15, 61,
+ 62, -1, 61, 62, 86, 61, 62, 86, 61, 62,
+ 34, 25, 36, 27, -1, 75, 33, 34, 29, 36,
+ 18, 19, 61, 62, 38, 47, 86, 61, 62, 61,
+ 62, 15, 57, -1, 92, 18, 19, -1, 63, 61,
+ 62, 29, -1, 18, 19, 18, 19, 45, 46, 33,
+ 34, -1, 36, 29, -1, 66, 67, 68, -1, -1,
+ -1, -1, 45, 46, 29, -1, -1, -1, 29, 91,
+ 45, 46, 45, 46, 23, 24, 29, -1, 66, 67,
+ 68, 92, 29, 32, 23, 24, 35, 25, 37, 27,
+ 66, 67, 68, 32, -1, 29, 35, -1, 37, 29,
+ 38, 66, 67, 68, 92, 66, 67, 68, -1, -1,
+ 29, -1, -1, 66, 67, 68, 92, 29, -1, 66,
+ 67, 68, 29, -1, -1, -1, -1, 92, 29, -1,
+ -1, 92, 66, 67, 68, -1, 66, 67, 68, 92,
+ -1, -1, -1, -1, 29, 92, -1, 66, 67, 68,
+ 29, -1, -1, -1, 66, 67, 68, 29, 92, 66,
+ 67, 68, 92, 23, 24, 66, 67, 68, -1, -1,
+ -1, 29, 32, 92, -1, 35, -1, 37, 36, 29,
+ 92, 66, 67, 68, -1, 92, 36, 66, 67, 68,
+ -1, 92, 23, 24, 66, 67, 68, -1, -1, -1,
+ 31, 32, -1, -1, 35, -1, 37, 92, 66, 67,
+ 68, -1, -1, 92, 23, 24, 66, 67, 68, 29,
+ 92, -1, 31, 32, 23, 24, 35, 29, 37, -1,
+ -1, -1, 31, 32, 92, 29, 35, -1, 37, -1,
+ -1, 29, 92, -1, 93, 94, 95, 96, 97, 98,
+ -1, 61, 62, -1, 29, -1, 66, 67, 68, 61,
+ 62, -1, -1, 29, 66, 67, 68, 61, 62, -1,
+ -1, -1, 66, 67, 68, -1, -1, -1, 66, 67,
+ 68, -1, 92, -1, -1, -1, 61, 62, -1, -1,
+ 92, 66, 67, 68, -1, 61, 62, 29, 92, -1,
+ 66, 67, 68, -1, 92, -1, -1, -1, -1, -1,
+ -1, -1, -1, 23, 24, -1, -1, 92, 3, -1,
+ -1, 31, 32, -1, -1, 35, 92, 37, 13, 61,
+ 62, -1, 17, -1, 66, 67, 68, -1, -1, -1,
+ -1, 26, -1, 28, -1, -1, 31, -1, -1, -1,
+ -1, -1, -1, -1, 39, -1, 41, 42, -1, -1,
+ 92, -1, -1, -1, 49, -1, -1, 52, 53, -1,
+ -1, -1, -1, 58, -1, -1, -1, -1, -1, 64,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 12,
+ 13, 3, -1, -1, -1, 80, -1, -1, -1, 22,
+ -1, 13, -1, -1, -1, 17, 29, -1, -1, -1,
+ 33, 34, -1, 36, 26, -1, 28, -1, -1, -1,
+ 43, -1, -1, -1, 47, -1, -1, 39, -1, 41,
+ 42, -1, -1, -1, -1, -1, -1, 49, -1, -1,
+ 52, 53, 65, 66, 67, 68, 58, 70, -1, -1,
+ -1, -1, 64, -1, -1, -1, -1, -1, 81, 82,
+ 83, 12, 13, -1, 87, -1, -1, -1, 80, 92,
+ -1, 22, -1, -1, -1, -1, -1, -1, 29, -1,
+ -1, -1, 33, 34, -1, 36, -1, -1, -1, 12,
+ 13, -1, 43, -1, -1, -1, 47, -1, -1, 22,
+ -1, -1, -1, -1, -1, -1, 29, -1, -1, -1,
+ 33, 34, -1, 36, 65, 66, 67, 68, -1, 70,
+ 43, -1, -1, -1, 47, -1, -1, -1, -1, -1,
+ 81, 82, 83, -1, -1, -1, 87, -1, -1, -1,
+ -1, 92, 65, 66, 67, 68, -1, 70, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 81, 82,
+ 83, -1, -1, -1, 87, -1, -1, -1, -1, 92,
+ 12, 13, -1, -1, -1, -1, -1, -1, 12, 13,
+ 22, -1, -1, -1, -1, -1, -1, 29, 22, -1,
+ -1, 33, 34, -1, 36, 29, -1, -1, -1, 33,
+ 34, 43, 36, -1, -1, 47, -1, -1, -1, 43,
+ -1, -1, -1, 47, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 65, 66, 67, 68, -1, 70, -1,
+ -1, 65, 66, 67, 68, -1, 70, -1, -1, 81,
+ 82, 83, -1, -1, -1, 87, -1, 81, 82, 83,
+ 92, -1, -1, 87, -1, -1, -1, -1, 92, 12,
+ 13, -1, -1, -1, -1, -1, -1, 12, 13, 22,
+ -1, -1, -1, -1, -1, -1, 29, 22, -1, -1,
+ 33, 34, -1, 36, 29, -1, -1, -1, 33, 34,
+ 43, 36, -1, -1, 47, -1, -1, -1, 43, -1,
+ -1, -1, 47, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 65, 66, 67, 68, -1, 70, -1, -1,
+ 65, 66, 67, 68, -1, 70, -1, -1, 81, 82,
+ 83, -1, -1, -1, 87, -1, 81, 82, 83, 92,
+ -1, -1, 87, -1, -1, -1, -1, 92, -1, -1,
+ -1, -1, -1, -1, -1, -1, 10, -1, 12, 13,
+ -1, -1, -1, -1, -1, -1, -1, -1, 22, -1,
+ -1, -1, -1, -1, -1, 29, -1, -1, -1, 33,
+ 34, -1, 36, -1, -1, -1, -1, -1, -1, 43,
+ -1, -1, -1, 47, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 65, 66, 67, 68, -1, 70, -1, -1, -1,
+ -1, 75, -1, -1, -1, -1, -1, 81, 82, 83,
+ 84, -1, -1, 87, -1, -1, -1, -1, 92, -1,
+ -1, -1, -1, -1, -1, -1, -1, 10, -1, 12,
+ 13, -1, -1, -1, -1, -1, -1, -1, -1, 22,
+ -1, -1, -1, -1, -1, -1, 29, -1, -1, -1,
+ 33, 34, -1, 36, -1, -1, -1, -1, -1, -1,
+ 43, -1, -1, -1, 47, -1, -1, -1, -1, -1,
+ -1, -1, 55, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 65, 66, 67, 68, -1, 70, -1, -1,
+ -1, -1, 75, -1, -1, -1, -1, -1, 81, 82,
+ 83, 84, -1, -1, 87, -1, -1, -1, -1, 92,
+ -1, -1, -1, -1, -1, -1, -1, -1, 10, -1,
+ 12, 13, -1, -1, -1, -1, -1, -1, -1, -1,
+ 22, -1, -1, -1, -1, -1, -1, 29, -1, -1,
+ -1, 33, 34, -1, 36, -1, -1, -1, -1, -1,
+ -1, 43, -1, -1, -1, 47, -1, -1, -1, -1,
+ -1, -1, -1, 55, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 65, 66, 67, 68, -1, 70, -1,
+ -1, -1, -1, 75, -1, -1, -1, -1, -1, 81,
+ 82, 83, 84, -1, -1, 87, -1, -1, -1, -1,
+ 92, -1, -1, -1, -1, -1, -1, -1, -1, 11,
+ 12, 13, -1, -1, -1, -1, -1, -1, -1, -1,
+ 22, -1, -1, -1, -1, -1, -1, 29, -1, -1,
+ -1, 33, 34, -1, 36, -1, -1, -1, 40, -1,
+ 42, 43, 44, -1, -1, 47, -1, -1, -1, 51,
+ -1, 53, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 65, 66, 67, 68, -1, 70, -1,
+ 72, -1, 74, -1, 76, -1, -1, -1, -1, 81,
+ 82, 83, -1, -1, -1, 87, -1, -1, -1, -1,
+ 92, -1, -1, -1, -1, -1, -1, -1, -1, 7,
+ -1, -1, -1, 11, 12, 13, -1, -1, -1, -1,
+ -1, -1, -1, -1, 22, -1, -1, -1, -1, -1,
+ -1, 29, -1, -1, -1, 33, 34, -1, 36, -1,
+ -1, -1, 40, -1, 42, 43, 44, -1, -1, 47,
+ -1, -1, -1, 51, -1, 53, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 65, 66, 67,
+ 68, -1, 70, -1, 72, -1, 74, -1, 76, -1,
+ -1, -1, -1, 81, 82, 83, -1, -1, -1, 87,
+ -1, -1, -1, -1, 92, -1, -1, -1, -1, -1,
+ -1, -1, -1, 11, 12, 13, -1, -1, -1, -1,
+ -1, -1, -1, -1, 22, -1, -1, -1, -1, -1,
+ -1, 29, -1, -1, -1, 33, 34, -1, 36, -1,
+ -1, -1, 40, -1, 42, 43, 44, -1, -1, 47,
+ -1, -1, -1, 51, -1, 53, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 65, 66, 67,
+ 68, -1, 70, -1, 72, -1, 74, 75, 76, -1,
+ -1, -1, -1, 81, 82, 83, -1, -1, -1, 87,
+ -1, -1, -1, -1, 92, -1, -1, -1, -1, -1,
+ -1, -1, -1, 8, -1, -1, 11, 12, 13, -1,
+ -1, -1, -1, -1, -1, -1, -1, 22, -1, -1,
+ -1, -1, -1, -1, 29, -1, -1, -1, 33, 34,
+ -1, 36, -1, -1, -1, 40, -1, 42, 43, 44,
+ -1, -1, 47, -1, -1, -1, 51, -1, 53, -1,
+ -1, 56, -1, -1, -1, -1, -1, -1, -1, -1,
+ 65, 66, 67, 68, -1, 70, -1, 72, -1, 74,
+ -1, 76, -1, -1, -1, -1, 81, 82, 83, -1,
+ -1, -1, 87, -1, -1, -1, -1, 92, -1, -1,
+ -1, -1, -1, -1, -1, -1, 8, -1, -1, 11,
+ 12, 13, -1, -1, -1, -1, -1, -1, -1, -1,
+ 22, -1, -1, -1, -1, -1, -1, 29, -1, -1,
+ -1, 33, 34, -1, 36, -1, -1, -1, 40, -1,
+ 42, 43, 44, -1, -1, 47, -1, -1, -1, 51,
+ -1, 53, -1, -1, 56, -1, -1, -1, -1, -1,
+ -1, -1, -1, 65, 66, 67, 68, -1, 70, -1,
+ 72, -1, 74, -1, 76, -1, -1, -1, -1, 81,
+ 82, 83, -1, -1, -1, 87, -1, -1, -1, -1,
+ 92, -1, -1, -1, -1, -1, -1, -1, -1, 8,
+ -1, -1, 11, 12, 13, -1, -1, -1, -1, -1,
+ -1, -1, -1, 22, -1, -1, -1, -1, -1, -1,
+ 29, -1, -1, -1, 33, 34, -1, 36, -1, -1,
+ -1, 40, -1, 42, 43, 44, -1, -1, 47, -1,
+ -1, -1, 51, -1, 53, -1, -1, 56, -1, -1,
+ -1, -1, -1, -1, -1, -1, 65, 66, 67, 68,
+ -1, 70, -1, 72, -1, 74, -1, 76, -1, -1,
+ -1, -1, 81, 82, 83, -1, -1, -1, 87, -1,
+ -1, -1, -1, 92, -1, -1, -1, -1, -1, -1,
+ -1, -1, 8, -1, -1, 11, 12, 13, -1, -1,
+ -1, -1, -1, -1, -1, -1, 22, -1, -1, -1,
+ -1, -1, -1, 29, -1, -1, -1, 33, 34, -1,
+ 36, -1, -1, -1, 40, -1, 42, 43, 44, -1,
+ -1, 47, -1, -1, -1, 51, -1, 53, -1, -1,
+ 56, -1, -1, -1, -1, -1, -1, -1, -1, 65,
+ 66, 67, 68, -1, 70, -1, 72, -1, 74, -1,
+ 76, -1, -1, -1, -1, 81, 82, 83, -1, -1,
+ -1, 87, -1, -1, -1, -1, 92, -1, -1, -1,
+ -1, -1, -1, -1, -1, 11, 12, 13, -1, -1,
+ -1, -1, -1, -1, -1, -1, 22, -1, -1, -1,
+ -1, -1, -1, 29, 30, -1, -1, 33, 34, -1,
+ 36, -1, -1, -1, 40, -1, 42, 43, 44, -1,
+ -1, 47, -1, -1, -1, 51, -1, 53, -1, -1,
+ -1, -1, -1, -1, -1, 61, -1, -1, -1, 65,
+ 66, 67, 68, -1, 70, -1, 72, -1, 74, -1,
+ 76, -1, -1, -1, -1, 81, 82, 83, -1, -1,
+ -1, 87, -1, -1, -1, -1, 92, -1, -1, -1,
+ -1, -1, -1, -1, -1, 4, 5, 6, -1, -1,
+ 9, 10, 11, -1, -1, 14, -1, 16, -1, -1,
+ -1, 20, 21, 22, -1, -1, -1, -1, -1, -1,
+ 29, 30, 31, 32, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 43, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 59, -1, -1, -1, -1, -1, -1, 66, 67, 68,
+ 69, 70, 71, -1, 73, 74, 75, 76, 77, 78,
+ -1, -1, 81, 82, 83, 84, 85, 86, -1, -1,
+ -1, -1, -1, 92, -1, -1, -1, -1, -1, -1,
+ -1, -1, 4, 5, 6, -1, -1, 9, 10, 11,
+ -1, -1, 14, -1, 16, -1, -1, -1, 20, 21,
+ 22, -1, -1, -1, -1, -1, -1, 29, 30, 31,
+ 32, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 43, -1, -1, -1, 47, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 59, -1, -1,
+ -1, -1, -1, 65, 66, 67, -1, 69, 70, 71,
+ -1, 73, 74, 75, 76, 77, 78, -1, -1, 81,
+ 82, 83, 84, 85, 86, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 4,
+ 5, 6, -1, -1, 9, 10, 11, -1, -1, 14,
+ -1, 16, -1, -1, -1, 20, 21, 22, -1, -1,
+ -1, -1, -1, -1, 29, 30, 31, 32, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 43, -1,
+ -1, -1, 47, -1, -1, -1, -1, -1, -1, -1,
+ 55, -1, -1, -1, 59, -1, -1, -1, -1, -1,
+ 65, 66, 67, -1, 69, 70, 71, -1, 73, 74,
+ 75, 76, 77, 78, -1, -1, 81, 82, 83, 84,
+ 85, 86, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 4, -1, -1, -1,
+ -1, 9, -1, 11, 12, 13, 14, -1, -1, -1,
+ -1, -1, -1, 21, 22, -1, -1, -1, -1, -1,
+ -1, 29, 30, -1, -1, 33, 34, -1, 36, -1,
+ -1, -1, 40, -1, 42, 43, 44, -1, -1, 47,
+ -1, -1, -1, 51, -1, 53, -1, -1, -1, -1,
+ -1, 59, -1, 61, -1, -1, -1, 65, 66, 67,
+ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
+ 78, -1, -1, 81, 82, 83, 84, 85, -1, 87,
+ -1, -1, -1, -1, 92, -1, -1, -1, -1, -1,
+ -1, -1, -1, 4, -1, -1, -1, -1, 9, -1,
+ 11, 12, 13, 14, -1, -1, -1, -1, -1, -1,
+ 21, 22, -1, -1, -1, -1, -1, -1, 29, 30,
+ -1, -1, 33, 34, -1, 36, -1, -1, -1, 40,
+ -1, 42, 43, 44, -1, -1, 47, -1, -1, -1,
+ 51, -1, 53, -1, -1, -1, -1, -1, 59, -1,
+ 61, -1, -1, -1, 65, 66, 67, 68, 69, 70,
+ 71, 72, 73, 74, 75, 76, 77, 78, -1, -1,
+ 81, 82, 83, 84, 85, -1, 87, -1, -1, -1,
+ -1, 92, -1, -1, -1, -1, -1, -1, -1, -1,
+ 4, 5, 6, -1, -1, 9, 10, 11, 12, 13,
+ 14, -1, 16, -1, -1, -1, 20, 21, 22, -1,
+ -1, -1, -1, -1, -1, 29, 30, 31, 32, 33,
+ 34, -1, 36, -1, -1, -1, 40, -1, 42, 43,
+ 44, -1, -1, 47, -1, -1, -1, 51, -1, 53,
+ -1, -1, -1, -1, -1, 59, -1, 61, -1, -1,
+ -1, 65, 66, 67, 68, 69, 70, 71, 72, 73,
+ 74, 75, 76, 77, 78, -1, -1, 81, 82, 83,
+ 84, 85, 86, 87, -1, -1, -1, -1, 92, -1,
+ -1, -1, -1, -1, -1, -1, -1, 4, 5, 6,
+ -1, -1, 9, 10, 11, 12, 13, 14, -1, 16,
+ -1, -1, -1, 20, 21, 22, -1, -1, -1, -1,
+ -1, -1, 29, 30, 31, 32, 33, 34, -1, 36,
+ -1, -1, -1, 40, -1, 42, 43, 44, -1, -1,
+ 47, -1, -1, -1, 51, -1, 53, -1, 55, -1,
+ -1, -1, 59, -1, 61, -1, -1, -1, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
+ 77, 78, -1, -1, 81, 82, 83, 84, 85, 86,
+ 87, -1, -1, -1, -1, 92, -1, -1, -1, -1,
+ -1, -1, -1, -1,
+
+ 35, 15, 15, 15, 2, 15, 3, 2, 25, 3,
+ 15, 15, 104, 15, 4, 3, 3, 3, 19, 15,
+ 2, 21, 15, 15, 3, 67, 25, 3, 19, 2,
+ 15, 2, 15, 13, 15, 19, 25, 3, 15, 11,
+ 15, 2, 96, 3, 2, 15, 2, 25, 3, 2,
+ 15, 100, 15, 93, 3, 2, 15, 98, 15, 2,
+ 2, 35, 3, 3, 15, 2, 35, 35, 35, 21,
+ 2, 25, 3, 35, 4, 21, 15, 2, 2, 15,
+ 2, 4, 3, 3, 3, 35, 2, 35, 21, 3,
+ 35, 3, 36, 21, 3, 13, 2, 35, 13, -1,
+ 35, 35, 2, -1, 15, 13, 35, -1, 16, -1,
+ -1, 40, -1, -1, -1, -1, 13, 44, 44, 46,
+ 46, 13, 15, -1, 16, -1, 41, 44, -1, 46,
+ 35, 44, -1, 46, 44, 40, 46, 44, 3, 46,
+ 44, 44, 44, 44, 41, 44, 49, 49, 49, 44,
+ 49, 46, 2, 44, 58, 46, 44, 44, 44, 15,
+ 46, 49, 49, 44, 44, 44, 46, 44, 44, 44,
+ 49, 15, 49, 49, 44, 81, 44, 52, 44, 60,
+ 50, 81, 50, 44, 50, 44, 44, 44, 99, 3,
+ 49, 49, 13, 37, 87, 56, 44, 54, 44, 20,
+ 3, 49, 48, 68, 44, 44, 44, 44, 48, 48,
+ 47, 44, 50, 46, 44, 44, 46, 46, 44, 44,
+ 46, 44, 47, 46, 44, 44, 46, 46, 44, 85,
+ 46, 3, 13, 31, 44, 15, 44, 35, -1, 49,
+ 44, 49, 44, 51, 44, 49, -1, 49, 44, 49,
+ -1, 61, -1, 49, 68, -1, 13, 37, 38, 16,
+ 41, 57, 66, -1, 66, 68, 66, 44, 44, 44,
+ -1, -1, 49, 49, 49, 51, 51, 44, 55, 44,
+ 44, 44, 49, 44, 49, 49, 49, 51, 49, -1,
+ 53, 13, 59, -1, 13, 5, 68, 16, 20, 18,
+ 5, 66, -1, 13, -1, 66, 28, 29, 13, -1,
+ 20, -1, -1, -1, -1, 20, 35, -1, 28, 29,
+ 13, -1, -1, 28, 29, -1, -1, 20, 21, 22,
+ 23, 24, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 3,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 13,
+ -1, -1, -1, -1, -1, -1, 20, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1};
+
+QT_END_NAMESPACE
diff --git a/tools/qdoc3/declarativeparser/qdeclarativejsgrammar_p.h b/tools/qdoc3/declarativeparser/qdeclarativejsgrammar_p.h
new file mode 100644
index 0000000..ed3ca19
--- /dev/null
+++ b/tools/qdoc3/declarativeparser/qdeclarativejsgrammar_p.h
@@ -0,0 +1,210 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore 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$
+**
+****************************************************************************/
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+// This file was generated by qlalr - DO NOT EDIT!
+#ifndef QDECLARATIVEJSGRAMMAR_P_H
+#define QDECLARATIVEJSGRAMMAR_P_H
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeJSGrammar
+{
+public:
+ enum VariousConstants {
+ EOF_SYMBOL = 0,
+ REDUCE_HERE = 100,
+ SHIFT_THERE = 99,
+ T_AND = 1,
+ T_AND_AND = 2,
+ T_AND_EQ = 3,
+ T_AS = 91,
+ T_AUTOMATIC_SEMICOLON = 62,
+ T_BREAK = 4,
+ T_CASE = 5,
+ T_CATCH = 6,
+ T_COLON = 7,
+ T_COMMA = 8,
+ T_COMMENT = 88,
+ T_CONST = 84,
+ T_CONTINUE = 9,
+ T_DEBUGGER = 85,
+ T_DEFAULT = 10,
+ T_DELETE = 11,
+ T_DIVIDE_ = 12,
+ T_DIVIDE_EQ = 13,
+ T_DO = 14,
+ T_DOT = 15,
+ T_ELSE = 16,
+ T_EQ = 17,
+ T_EQ_EQ = 18,
+ T_EQ_EQ_EQ = 19,
+ T_FALSE = 83,
+ T_FEED_JS_EXPRESSION = 96,
+ T_FEED_JS_PROGRAM = 98,
+ T_FEED_JS_SOURCE_ELEMENT = 97,
+ T_FEED_JS_STATEMENT = 95,
+ T_FEED_UI_OBJECT_MEMBER = 94,
+ T_FEED_UI_PROGRAM = 93,
+ T_FINALLY = 20,
+ T_FOR = 21,
+ T_FUNCTION = 22,
+ T_GE = 23,
+ T_GT = 24,
+ T_GT_GT = 25,
+ T_GT_GT_EQ = 26,
+ T_GT_GT_GT = 27,
+ T_GT_GT_GT_EQ = 28,
+ T_IDENTIFIER = 29,
+ T_IF = 30,
+ T_IMPORT = 90,
+ T_IN = 31,
+ T_INSTANCEOF = 32,
+ T_LBRACE = 33,
+ T_LBRACKET = 34,
+ T_LE = 35,
+ T_LPAREN = 36,
+ T_LT = 37,
+ T_LT_LT = 38,
+ T_LT_LT_EQ = 39,
+ T_MINUS = 40,
+ T_MINUS_EQ = 41,
+ T_MINUS_MINUS = 42,
+ T_MULTILINE_STRING_LITERAL = 87,
+ T_NEW = 43,
+ T_NOT = 44,
+ T_NOT_EQ = 45,
+ T_NOT_EQ_EQ = 46,
+ T_NULL = 81,
+ T_NUMERIC_LITERAL = 47,
+ T_ON = 92,
+ T_OR = 48,
+ T_OR_EQ = 49,
+ T_OR_OR = 50,
+ T_PLUS = 51,
+ T_PLUS_EQ = 52,
+ T_PLUS_PLUS = 53,
+ T_PROPERTY = 66,
+ T_PUBLIC = 89,
+ T_QUESTION = 54,
+ T_RBRACE = 55,
+ T_RBRACKET = 56,
+ T_READONLY = 68,
+ T_REMAINDER = 57,
+ T_REMAINDER_EQ = 58,
+ T_RESERVED_WORD = 86,
+ T_RETURN = 59,
+ T_RPAREN = 60,
+ T_SEMICOLON = 61,
+ T_SIGNAL = 67,
+ T_STAR = 63,
+ T_STAR_EQ = 64,
+ T_STRING_LITERAL = 65,
+ T_SWITCH = 69,
+ T_THIS = 70,
+ T_THROW = 71,
+ T_TILDE = 72,
+ T_TRUE = 82,
+ T_TRY = 73,
+ T_TYPEOF = 74,
+ T_VAR = 75,
+ T_VOID = 76,
+ T_WHILE = 77,
+ T_WITH = 78,
+ T_XOR = 79,
+ T_XOR_EQ = 80,
+
+ ACCEPT_STATE = 645,
+ RULE_COUNT = 347,
+ STATE_COUNT = 646,
+ TERMINAL_COUNT = 101,
+ NON_TERMINAL_COUNT = 106,
+
+ GOTO_INDEX_OFFSET = 646,
+ GOTO_INFO_OFFSET = 2714,
+ GOTO_CHECK_OFFSET = 2714
+ };
+
+ static const char *const spell [];
+ static const short lhs [];
+ static const short rhs [];
+ static const short goto_default [];
+ static const short action_default [];
+ static const short action_index [];
+ static const short action_info [];
+ static const short action_check [];
+
+ static inline int nt_action (int state, int nt)
+ {
+ const int yyn = action_index [GOTO_INDEX_OFFSET + state] + nt;
+ if (yyn < 0 || action_check [GOTO_CHECK_OFFSET + yyn] != nt)
+ return goto_default [nt];
+
+ return action_info [GOTO_INFO_OFFSET + yyn];
+ }
+
+ static inline int t_action (int state, int token)
+ {
+ const int yyn = action_index [state] + token;
+
+ if (yyn < 0 || action_check [yyn] != token)
+ return - action_default [state];
+
+ return action_info [yyn];
+ }
+};
+
+
+QT_END_NAMESPACE
+#endif // QDECLARATIVEJSGRAMMAR_P_H
+
diff --git a/tools/qdoc3/declarativeparser/qdeclarativejslexer.cpp b/tools/qdoc3/declarativeparser/qdeclarativejslexer.cpp
new file mode 100644
index 0000000..4dfef45
--- /dev/null
+++ b/tools/qdoc3/declarativeparser/qdeclarativejslexer.cpp
@@ -0,0 +1,1258 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative 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$
+**
+****************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "private/qdeclarativejslexer_p.h"
+
+#include "private/qdeclarativejsglobal_p.h"
+#include "private/qdeclarativejsengine_p.h"
+#include "private/qdeclarativejsgrammar_p.h"
+
+#include <QtCore/qcoreapplication.h>
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+QT_BEGIN_NAMESPACE
+Q_CORE_EXPORT double qstrtod(const char *s00, char const **se, bool *ok);
+QT_END_NAMESPACE
+
+QT_QML_BEGIN_NAMESPACE
+
+#define shiftWindowsLineBreak() \
+ do { \
+ if (((current == '\r') && (next1 == '\n')) \
+ || ((current == '\n') && (next1 == '\r'))) { \
+ shift(1); \
+ } \
+ } \
+ while (0)
+
+namespace QDeclarativeJS {
+extern double integerFromString(const char *buf, int size, int radix);
+}
+
+using namespace QDeclarativeJS;
+
+Lexer::Lexer(Engine *eng, bool tokenizeComments)
+ : driver(eng),
+ yylineno(0),
+ done(false),
+ size8(128), size16(128),
+ pos8(0), pos16(0),
+ terminator(false),
+ restrKeyword(false),
+ delimited(false),
+ stackToken(-1),
+ state(Start),
+ pos(0),
+ code(0), length(0),
+ yycolumn(0),
+ startpos(0),
+ startlineno(0), startcolumn(0),
+ bol(true),
+ current(0), next1(0), next2(0), next3(0),
+ err(NoError),
+ wantRx(false),
+ check_reserved(true),
+ parenthesesState(IgnoreParentheses),
+ parenthesesCount(0),
+ prohibitAutomaticSemicolon(false),
+ tokenizeComments(tokenizeComments)
+{
+ if (driver) driver->setLexer(this);
+ // allocate space for read buffers
+ buffer8 = new char[size8];
+ buffer16 = new QChar[size16];
+ pattern = 0;
+ flags = 0;
+
+}
+
+Lexer::~Lexer()
+{
+ delete [] buffer8;
+ delete [] buffer16;
+}
+
+void Lexer::setCode(const QString &c, int lineno)
+{
+ errmsg.clear();
+ yylineno = lineno;
+ yycolumn = 1;
+ restrKeyword = false;
+ delimited = false;
+ stackToken = -1;
+ pos = 0;
+ code = c.unicode();
+ length = c.length();
+ bol = true;
+
+ // read first characters
+ current = (length > 0) ? code[0].unicode() : 0;
+ next1 = (length > 1) ? code[1].unicode() : 0;
+ next2 = (length > 2) ? code[2].unicode() : 0;
+ next3 = (length > 3) ? code[3].unicode() : 0;
+}
+
+void Lexer::shift(uint p)
+{
+ while (p--) {
+ ++pos;
+ ++yycolumn;
+ current = next1;
+ next1 = next2;
+ next2 = next3;
+ next3 = (pos + 3 < length) ? code[pos+3].unicode() : 0;
+ }
+}
+
+void Lexer::setDone(State s)
+{
+ state = s;
+ done = true;
+}
+
+int Lexer::findReservedWord(const QChar *c, int size) const
+{
+ switch (size) {
+ case 2: {
+ if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('o'))
+ return QDeclarativeJSGrammar::T_DO;
+ else if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('f'))
+ return QDeclarativeJSGrammar::T_IF;
+ else if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('n'))
+ return QDeclarativeJSGrammar::T_IN;
+ else if (c[0] == QLatin1Char('a') && c[1] == QLatin1Char('s'))
+ return QDeclarativeJSGrammar::T_AS;
+ else if (c[0] == QLatin1Char('o') && c[1] == QLatin1Char('n'))
+ return QDeclarativeJSGrammar::T_ON;
+ } break;
+
+ case 3: {
+ if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('o') && c[2] == QLatin1Char('r'))
+ return QDeclarativeJSGrammar::T_FOR;
+ else if (c[0] == QLatin1Char('n') && c[1] == QLatin1Char('e') && c[2] == QLatin1Char('w'))
+ return QDeclarativeJSGrammar::T_NEW;
+ else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('r') && c[2] == QLatin1Char('y'))
+ return QDeclarativeJSGrammar::T_TRY;
+ else if (c[0] == QLatin1Char('v') && c[1] == QLatin1Char('a') && c[2] == QLatin1Char('r'))
+ return QDeclarativeJSGrammar::T_VAR;
+ else if (check_reserved) {
+ if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('n') && c[2] == QLatin1Char('t'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ }
+ } break;
+
+ case 4: {
+ if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('a')
+ && c[2] == QLatin1Char('s') && c[3] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_CASE;
+ else if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('l')
+ && c[2] == QLatin1Char('s') && c[3] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_ELSE;
+ else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('h')
+ && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('s'))
+ return QDeclarativeJSGrammar::T_THIS;
+ else if (c[0] == QLatin1Char('v') && c[1] == QLatin1Char('o')
+ && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('d'))
+ return QDeclarativeJSGrammar::T_VOID;
+ else if (c[0] == QLatin1Char('w') && c[1] == QLatin1Char('i')
+ && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('h'))
+ return QDeclarativeJSGrammar::T_WITH;
+ else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('r')
+ && c[2] == QLatin1Char('u') && c[3] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_TRUE;
+ else if (c[0] == QLatin1Char('n') && c[1] == QLatin1Char('u')
+ && c[2] == QLatin1Char('l') && c[3] == QLatin1Char('l'))
+ return QDeclarativeJSGrammar::T_NULL;
+ else if (check_reserved) {
+ if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('n')
+ && c[2] == QLatin1Char('u') && c[3] == QLatin1Char('m'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('b') && c[1] == QLatin1Char('y')
+ && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('l') && c[1] == QLatin1Char('o')
+ && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('g'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('h')
+ && c[2] == QLatin1Char('a') && c[3] == QLatin1Char('r'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('g') && c[1] == QLatin1Char('o')
+ && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('o'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ }
+ } break;
+
+ case 5: {
+ if (c[0] == QLatin1Char('b') && c[1] == QLatin1Char('r')
+ && c[2] == QLatin1Char('e') && c[3] == QLatin1Char('a')
+ && c[4] == QLatin1Char('k'))
+ return QDeclarativeJSGrammar::T_BREAK;
+ else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('a')
+ && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('c')
+ && c[4] == QLatin1Char('h'))
+ return QDeclarativeJSGrammar::T_CATCH;
+ else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('h')
+ && c[2] == QLatin1Char('r') && c[3] == QLatin1Char('o')
+ && c[4] == QLatin1Char('w'))
+ return QDeclarativeJSGrammar::T_THROW;
+ else if (c[0] == QLatin1Char('w') && c[1] == QLatin1Char('h')
+ && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('l')
+ && c[4] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_WHILE;
+ else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('o')
+ && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('s')
+ && c[4] == QLatin1Char('t'))
+ return QDeclarativeJSGrammar::T_CONST;
+ else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('a')
+ && c[2] == QLatin1Char('l') && c[3] == QLatin1Char('s')
+ && c[4] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_FALSE;
+ else if (check_reserved) {
+ if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('h')
+ && c[2] == QLatin1Char('o') && c[3] == QLatin1Char('r')
+ && c[4] == QLatin1Char('t'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('u')
+ && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('e')
+ && c[4] == QLatin1Char('r'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('i')
+ && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('a')
+ && c[4] == QLatin1Char('l'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('l')
+ && c[2] == QLatin1Char('a') && c[3] == QLatin1Char('s')
+ && c[4] == QLatin1Char('s'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('l')
+ && c[2] == QLatin1Char('o') && c[3] == QLatin1Char('a')
+ && c[4] == QLatin1Char('t'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ }
+ } break;
+
+ case 6: {
+ if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('e')
+ && c[2] == QLatin1Char('l') && c[3] == QLatin1Char('e')
+ && c[4] == QLatin1Char('t') && c[5] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_DELETE;
+ else if (c[0] == QLatin1Char('r') && c[1] == QLatin1Char('e')
+ && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('u')
+ && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('n'))
+ return QDeclarativeJSGrammar::T_RETURN;
+ else if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('w')
+ && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('t')
+ && c[4] == QLatin1Char('c') && c[5] == QLatin1Char('h'))
+ return QDeclarativeJSGrammar::T_SWITCH;
+ else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('y')
+ && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('e')
+ && c[4] == QLatin1Char('o') && c[5] == QLatin1Char('f'))
+ return QDeclarativeJSGrammar::T_TYPEOF;
+ else if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('m')
+ && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('o')
+ && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('t'))
+ return QDeclarativeJSGrammar::T_IMPORT;
+ else if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('i')
+ && c[2] == QLatin1Char('g') && c[3] == QLatin1Char('n')
+ && c[4] == QLatin1Char('a') && c[5] == QLatin1Char('l'))
+ return QDeclarativeJSGrammar::T_SIGNAL;
+ else if (check_reserved) {
+ if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('x')
+ && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('o')
+ && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('t'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('t')
+ && c[2] == QLatin1Char('a') && c[3] == QLatin1Char('t')
+ && c[4] == QLatin1Char('i') && c[5] == QLatin1Char('c'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('o')
+ && c[2] == QLatin1Char('u') && c[3] == QLatin1Char('b')
+ && c[4] == QLatin1Char('l') && c[5] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('m')
+ && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('o')
+ && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('t'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('u')
+ && c[2] == QLatin1Char('b') && c[3] == QLatin1Char('l')
+ && c[4] == QLatin1Char('i') && c[5] == QLatin1Char('c'))
+ return QDeclarativeJSGrammar::T_PUBLIC;
+ else if (c[0] == QLatin1Char('n') && c[1] == QLatin1Char('a')
+ && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('i')
+ && c[4] == QLatin1Char('v') && c[5] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('h')
+ && c[2] == QLatin1Char('r') && c[3] == QLatin1Char('o')
+ && c[4] == QLatin1Char('w') && c[5] == QLatin1Char('s'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ }
+ } break;
+
+ case 7: {
+ if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('e')
+ && c[2] == QLatin1Char('f') && c[3] == QLatin1Char('a')
+ && c[4] == QLatin1Char('u') && c[5] == QLatin1Char('l')
+ && c[6] == QLatin1Char('t'))
+ return QDeclarativeJSGrammar::T_DEFAULT;
+ else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('i')
+ && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('a')
+ && c[4] == QLatin1Char('l') && c[5] == QLatin1Char('l')
+ && c[6] == QLatin1Char('y'))
+ return QDeclarativeJSGrammar::T_FINALLY;
+ else if (check_reserved) {
+ if (c[0] == QLatin1Char('b') && c[1] == QLatin1Char('o')
+ && c[2] == QLatin1Char('o') && c[3] == QLatin1Char('l')
+ && c[4] == QLatin1Char('e') && c[5] == QLatin1Char('a')
+ && c[6] == QLatin1Char('n'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('x')
+ && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('e')
+ && c[4] == QLatin1Char('n') && c[5] == QLatin1Char('d')
+ && c[6] == QLatin1Char('s'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('a')
+ && c[2] == QLatin1Char('c') && c[3] == QLatin1Char('k')
+ && c[4] == QLatin1Char('a') && c[5] == QLatin1Char('g')
+ && c[6] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('r')
+ && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('v')
+ && c[4] == QLatin1Char('a') && c[5] == QLatin1Char('t')
+ && c[6] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ }
+ } break;
+
+ case 8: {
+ if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('o')
+ && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('t')
+ && c[4] == QLatin1Char('i') && c[5] == QLatin1Char('n')
+ && c[6] == QLatin1Char('u') && c[7] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_CONTINUE;
+ else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('u')
+ && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('c')
+ && c[4] == QLatin1Char('t') && c[5] == QLatin1Char('i')
+ && c[6] == QLatin1Char('o') && c[7] == QLatin1Char('n'))
+ return QDeclarativeJSGrammar::T_FUNCTION;
+ else if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('e')
+ && c[2] == QLatin1Char('b') && c[3] == QLatin1Char('u')
+ && c[4] == QLatin1Char('g') && c[5] == QLatin1Char('g')
+ && c[6] == QLatin1Char('e') && c[7] == QLatin1Char('r'))
+ return QDeclarativeJSGrammar::T_DEBUGGER;
+ else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('r')
+ && c[2] == QLatin1Char('o') && c[3] == QLatin1Char('p')
+ && c[4] == QLatin1Char('e') && c[5] == QLatin1Char('r')
+ && c[6] == QLatin1Char('t') && c[7] == QLatin1Char('y'))
+ return QDeclarativeJSGrammar::T_PROPERTY;
+ else if (c[0] == QLatin1Char('r') && c[1] == QLatin1Char('e')
+ && c[2] == QLatin1Char('a') && c[3] == QLatin1Char('d')
+ && c[4] == QLatin1Char('o') && c[5] == QLatin1Char('n')
+ && c[6] == QLatin1Char('l') && c[7] == QLatin1Char('y'))
+ return QDeclarativeJSGrammar::T_READONLY;
+ else if (check_reserved) {
+ if (c[0] == QLatin1Char('a') && c[1] == QLatin1Char('b')
+ && c[2] == QLatin1Char('s') && c[3] == QLatin1Char('t')
+ && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('a')
+ && c[6] == QLatin1Char('c') && c[7] == QLatin1Char('t'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('v') && c[1] == QLatin1Char('o')
+ && c[2] == QLatin1Char('l') && c[3] == QLatin1Char('a')
+ && c[4] == QLatin1Char('t') && c[5] == QLatin1Char('i')
+ && c[6] == QLatin1Char('l') && c[7] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ }
+ } break;
+
+ case 9: {
+ if (check_reserved) {
+ if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('n')
+ && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('e')
+ && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('f')
+ && c[6] == QLatin1Char('a') && c[7] == QLatin1Char('c')
+ && c[8] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('r')
+ && c[2] == QLatin1Char('a') && c[3] == QLatin1Char('n')
+ && c[4] == QLatin1Char('s') && c[5] == QLatin1Char('i')
+ && c[6] == QLatin1Char('e') && c[7] == QLatin1Char('n')
+ && c[8] == QLatin1Char('t'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('r')
+ && c[2] == QLatin1Char('o') && c[3] == QLatin1Char('t')
+ && c[4] == QLatin1Char('e') && c[5] == QLatin1Char('c')
+ && c[6] == QLatin1Char('t') && c[7] == QLatin1Char('e')
+ && c[8] == QLatin1Char('d'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ }
+ } break;
+
+ case 10: {
+ if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('n')
+ && c[2] == QLatin1Char('s') && c[3] == QLatin1Char('t')
+ && c[4] == QLatin1Char('a') && c[5] == QLatin1Char('n')
+ && c[6] == QLatin1Char('c') && c[7] == QLatin1Char('e')
+ && c[8] == QLatin1Char('o') && c[9] == QLatin1Char('f'))
+ return QDeclarativeJSGrammar::T_INSTANCEOF;
+ else if (check_reserved) {
+ if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('m')
+ && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('l')
+ && c[4] == QLatin1Char('e') && c[5] == QLatin1Char('m')
+ && c[6] == QLatin1Char('e') && c[7] == QLatin1Char('n')
+ && c[8] == QLatin1Char('t') && c[9] == QLatin1Char('s'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ }
+ } break;
+
+ case 12: {
+ if (check_reserved) {
+ if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('y')
+ && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('c')
+ && c[4] == QLatin1Char('h') && c[5] == QLatin1Char('r')
+ && c[6] == QLatin1Char('o') && c[7] == QLatin1Char('n')
+ && c[8] == QLatin1Char('i') && c[9] == QLatin1Char('z')
+ && c[10] == QLatin1Char('e') && c[11] == QLatin1Char('d'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ }
+ } break;
+
+ } // switch
+
+ return -1;
+}
+
+int Lexer::lex()
+{
+ int token = 0;
+ state = Start;
+ ushort stringType = 0; // either single or double quotes
+ bool multiLineString = false;
+ pos8 = pos16 = 0;
+ done = false;
+ terminator = false;
+
+ // did we push a token on the stack previously ?
+ // (after an automatic semicolon insertion)
+ if (stackToken >= 0) {
+ setDone(Other);
+ token = stackToken;
+ stackToken = -1;
+ }
+
+ bool identifierWithEscapedUnicode = false;
+
+ while (!done) {
+ switch (state) {
+ case Start:
+ if (isWhiteSpace()) {
+ // do nothing
+ } else if (current == '/' && next1 == '/') {
+ recordStartPos();
+ shift(1);
+ state = InSingleLineComment;
+ } else if (current == '/' && next1 == '*') {
+ recordStartPos();
+ shift(1);
+ state = InMultiLineComment;
+ } else if (current == 0) {
+ syncProhibitAutomaticSemicolon();
+ if (!terminator && !delimited && !prohibitAutomaticSemicolon) {
+ // automatic semicolon insertion if program incomplete
+ token = QDeclarativeJSGrammar::T_SEMICOLON;
+ stackToken = 0;
+ setDone(Other);
+ } else {
+ setDone(Eof);
+ }
+ } else if (isLineTerminator()) {
+ if (restrKeyword) {
+ // automatic semicolon insertion
+ recordStartPos();
+ token = QDeclarativeJSGrammar::T_SEMICOLON;
+ setDone(Other);
+ } else {
+ shiftWindowsLineBreak();
+ yylineno++;
+ yycolumn = 0;
+ bol = true;
+ terminator = true;
+ syncProhibitAutomaticSemicolon();
+ }
+ } else if (current == '"' || current == '\'') {
+ recordStartPos();
+ state = InString;
+ multiLineString = false;
+ stringType = current;
+ } else if (current == '\\' && next1 == 'u') {
+ identifierWithEscapedUnicode = true;
+ recordStartPos();
+
+ shift(2); // skip the unicode escape prefix `\u'
+
+ if (isHexDigit(current) && isHexDigit(next1) &&
+ isHexDigit(next2) && isHexDigit(next3)) {
+ record16(convertUnicode(current, next1, next2, next3));
+ shift(3);
+ state = InIdentifier;
+ } else {
+ setDone(Bad);
+ err = IllegalUnicodeEscapeSequence;
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Illegal unicode escape sequence");
+ break;
+ }
+
+ } else if (isIdentLetter(current)) {
+ identifierWithEscapedUnicode = false;
+ recordStartPos();
+ record16(current);
+ state = InIdentifier;
+ } else if (current == '0') {
+ recordStartPos();
+ record8(current);
+ state = InNum0;
+ } else if (isDecimalDigit(current)) {
+ recordStartPos();
+ record8(current);
+ state = InNum;
+ } else if (current == '.' && isDecimalDigit(next1)) {
+ recordStartPos();
+ record8(current);
+ state = InDecimal;
+ } else {
+ recordStartPos();
+ token = matchPunctuator(current, next1, next2, next3);
+ if (token != -1) {
+ if (terminator && !delimited && !prohibitAutomaticSemicolon
+ && (token == QDeclarativeJSGrammar::T_PLUS_PLUS
+ || token == QDeclarativeJSGrammar::T_MINUS_MINUS)) {
+ // automatic semicolon insertion
+ stackToken = token;
+ token = QDeclarativeJSGrammar::T_SEMICOLON;
+ }
+ setDone(Other);
+ }
+ else {
+ setDone(Bad);
+ err = IllegalCharacter;
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Illegal character");
+ }
+ }
+ break;
+ case InString:
+ if (current == stringType) {
+ shift(1);
+ setDone(String);
+ } else if (isLineTerminator()) {
+ multiLineString = true;
+ record16(current);
+ } else if (current == 0 || isLineTerminator()) {
+ setDone(Bad);
+ err = UnclosedStringLiteral;
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Unclosed string at end of line");
+ } else if (current == '\\') {
+ state = InEscapeSequence;
+ } else {
+ record16(current);
+ }
+ break;
+ // Escape Sequences inside of strings
+ case InEscapeSequence:
+ if (isOctalDigit(current)) {
+ if (current >= '0' && current <= '3' &&
+ isOctalDigit(next1) && isOctalDigit(next2)) {
+ record16(convertOctal(current, next1, next2));
+ shift(2);
+ state = InString;
+ } else if (isOctalDigit(current) &&
+ isOctalDigit(next1)) {
+ record16(convertOctal('0', current, next1));
+ shift(1);
+ state = InString;
+ } else if (isOctalDigit(current)) {
+ record16(convertOctal('0', '0', current));
+ state = InString;
+ } else {
+ setDone(Bad);
+ err = IllegalEscapeSequence;
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Illegal escape sequence");
+ }
+ } else if (current == 'x')
+ state = InHexEscape;
+ else if (current == 'u')
+ state = InUnicodeEscape;
+ else {
+ if (isLineTerminator()) {
+ shiftWindowsLineBreak();
+ yylineno++;
+ yycolumn = 0;
+ bol = true;
+ } else {
+ record16(singleEscape(current));
+ }
+ state = InString;
+ }
+ break;
+ case InHexEscape:
+ if (isHexDigit(current) && isHexDigit(next1)) {
+ state = InString;
+ record16(QLatin1Char(convertHex(current, next1)));
+ shift(1);
+ } else if (current == stringType) {
+ record16(QLatin1Char('x'));
+ shift(1);
+ setDone(String);
+ } else {
+ record16(QLatin1Char('x'));
+ record16(current);
+ state = InString;
+ }
+ break;
+ case InUnicodeEscape:
+ if (isHexDigit(current) && isHexDigit(next1) &&
+ isHexDigit(next2) && isHexDigit(next3)) {
+ record16(convertUnicode(current, next1, next2, next3));
+ shift(3);
+ state = InString;
+ } else if (current == stringType) {
+ record16(QLatin1Char('u'));
+ shift(1);
+ setDone(String);
+ } else {
+ setDone(Bad);
+ err = IllegalUnicodeEscapeSequence;
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Illegal unicode escape sequence");
+ }
+ break;
+ case InSingleLineComment:
+ if (isLineTerminator()) {
+ shiftWindowsLineBreak();
+ yylineno++;
+ yycolumn = 0;
+ terminator = true;
+ bol = true;
+ if (restrKeyword) {
+ token = QDeclarativeJSGrammar::T_SEMICOLON;
+ setDone(Other);
+ } else
+ state = Start;
+ if (driver) driver->addComment(startpos+2, tokenLength()-2, startlineno, startcolumn+2);
+ } else if (current == 0) {
+ if (driver) driver->addComment(startpos+2, tokenLength()-2, startlineno, startcolumn+2);
+ setDone(Eof);
+ }
+
+ break;
+ case InMultiLineComment:
+ if (current == 0) {
+ setDone(Bad);
+ err = UnclosedComment;
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Unclosed comment at end of file");
+ if (driver) driver->addComment(startpos+2, tokenLength()-2, startlineno, startcolumn+2);
+ } else if (isLineTerminator()) {
+ shiftWindowsLineBreak();
+ yylineno++;
+ } else if (current == '*' && next1 == '/') {
+ state = Start;
+ shift(1);
+ if (driver) driver->addComment(startpos+2, tokenLength()-3, startlineno, startcolumn+2);
+ }
+
+ break;
+ case InIdentifier:
+ if (isIdentLetter(current) || isDecimalDigit(current)) {
+ record16(current);
+ break;
+ } else if (current == '\\' && next1 == 'u') {
+ identifierWithEscapedUnicode = true;
+ shift(2); // skip the unicode escape prefix `\u'
+
+ if (isHexDigit(current) && isHexDigit(next1) &&
+ isHexDigit(next2) && isHexDigit(next3)) {
+ record16(convertUnicode(current, next1, next2, next3));
+ shift(3);
+ break;
+ } else {
+ setDone(Bad);
+ err = IllegalUnicodeEscapeSequence;
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Illegal unicode escape sequence");
+ break;
+ }
+ }
+ setDone(Identifier);
+ break;
+ case InNum0:
+ if (current == 'x' || current == 'X') {
+ record8(current);
+ state = InHex;
+ } else if (current == '.') {
+ record8(current);
+ state = InDecimal;
+ } else if (current == 'e' || current == 'E') {
+ record8(current);
+ state = InExponentIndicator;
+ } else if (isOctalDigit(current)) {
+ record8(current);
+ state = InOctal;
+ } else if (isDecimalDigit(current)) {
+ record8(current);
+ state = InDecimal;
+ } else {
+ setDone(Number);
+ }
+ break;
+ case InHex:
+ if (isHexDigit(current))
+ record8(current);
+ else
+ setDone(Hex);
+ break;
+ case InOctal:
+ if (isOctalDigit(current)) {
+ record8(current);
+ } else if (isDecimalDigit(current)) {
+ record8(current);
+ state = InDecimal;
+ } else {
+ setDone(Octal);
+ }
+ break;
+ case InNum:
+ if (isDecimalDigit(current)) {
+ record8(current);
+ } else if (current == '.') {
+ record8(current);
+ state = InDecimal;
+ } else if (current == 'e' || current == 'E') {
+ record8(current);
+ state = InExponentIndicator;
+ } else {
+ setDone(Number);
+ }
+ break;
+ case InDecimal:
+ if (isDecimalDigit(current)) {
+ record8(current);
+ } else if (current == 'e' || current == 'E') {
+ record8(current);
+ state = InExponentIndicator;
+ } else {
+ setDone(Number);
+ }
+ break;
+ case InExponentIndicator:
+ if (current == '+' || current == '-') {
+ record8(current);
+ } else if (isDecimalDigit(current)) {
+ record8(current);
+ state = InExponent;
+ } else {
+ setDone(Bad);
+ err = IllegalExponentIndicator;
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Illegal syntax for exponential number");
+ }
+ break;
+ case InExponent:
+ if (isDecimalDigit(current)) {
+ record8(current);
+ } else {
+ setDone(Number);
+ }
+ break;
+ default:
+ Q_ASSERT_X(0, "Lexer::lex", "Unhandled state in switch statement");
+ }
+
+ // move on to the next character
+ if (!done)
+ shift(1);
+ if (state != Start && state != InSingleLineComment)
+ bol = false;
+ }
+
+ // no identifiers allowed directly after numeric literal, e.g. "3in" is bad
+ if ((state == Number || state == Octal || state == Hex)
+ && isIdentLetter(current)) {
+ state = Bad;
+ err = IllegalIdentifier;
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Identifier cannot start with numeric literal");
+ }
+
+ // terminate string
+ buffer8[pos8] = '\0';
+
+ double dval = 0;
+ if (state == Number) {
+ dval = qstrtod(buffer8, 0, 0);
+ } else if (state == Hex) { // scan hex numbers
+ dval = integerFromString(buffer8, pos8, 16);
+ state = Number;
+ } else if (state == Octal) { // scan octal number
+ dval = integerFromString(buffer8, pos8, 8);
+ state = Number;
+ }
+
+ restrKeyword = false;
+ delimited = false;
+
+ switch (parenthesesState) {
+ case IgnoreParentheses:
+ break;
+ case CountParentheses:
+ if (token == QDeclarativeJSGrammar::T_RPAREN) {
+ --parenthesesCount;
+ if (parenthesesCount == 0)
+ parenthesesState = BalancedParentheses;
+ } else if (token == QDeclarativeJSGrammar::T_LPAREN) {
+ ++parenthesesCount;
+ }
+ break;
+ case BalancedParentheses:
+ parenthesesState = IgnoreParentheses;
+ break;
+ }
+
+ switch (state) {
+ case Eof:
+ return 0;
+ case Other:
+ if (token == QDeclarativeJSGrammar::T_RBRACE || token == QDeclarativeJSGrammar::T_SEMICOLON)
+ delimited = true;
+ return token;
+ case Identifier:
+ token = -1;
+ if (! identifierWithEscapedUnicode)
+ token = findReservedWord(buffer16, pos16);
+
+ if (token < 0) {
+ /* TODO: close leak on parse error. same holds true for String */
+ if (driver)
+ qsyylval.ustr = driver->intern(buffer16, pos16);
+ else
+ qsyylval.ustr = 0;
+ return QDeclarativeJSGrammar::T_IDENTIFIER;
+ }
+ if (token == QDeclarativeJSGrammar::T_CONTINUE || token == QDeclarativeJSGrammar::T_BREAK
+ || token == QDeclarativeJSGrammar::T_RETURN || token == QDeclarativeJSGrammar::T_THROW) {
+ restrKeyword = true;
+ } else if (token == QDeclarativeJSGrammar::T_IF || token == QDeclarativeJSGrammar::T_FOR
+ || token == QDeclarativeJSGrammar::T_WHILE || token == QDeclarativeJSGrammar::T_WITH) {
+ parenthesesState = CountParentheses;
+ parenthesesCount = 0;
+ } else if (token == QDeclarativeJSGrammar::T_DO) {
+ parenthesesState = BalancedParentheses;
+ }
+ return token;
+ case String:
+ if (driver)
+ qsyylval.ustr = driver->intern(buffer16, pos16);
+ else
+ qsyylval.ustr = 0;
+ return multiLineString?QDeclarativeJSGrammar::T_MULTILINE_STRING_LITERAL:QDeclarativeJSGrammar::T_STRING_LITERAL;
+ case Number:
+ qsyylval.dval = dval;
+ return QDeclarativeJSGrammar::T_NUMERIC_LITERAL;
+ case Bad:
+ return -1;
+ default:
+ Q_ASSERT(!"unhandled numeration value in switch");
+ return -1;
+ }
+}
+
+bool Lexer::isWhiteSpace() const
+{
+ return (current == ' ' || current == '\t' ||
+ current == 0x0b || current == 0x0c);
+}
+
+bool Lexer::isLineTerminator() const
+{
+ return (current == '\n' || current == '\r');
+}
+
+bool Lexer::isIdentLetter(ushort c)
+{
+ // ASCII-biased, since all reserved words are ASCII, aand hence the
+ // bulk of content to be parsed.
+ if ((c >= 'a' && c <= 'z')
+ || (c >= 'A' && c <= 'Z')
+ || c == '$'
+ || c == '_')
+ return true;
+ if (c < 128)
+ return false;
+ return QChar(c).isLetterOrNumber();
+}
+
+bool Lexer::isDecimalDigit(ushort c)
+{
+ return (c >= '0' && c <= '9');
+}
+
+bool Lexer::isHexDigit(ushort c) const
+{
+ return ((c >= '0' && c <= '9')
+ || (c >= 'a' && c <= 'f')
+ || (c >= 'A' && c <= 'F'));
+}
+
+bool Lexer::isOctalDigit(ushort c) const
+{
+ return (c >= '0' && c <= '7');
+}
+
+int Lexer::matchPunctuator(ushort c1, ushort c2,
+ ushort c3, ushort c4)
+{
+ if (c1 == '>' && c2 == '>' && c3 == '>' && c4 == '=') {
+ shift(4);
+ return QDeclarativeJSGrammar::T_GT_GT_GT_EQ;
+ } else if (c1 == '=' && c2 == '=' && c3 == '=') {
+ shift(3);
+ return QDeclarativeJSGrammar::T_EQ_EQ_EQ;
+ } else if (c1 == '!' && c2 == '=' && c3 == '=') {
+ shift(3);
+ return QDeclarativeJSGrammar::T_NOT_EQ_EQ;
+ } else if (c1 == '>' && c2 == '>' && c3 == '>') {
+ shift(3);
+ return QDeclarativeJSGrammar::T_GT_GT_GT;
+ } else if (c1 == '<' && c2 == '<' && c3 == '=') {
+ shift(3);
+ return QDeclarativeJSGrammar::T_LT_LT_EQ;
+ } else if (c1 == '>' && c2 == '>' && c3 == '=') {
+ shift(3);
+ return QDeclarativeJSGrammar::T_GT_GT_EQ;
+ } else if (c1 == '<' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_LE;
+ } else if (c1 == '>' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_GE;
+ } else if (c1 == '!' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_NOT_EQ;
+ } else if (c1 == '+' && c2 == '+') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_PLUS_PLUS;
+ } else if (c1 == '-' && c2 == '-') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_MINUS_MINUS;
+ } else if (c1 == '=' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_EQ_EQ;
+ } else if (c1 == '+' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_PLUS_EQ;
+ } else if (c1 == '-' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_MINUS_EQ;
+ } else if (c1 == '*' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_STAR_EQ;
+ } else if (c1 == '/' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_DIVIDE_EQ;
+ } else if (c1 == '&' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_AND_EQ;
+ } else if (c1 == '^' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_XOR_EQ;
+ } else if (c1 == '%' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_REMAINDER_EQ;
+ } else if (c1 == '|' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_OR_EQ;
+ } else if (c1 == '<' && c2 == '<') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_LT_LT;
+ } else if (c1 == '>' && c2 == '>') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_GT_GT;
+ } else if (c1 == '&' && c2 == '&') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_AND_AND;
+ } else if (c1 == '|' && c2 == '|') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_OR_OR;
+ }
+
+ switch(c1) {
+ case '=': shift(1); return QDeclarativeJSGrammar::T_EQ;
+ case '>': shift(1); return QDeclarativeJSGrammar::T_GT;
+ case '<': shift(1); return QDeclarativeJSGrammar::T_LT;
+ case ',': shift(1); return QDeclarativeJSGrammar::T_COMMA;
+ case '!': shift(1); return QDeclarativeJSGrammar::T_NOT;
+ case '~': shift(1); return QDeclarativeJSGrammar::T_TILDE;
+ case '?': shift(1); return QDeclarativeJSGrammar::T_QUESTION;
+ case ':': shift(1); return QDeclarativeJSGrammar::T_COLON;
+ case '.': shift(1); return QDeclarativeJSGrammar::T_DOT;
+ case '+': shift(1); return QDeclarativeJSGrammar::T_PLUS;
+ case '-': shift(1); return QDeclarativeJSGrammar::T_MINUS;
+ case '*': shift(1); return QDeclarativeJSGrammar::T_STAR;
+ case '/': shift(1); return QDeclarativeJSGrammar::T_DIVIDE_;
+ case '&': shift(1); return QDeclarativeJSGrammar::T_AND;
+ case '|': shift(1); return QDeclarativeJSGrammar::T_OR;
+ case '^': shift(1); return QDeclarativeJSGrammar::T_XOR;
+ case '%': shift(1); return QDeclarativeJSGrammar::T_REMAINDER;
+ case '(': shift(1); return QDeclarativeJSGrammar::T_LPAREN;
+ case ')': shift(1); return QDeclarativeJSGrammar::T_RPAREN;
+ case '{': shift(1); return QDeclarativeJSGrammar::T_LBRACE;
+ case '}': shift(1); return QDeclarativeJSGrammar::T_RBRACE;
+ case '[': shift(1); return QDeclarativeJSGrammar::T_LBRACKET;
+ case ']': shift(1); return QDeclarativeJSGrammar::T_RBRACKET;
+ case ';': shift(1); return QDeclarativeJSGrammar::T_SEMICOLON;
+
+ default: return -1;
+ }
+}
+
+ushort Lexer::singleEscape(ushort c) const
+{
+ switch(c) {
+ case 'b':
+ return 0x08;
+ case 't':
+ return 0x09;
+ case 'n':
+ return 0x0A;
+ case 'v':
+ return 0x0B;
+ case 'f':
+ return 0x0C;
+ case 'r':
+ return 0x0D;
+ case '"':
+ return 0x22;
+ case '\'':
+ return 0x27;
+ case '\\':
+ return 0x5C;
+ default:
+ return c;
+ }
+}
+
+ushort Lexer::convertOctal(ushort c1, ushort c2,
+ ushort c3) const
+{
+ return ((c1 - '0') * 64 + (c2 - '0') * 8 + c3 - '0');
+}
+
+unsigned char Lexer::convertHex(ushort c)
+{
+ if (c >= '0' && c <= '9')
+ return (c - '0');
+ else if (c >= 'a' && c <= 'f')
+ return (c - 'a' + 10);
+ else
+ return (c - 'A' + 10);
+}
+
+unsigned char Lexer::convertHex(ushort c1, ushort c2)
+{
+ return ((convertHex(c1) << 4) + convertHex(c2));
+}
+
+QChar Lexer::convertUnicode(ushort c1, ushort c2,
+ ushort c3, ushort c4)
+{
+ return QChar((convertHex(c3) << 4) + convertHex(c4),
+ (convertHex(c1) << 4) + convertHex(c2));
+}
+
+void Lexer::record8(ushort c)
+{
+ Q_ASSERT(c <= 0xff);
+
+ // enlarge buffer if full
+ if (pos8 >= size8 - 1) {
+ char *tmp = new char[2 * size8];
+ memcpy(tmp, buffer8, size8 * sizeof(char));
+ delete [] buffer8;
+ buffer8 = tmp;
+ size8 *= 2;
+ }
+
+ buffer8[pos8++] = (char) c;
+}
+
+void Lexer::record16(QChar c)
+{
+ // enlarge buffer if full
+ if (pos16 >= size16 - 1) {
+ QChar *tmp = new QChar[2 * size16];
+ memcpy(tmp, buffer16, size16 * sizeof(QChar));
+ delete [] buffer16;
+ buffer16 = tmp;
+ size16 *= 2;
+ }
+
+ buffer16[pos16++] = c;
+}
+
+void Lexer::recordStartPos()
+{
+ startpos = pos;
+ startlineno = yylineno;
+ startcolumn = yycolumn;
+}
+
+bool Lexer::scanRegExp(RegExpBodyPrefix prefix)
+{
+ pos16 = 0;
+ pattern = 0;
+
+ if (prefix == EqualPrefix)
+ record16(QLatin1Char('='));
+
+ while (true) {
+ switch (current) {
+
+ case 0: // eof
+ case '\n': case '\r': // line terminator
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Unterminated regular expression literal");
+ return false;
+
+ case '/':
+ shift(1);
+
+ if (driver) // create the pattern
+ pattern = driver->intern(buffer16, pos16);
+
+ // scan the flags
+ pos16 = 0;
+ flags = 0;
+ while (isIdentLetter(current)) {
+ int flag = Ecma::RegExp::flagFromChar(current);
+ if (flag == 0) {
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Invalid regular expression flag '%0'")
+ .arg(QChar(current));
+ return false;
+ }
+ flags |= flag;
+ record16(current);
+ shift(1);
+ }
+ return true;
+
+ case '\\':
+ // regular expression backslash sequence
+ record16(current);
+ shift(1);
+
+ if (! current || isLineTerminator()) {
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Unterminated regular expression backslash sequence");
+ return false;
+ }
+
+ record16(current);
+ shift(1);
+ break;
+
+ case '[':
+ // regular expression class
+ record16(current);
+ shift(1);
+
+ while (current && ! isLineTerminator()) {
+ if (current == ']')
+ break;
+ else if (current == '\\') {
+ // regular expression backslash sequence
+ record16(current);
+ shift(1);
+
+ if (! current || isLineTerminator()) {
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Unterminated regular expression backslash sequence");
+ return false;
+ }
+
+ record16(current);
+ shift(1);
+ } else {
+ record16(current);
+ shift(1);
+ }
+ }
+
+ if (current != ']') {
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Unterminated regular expression class");
+ return false;
+ }
+
+ record16(current);
+ shift(1); // skip ]
+ break;
+
+ default:
+ record16(current);
+ shift(1);
+ } // switch
+ } // while
+
+ return false;
+}
+
+void Lexer::syncProhibitAutomaticSemicolon()
+{
+ if (parenthesesState == BalancedParentheses) {
+ // we have seen something like "if (foo)", which means we should
+ // never insert an automatic semicolon at this point, since it would
+ // then be expanded into an empty statement (ECMA-262 7.9.1)
+ prohibitAutomaticSemicolon = true;
+ parenthesesState = IgnoreParentheses;
+ } else {
+ prohibitAutomaticSemicolon = false;
+ }
+}
+
+QT_QML_END_NAMESPACE
+
+
diff --git a/tools/qdoc3/declarativeparser/qdeclarativejslexer_p.h b/tools/qdoc3/declarativeparser/qdeclarativejslexer_p.h
new file mode 100644
index 0000000..e41337d
--- /dev/null
+++ b/tools/qdoc3/declarativeparser/qdeclarativejslexer_p.h
@@ -0,0 +1,249 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative 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 QDECLARATIVEJSLEXER_P_H
+#define QDECLARATIVEJSLEXER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativejsglobal_p.h"
+
+#include <QtCore/QString>
+
+QT_QML_BEGIN_NAMESPACE
+
+namespace QDeclarativeJS {
+
+class Engine;
+class NameId;
+
+class QML_PARSER_EXPORT Lexer
+{
+public:
+ Lexer(Engine *eng, bool tokenizeComments = false);
+ ~Lexer();
+
+ void setCode(const QString &c, int lineno);
+ int lex();
+
+ int currentLineNo() const { return yylineno; }
+ int currentColumnNo() const { return yycolumn; }
+
+ int tokenOffset() const { return startpos; }
+ int tokenLength() const { return pos - startpos; }
+
+ int startLineNo() const { return startlineno; }
+ int startColumnNo() const { return startcolumn; }
+
+ int endLineNo() const { return currentLineNo(); }
+ int endColumnNo() const
+ { int col = currentColumnNo(); return (col > 0) ? col - 1 : col; }
+
+ bool prevTerminator() const { return terminator; }
+
+ enum State { Start,
+ Identifier,
+ InIdentifier,
+ InSingleLineComment,
+ InMultiLineComment,
+ InNum,
+ InNum0,
+ InHex,
+ InOctal,
+ InDecimal,
+ InExponentIndicator,
+ InExponent,
+ Hex,
+ Octal,
+ Number,
+ String,
+ Eof,
+ InString,
+ InEscapeSequence,
+ InHexEscape,
+ InUnicodeEscape,
+ Other,
+ Bad };
+
+ enum Error {
+ NoError,
+ IllegalCharacter,
+ UnclosedStringLiteral,
+ IllegalEscapeSequence,
+ IllegalUnicodeEscapeSequence,
+ UnclosedComment,
+ IllegalExponentIndicator,
+ IllegalIdentifier
+ };
+
+ enum ParenthesesState {
+ IgnoreParentheses,
+ CountParentheses,
+ BalancedParentheses
+ };
+
+ enum RegExpBodyPrefix {
+ NoPrefix,
+ EqualPrefix
+ };
+
+ bool scanRegExp(RegExpBodyPrefix prefix = NoPrefix);
+
+ NameId *pattern;
+ int flags;
+
+ State lexerState() const
+ { return state; }
+
+ QString errorMessage() const
+ { return errmsg; }
+ void setErrorMessage(const QString &err)
+ { errmsg = err; }
+ void setErrorMessage(const char *err)
+ { setErrorMessage(QString::fromLatin1(err)); }
+
+ Error error() const
+ { return err; }
+ void clearError()
+ { err = NoError; }
+
+private:
+ Engine *driver;
+ int yylineno;
+ bool done;
+ char *buffer8;
+ QChar *buffer16;
+ uint size8, size16;
+ uint pos8, pos16;
+ bool terminator;
+ bool restrKeyword;
+ // encountered delimiter like "'" and "}" on last run
+ bool delimited;
+ int stackToken;
+
+ State state;
+ void setDone(State s);
+ uint pos;
+ void shift(uint p);
+ int lookupKeyword(const char *);
+
+ bool isWhiteSpace() const;
+ bool isLineTerminator() const;
+ bool isHexDigit(ushort c) const;
+ bool isOctalDigit(ushort c) const;
+
+ int matchPunctuator(ushort c1, ushort c2,
+ ushort c3, ushort c4);
+ ushort singleEscape(ushort c) const;
+ ushort convertOctal(ushort c1, ushort c2,
+ ushort c3) const;
+public:
+ static unsigned char convertHex(ushort c1);
+ static unsigned char convertHex(ushort c1, ushort c2);
+ static QChar convertUnicode(ushort c1, ushort c2,
+ ushort c3, ushort c4);
+ static bool isIdentLetter(ushort c);
+ static bool isDecimalDigit(ushort c);
+
+ inline int ival() const { return qsyylval.ival; }
+ inline double dval() const { return qsyylval.dval; }
+ inline NameId *ustr() const { return qsyylval.ustr; }
+
+ const QChar *characterBuffer() const { return buffer16; }
+ int characterCount() const { return pos16; }
+
+private:
+ void record8(ushort c);
+ void record16(QChar c);
+ void recordStartPos();
+
+ int findReservedWord(const QChar *buffer, int size) const;
+
+ void syncProhibitAutomaticSemicolon();
+
+ const QChar *code;
+ uint length;
+ int yycolumn;
+ int startpos;
+ int startlineno;
+ int startcolumn;
+ int bol; // begin of line
+
+ union {
+ int ival;
+ double dval;
+ NameId *ustr;
+ } qsyylval;
+
+ // current and following unicode characters
+ ushort current, next1, next2, next3;
+
+ struct keyword {
+ const char *name;
+ int token;
+ };
+
+ QString errmsg;
+ Error err;
+
+ bool wantRx;
+ bool check_reserved;
+
+ ParenthesesState parenthesesState;
+ int parenthesesCount;
+ bool prohibitAutomaticSemicolon;
+ bool tokenizeComments;
+};
+
+} // namespace QDeclarativeJS
+
+QT_QML_END_NAMESPACE
+
+#endif
diff --git a/tools/qdoc3/declarativeparser/qdeclarativejsmemorypool_p.h b/tools/qdoc3/declarativeparser/qdeclarativejsmemorypool_p.h
new file mode 100644
index 0000000..7eea975
--- /dev/null
+++ b/tools/qdoc3/declarativeparser/qdeclarativejsmemorypool_p.h
@@ -0,0 +1,133 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative 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 QDECLARATIVEJSMEMORYPOOL_P_H
+#define QDECLARATIVEJSMEMORYPOOL_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativejsglobal_p.h"
+
+#include <QtCore/qglobal.h>
+#include <QtCore/qshareddata.h>
+
+#include <string.h>
+
+QT_QML_BEGIN_NAMESPACE
+
+namespace QDeclarativeJS {
+
+class QML_PARSER_EXPORT MemoryPool : public QSharedData
+{
+public:
+ enum { maxBlockCount = -1 };
+ enum { defaultBlockSize = 1 << 12 };
+
+ MemoryPool() {
+ m_blockIndex = maxBlockCount;
+ m_currentIndex = 0;
+ m_storage = 0;
+ m_currentBlock = 0;
+ m_currentBlockSize = 0;
+ }
+
+ virtual ~MemoryPool() {
+ for (int index = 0; index < m_blockIndex + 1; ++index)
+ qFree(m_storage[index]);
+
+ qFree(m_storage);
+ }
+
+ char *allocate(int bytes) {
+ bytes += (8 - bytes) & 7; // ensure multiple of 8 bytes (maintain alignment)
+ if (m_currentBlock == 0 || m_currentBlockSize < m_currentIndex + bytes) {
+ ++m_blockIndex;
+ m_currentBlockSize = defaultBlockSize << m_blockIndex;
+
+ m_storage = reinterpret_cast<char**>(qRealloc(m_storage, sizeof(char*) * (1 + m_blockIndex)));
+ m_currentBlock = m_storage[m_blockIndex] = reinterpret_cast<char*>(qMalloc(m_currentBlockSize));
+ ::memset(m_currentBlock, 0, m_currentBlockSize);
+
+ m_currentIndex = (8 - quintptr(m_currentBlock)) & 7; // ensure first chunk is 64-bit aligned
+ Q_ASSERT(m_currentIndex + bytes <= m_currentBlockSize);
+ }
+
+ char *p = reinterpret_cast<char *>
+ (m_currentBlock + m_currentIndex);
+
+ m_currentIndex += bytes;
+
+ return p;
+ }
+
+ int bytesAllocated() const {
+ int bytes = 0;
+ for (int index = 0; index < m_blockIndex; ++index)
+ bytes += (defaultBlockSize << index);
+ bytes += m_currentIndex;
+ return bytes;
+ }
+
+private:
+ int m_blockIndex;
+ int m_currentIndex;
+ char *m_currentBlock;
+ int m_currentBlockSize;
+ char **m_storage;
+
+private:
+ Q_DISABLE_COPY(MemoryPool)
+};
+
+} // namespace QDeclarativeJS
+
+QT_QML_END_NAMESPACE
+
+#endif
diff --git a/tools/qdoc3/declarativeparser/qdeclarativejsnodepool_p.h b/tools/qdoc3/declarativeparser/qdeclarativejsnodepool_p.h
new file mode 100644
index 0000000..fde4897
--- /dev/null
+++ b/tools/qdoc3/declarativeparser/qdeclarativejsnodepool_p.h
@@ -0,0 +1,139 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative 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 QDECLARATIVEJSNODEPOOL_P_H
+#define QDECLARATIVEJSNODEPOOL_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativejsglobal_p.h"
+#include "private/qdeclarativejsmemorypool_p.h"
+
+#include <QtCore/QHash>
+#include <QtCore/QString>
+
+QT_QML_BEGIN_NAMESPACE
+
+namespace QDeclarativeJS {
+
+namespace AST {
+class Node;
+} // namespace AST
+
+class Code;
+class CompilationUnit;
+class Engine;
+
+template <typename NodeType>
+inline NodeType *makeAstNode(MemoryPool *storage)
+{
+ NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType();
+ return node;
+}
+
+template <typename NodeType, typename Arg1>
+inline NodeType *makeAstNode(MemoryPool *storage, Arg1 arg1)
+{
+ NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType(arg1);
+ return node;
+}
+
+template <typename NodeType, typename Arg1, typename Arg2>
+inline NodeType *makeAstNode(MemoryPool *storage, Arg1 arg1, Arg2 arg2)
+{
+ NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType(arg1, arg2);
+ return node;
+}
+
+template <typename NodeType, typename Arg1, typename Arg2, typename Arg3>
+inline NodeType *makeAstNode(MemoryPool *storage, Arg1 arg1, Arg2 arg2, Arg3 arg3)
+{
+ NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType(arg1, arg2, arg3);
+ return node;
+}
+
+template <typename NodeType, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
+inline NodeType *makeAstNode(MemoryPool *storage, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4)
+{
+ NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType(arg1, arg2, arg3, arg4);
+ return node;
+}
+
+class QML_PARSER_EXPORT NodePool : public MemoryPool
+{
+public:
+ NodePool(const QString &fileName, Engine *engine);
+ virtual ~NodePool();
+
+ Code *createCompiledCode(AST::Node *node, CompilationUnit &compilation);
+
+ inline QString fileName() const { return m_fileName; }
+ inline Engine *engine() const { return m_engine; }
+#ifndef J_SCRIPT_NO_EVENT_NOTIFY
+ inline qint64 id() const { return m_id; }
+#endif
+
+private:
+ QHash<AST::Node*, Code*> m_codeCache;
+ QString m_fileName;
+ Engine *m_engine;
+#ifndef J_SCRIPT_NO_EVENT_NOTIFY
+ qint64 m_id;
+#endif
+
+private:
+ Q_DISABLE_COPY(NodePool)
+};
+
+} // namespace QDeclarativeJS
+
+QT_QML_END_NAMESPACE
+
+#endif
diff --git a/tools/qdoc3/declarativeparser/qdeclarativejsparser.cpp b/tools/qdoc3/declarativeparser/qdeclarativejsparser.cpp
new file mode 100644
index 0000000..9a93fa1
--- /dev/null
+++ b/tools/qdoc3/declarativeparser/qdeclarativejsparser.cpp
@@ -0,0 +1,1904 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative 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 <QtCore/QtDebug>
+#include <QtGui/QApplication>
+
+#include <string.h>
+
+#include "private/qdeclarativejsengine_p.h"
+#include "private/qdeclarativejslexer_p.h"
+#include "private/qdeclarativejsast_p.h"
+#include "private/qdeclarativejsnodepool_p.h"
+
+
+
+#include "private/qdeclarativejsparser_p.h"
+#include <QVarLengthArray>
+
+//
+// This file is automatically generated from qmljs.g.
+// Changes will be lost.
+//
+
+using namespace QDeclarativeJS;
+
+QT_QML_BEGIN_NAMESPACE
+
+void Parser::reallocateStack()
+{
+ if (! stack_size)
+ stack_size = 128;
+ else
+ stack_size <<= 1;
+
+ sym_stack = reinterpret_cast<Value*> (qRealloc(sym_stack, stack_size * sizeof(Value)));
+ state_stack = reinterpret_cast<int*> (qRealloc(state_stack, stack_size * sizeof(int)));
+ location_stack = reinterpret_cast<AST::SourceLocation*> (qRealloc(location_stack, stack_size * sizeof(AST::SourceLocation)));
+}
+
+inline static bool automatic(Engine *driver, int token)
+{
+ return token == QDeclarativeJSGrammar::T_RBRACE
+ || token == 0
+ || driver->lexer()->prevTerminator();
+}
+
+
+Parser::Parser(Engine *engine):
+ driver(engine),
+ tos(0),
+ stack_size(0),
+ sym_stack(0),
+ state_stack(0),
+ location_stack(0),
+ first_token(0),
+ last_token(0)
+{
+}
+
+Parser::~Parser()
+{
+ if (stack_size) {
+ qFree(sym_stack);
+ qFree(state_stack);
+ qFree(location_stack);
+ }
+}
+
+static inline AST::SourceLocation location(Lexer *lexer)
+{
+ AST::SourceLocation loc;
+ loc.offset = lexer->tokenOffset();
+ loc.length = lexer->tokenLength();
+ loc.startLine = lexer->startLineNo();
+ loc.startColumn = lexer->startColumnNo();
+ return loc;
+}
+
+AST::UiQualifiedId *Parser::reparseAsQualifiedId(AST::ExpressionNode *expr)
+{
+ QVarLengthArray<NameId *, 4> nameIds;
+ QVarLengthArray<AST::SourceLocation, 4> locations;
+
+ AST::ExpressionNode *it = expr;
+ while (AST::FieldMemberExpression *m = AST::cast<AST::FieldMemberExpression *>(it)) {
+ nameIds.append(m->name);
+ locations.append(m->identifierToken);
+ it = m->base;
+ }
+
+ if (AST::IdentifierExpression *idExpr = AST::cast<AST::IdentifierExpression *>(it)) {
+ AST::UiQualifiedId *q = makeAstNode<AST::UiQualifiedId>(driver->nodePool(), idExpr->name);
+ q->identifierToken = idExpr->identifierToken;
+
+ AST::UiQualifiedId *currentId = q;
+ for (int i = nameIds.size() - 1; i != -1; --i) {
+ currentId = makeAstNode<AST::UiQualifiedId>(driver->nodePool(), currentId, nameIds[i]);
+ currentId->identifierToken = locations[i];
+ }
+
+ return currentId->finish();
+ }
+
+ return 0;
+}
+
+bool Parser::parse(int startToken)
+{
+ Lexer *lexer = driver->lexer();
+ bool hadErrors = false;
+ int yytoken = -1;
+ int action = 0;
+
+ token_buffer[0].token = startToken;
+ first_token = &token_buffer[0];
+ last_token = &token_buffer[1];
+
+ tos = -1;
+ program = 0;
+
+ do {
+ if (++tos == stack_size)
+ reallocateStack();
+
+ state_stack[tos] = action;
+
+ _Lcheck_token:
+ if (yytoken == -1 && -TERMINAL_COUNT != action_index[action]) {
+ yyprevlloc = yylloc;
+
+ if (first_token == last_token) {
+ yytoken = lexer->lex();
+ yylval = lexer->dval();
+ yylloc = location(lexer);
+ } else {
+ yytoken = first_token->token;
+ yylval = first_token->dval;
+ yylloc = first_token->loc;
+ ++first_token;
+ }
+ }
+
+ action = t_action(action, yytoken);
+ if (action > 0) {
+ if (action != ACCEPT_STATE) {
+ yytoken = -1;
+ sym(1).dval = yylval;
+ loc(1) = yylloc;
+ } else {
+ --tos;
+ return ! hadErrors;
+ }
+ } else if (action < 0) {
+ const int r = -action - 1;
+ tos -= rhs[r];
+
+ switch (r) {
+
+case 0: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+
+case 1: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+
+case 2: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+
+case 3: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+
+case 4: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+
+case 5: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+
+case 6: {
+ sym(1).UiProgram = makeAstNode<AST::UiProgram> (driver->nodePool(), sym(1).UiImportList,
+ sym(2).UiObjectMemberList->finish());
+} break;
+
+case 8: {
+ sym(1).Node = sym(1).UiImportList->finish();
+} break;
+
+case 9: {
+ sym(1).Node = makeAstNode<AST::UiImportList> (driver->nodePool(), sym(1).UiImport);
+} break;
+
+case 10: {
+ sym(1).Node = makeAstNode<AST::UiImportList> (driver->nodePool(),
+ sym(1).UiImportList, sym(2).UiImport);
+} break;
+
+case 13: {
+ sym(1).UiImport->semicolonToken = loc(2);
+} break;
+
+case 15: {
+ sym(1).UiImport->versionToken = loc(2);
+ sym(1).UiImport->semicolonToken = loc(3);
+} break;
+
+case 17: {
+ sym(1).UiImport->versionToken = loc(2);
+ sym(1).UiImport->asToken = loc(3);
+ sym(1).UiImport->importIdToken = loc(4);
+ sym(1).UiImport->importId = sym(4).sval;
+ sym(1).UiImport->semicolonToken = loc(5);
+} break;
+
+case 19: {
+ sym(1).UiImport->asToken = loc(2);
+ sym(1).UiImport->importIdToken = loc(3);
+ sym(1).UiImport->importId = sym(3).sval;
+ sym(1).UiImport->semicolonToken = loc(4);
+} break;
+
+case 20: {
+ AST::UiImport *node = 0;
+
+ if (AST::StringLiteral *importIdLiteral = AST::cast<AST::StringLiteral *>(sym(2).Expression)) {
+ node = makeAstNode<AST::UiImport>(driver->nodePool(), importIdLiteral->value);
+ node->fileNameToken = loc(2);
+ } else if (AST::UiQualifiedId *qualifiedId = reparseAsQualifiedId(sym(2).Expression)) {
+ node = makeAstNode<AST::UiImport>(driver->nodePool(), qualifiedId);
+ node->fileNameToken = loc(2);
+ }
+
+ sym(1).Node = node;
+
+ if (node) {
+ node->importToken = loc(1);
+ } else {
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, loc(1),
+ QLatin1String("Expected a qualified name id or a string literal")));
+
+ return false; // ### remove me
+ }
+} break;
+
+case 21: {
+ sym(1).Node = 0;
+} break;
+
+case 22: {
+ sym(1).Node = makeAstNode<AST::UiObjectMemberList> (driver->nodePool(), sym(1).UiObjectMember);
+} break;
+
+case 23: {
+ sym(1).Node = makeAstNode<AST::UiObjectMemberList> (driver->nodePool(), sym(1).UiObjectMember);
+} break;
+
+case 24: {
+ AST::UiObjectMemberList *node = makeAstNode<AST:: UiObjectMemberList> (driver->nodePool(),
+ sym(1).UiObjectMemberList, sym(2).UiObjectMember);
+ sym(1).Node = node;
+} break;
+
+case 25: {
+ sym(1).Node = makeAstNode<AST::UiArrayMemberList> (driver->nodePool(), sym(1).UiObjectMember);
+} break;
+
+case 26: {
+ AST::UiArrayMemberList *node = makeAstNode<AST::UiArrayMemberList> (driver->nodePool(),
+ sym(1).UiArrayMemberList, sym(3).UiObjectMember);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 27: {
+ AST::UiObjectInitializer *node = makeAstNode<AST::UiObjectInitializer> (driver->nodePool(), (AST::UiObjectMemberList*)0);
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 28: {
+ AST::UiObjectInitializer *node = makeAstNode<AST::UiObjectInitializer> (driver->nodePool(), sym(2).UiObjectMemberList->finish());
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 29: {
+ AST::UiObjectDefinition *node = makeAstNode<AST::UiObjectDefinition> (driver->nodePool(), sym(1).UiQualifiedId,
+ sym(2).UiObjectInitializer);
+ sym(1).Node = node;
+} break;
+
+case 31: {
+ AST::UiArrayBinding *node = makeAstNode<AST::UiArrayBinding> (driver->nodePool(),
+ sym(1).UiQualifiedId, sym(4).UiArrayMemberList->finish());
+ node->colonToken = loc(2);
+ node->lbracketToken = loc(3);
+ node->rbracketToken = loc(5);
+ sym(1).Node = node;
+} break;
+
+case 32: {
+ AST::UiObjectBinding *node = makeAstNode<AST::UiObjectBinding> (driver->nodePool(),
+ sym(1).UiQualifiedId, sym(3).UiQualifiedId, sym(4).UiObjectInitializer);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 33: {
+ AST::UiObjectBinding *node = makeAstNode<AST::UiObjectBinding> (driver->nodePool(),
+ sym(3).UiQualifiedId, sym(1).UiQualifiedId, sym(4).UiObjectInitializer);
+ node->colonToken = loc(2);
+ node->hasOnToken = true;
+ sym(1).Node = node;
+} break;
+case 34:case 35:case 36:case 37:
+{
+ AST::UiScriptBinding *node = makeAstNode<AST::UiScriptBinding> (driver->nodePool(),
+ sym(1).UiQualifiedId, sym(3).Statement);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 38:
+
+case 39: {
+ sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount());
+ break;
+}
+
+case 41: {
+ sym(1).Node = 0;
+} break;
+
+case 42: {
+ sym(1).Node = sym(1).UiParameterList->finish ();
+} break;
+
+case 43: {
+ AST::UiParameterList *node = makeAstNode<AST::UiParameterList> (driver->nodePool(), sym(1).sval, sym(2).sval);
+ node->identifierToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 44: {
+ AST::UiParameterList *node = makeAstNode<AST::UiParameterList> (driver->nodePool(), sym(1).UiParameterList, sym(3).sval, sym(4).sval);
+ node->commaToken = loc(2);
+ node->identifierToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 46: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), (NameId *)0, sym(2).sval);
+ node->type = AST::UiPublicMember::Signal;
+ node->propertyToken = loc(1);
+ node->typeToken = loc(2);
+ node->identifierToken = loc(2);
+ node->parameters = sym(4).UiParameterList;
+ node->semicolonToken = loc(6);
+ sym(1).Node = node;
+} break;
+
+case 48: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), (NameId *)0, sym(2).sval);
+ node->type = AST::UiPublicMember::Signal;
+ node->propertyToken = loc(1);
+ node->typeToken = loc(2);
+ node->identifierToken = loc(2);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 50: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(4).sval, sym(6).sval);
+ node->typeModifier = sym(2).sval;
+ node->propertyToken = loc(1);
+ node->typeModifierToken = loc(2);
+ node->typeToken = loc(4);
+ node->identifierToken = loc(6);
+ node->semicolonToken = loc(7);
+ sym(1).Node = node;
+} break;
+
+case 52: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(2).sval, sym(3).sval);
+ node->propertyToken = loc(1);
+ node->typeToken = loc(2);
+ node->identifierToken = loc(3);
+ node->semicolonToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 54: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval);
+ node->isDefaultMember = true;
+ node->defaultToken = loc(1);
+ node->propertyToken = loc(2);
+ node->typeToken = loc(3);
+ node->identifierToken = loc(4);
+ node->semicolonToken = loc(5);
+ sym(1).Node = node;
+} break;
+
+case 56: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(2).sval, sym(3).sval,
+ sym(5).Expression);
+ node->propertyToken = loc(1);
+ node->typeToken = loc(2);
+ node->identifierToken = loc(3);
+ node->colonToken = loc(4);
+ node->semicolonToken = loc(6);
+ sym(1).Node = node;
+} break;
+
+case 58: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval,
+ sym(6).Expression);
+ node->isReadonlyMember = true;
+ node->readonlyToken = loc(1);
+ node->propertyToken = loc(2);
+ node->typeToken = loc(3);
+ node->identifierToken = loc(4);
+ node->colonToken = loc(5);
+ node->semicolonToken = loc(7);
+ sym(1).Node = node;
+} break;
+
+case 60: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval,
+ sym(6).Expression);
+ node->isDefaultMember = true;
+ node->defaultToken = loc(1);
+ node->propertyToken = loc(2);
+ node->typeToken = loc(3);
+ node->identifierToken = loc(4);
+ node->colonToken = loc(5);
+ node->semicolonToken = loc(7);
+ sym(1).Node = node;
+} break;
+
+case 61: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(4).sval, sym(6).sval);
+ node->typeModifier = sym(2).sval;
+ node->propertyToken = loc(1);
+ node->typeModifierToken = loc(2);
+ node->typeToken = loc(4);
+ node->identifierToken = loc(6);
+ node->semicolonToken = loc(7); // insert a fake ';' before ':'
+
+ AST::UiQualifiedId *propertyName = makeAstNode<AST::UiQualifiedId>(driver->nodePool(), sym(6).sval);
+ propertyName->identifierToken = loc(6);
+ propertyName->next = 0;
+
+ AST::UiArrayBinding *binding = makeAstNode<AST::UiArrayBinding> (driver->nodePool(),
+ propertyName, sym(9).UiArrayMemberList->finish());
+ binding->colonToken = loc(7);
+ binding->lbracketToken = loc(8);
+ binding->rbracketToken = loc(10);
+
+ node->binding = binding;
+
+ sym(1).Node = node;
+} break;
+
+case 62: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(2).sval, sym(3).sval);
+ node->propertyToken = loc(1);
+ node->typeToken = loc(2);
+ node->identifierToken = loc(3);
+ node->semicolonToken = loc(4); // insert a fake ';' before ':'
+
+ AST::UiQualifiedId *propertyName = makeAstNode<AST::UiQualifiedId>(driver->nodePool(), sym(3).sval);
+ propertyName->identifierToken = loc(3);
+ propertyName->next = 0;
+
+ AST::UiObjectBinding *binding = makeAstNode<AST::UiObjectBinding> (driver->nodePool(),
+ propertyName, sym(5).UiQualifiedId, sym(6).UiObjectInitializer);
+ binding->colonToken = loc(4);
+
+ node->binding = binding;
+
+ sym(1).Node = node;
+} break;
+
+case 63: {
+ sym(1).Node = makeAstNode<AST::UiSourceElement>(driver->nodePool(), sym(1).Node);
+} break;
+
+case 64: {
+ sym(1).Node = makeAstNode<AST::UiSourceElement>(driver->nodePool(), sym(1).Node);
+} break;
+
+case 66: {
+ QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_PROPERTY]);
+ sym(1).sval = driver->intern(s.constData(), s.length());
+ break;
+}
+
+case 67: {
+ QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_SIGNAL]);
+ sym(1).sval = driver->intern(s.constData(), s.length());
+ break;
+}
+
+case 68: {
+ QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_READONLY]);
+ sym(1).sval = driver->intern(s.constData(), s.length());
+ break;
+}
+
+case 69: {
+ QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_ON]);
+ sym(1).sval = driver->intern(s.constData(), s.length());
+ break;
+}
+
+case 70: {
+ AST::ThisExpression *node = makeAstNode<AST::ThisExpression> (driver->nodePool());
+ node->thisToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 71: {
+ AST::IdentifierExpression *node = makeAstNode<AST::IdentifierExpression> (driver->nodePool(), sym(1).sval);
+ node->identifierToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 72: {
+ AST::NullExpression *node = makeAstNode<AST::NullExpression> (driver->nodePool());
+ node->nullToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 73: {
+ AST::TrueLiteral *node = makeAstNode<AST::TrueLiteral> (driver->nodePool());
+ node->trueToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 74: {
+ AST::FalseLiteral *node = makeAstNode<AST::FalseLiteral> (driver->nodePool());
+ node->falseToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 75: {
+ AST::NumericLiteral *node = makeAstNode<AST::NumericLiteral> (driver->nodePool(), sym(1).dval);
+ node->literalToken = loc(1);
+ sym(1).Node = node;
+} break;
+case 76:
+case 77: {
+ AST::StringLiteral *node = makeAstNode<AST::StringLiteral> (driver->nodePool(), sym(1).sval);
+ node->literalToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 78: {
+ bool rx = lexer->scanRegExp(Lexer::NoPrefix);
+ if (!rx) {
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage()));
+ return false; // ### remove me
+ }
+
+ loc(1).length = lexer->tokenLength();
+
+ AST::RegExpLiteral *node = makeAstNode<AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
+ node->literalToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 79: {
+ bool rx = lexer->scanRegExp(Lexer::EqualPrefix);
+ if (!rx) {
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage()));
+ return false;
+ }
+
+ loc(1).length = lexer->tokenLength();
+
+ AST::RegExpLiteral *node = makeAstNode<AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
+ node->literalToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 80: {
+ AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), (AST::Elision *) 0);
+ node->lbracketToken = loc(1);
+ node->rbracketToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 81: {
+ AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).Elision->finish());
+ node->lbracketToken = loc(1);
+ node->rbracketToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 82: {
+ AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish ());
+ node->lbracketToken = loc(1);
+ node->rbracketToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 83: {
+ AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish (),
+ (AST::Elision *) 0);
+ node->lbracketToken = loc(1);
+ node->commaToken = loc(3);
+ node->rbracketToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 84: {
+ AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish (),
+ sym(4).Elision->finish());
+ node->lbracketToken = loc(1);
+ node->commaToken = loc(3);
+ node->rbracketToken = loc(5);
+ sym(1).Node = node;
+} break;
+
+case 85: {
+ AST::ObjectLiteral *node = 0;
+ if (sym(2).Node)
+ node = makeAstNode<AST::ObjectLiteral> (driver->nodePool(),
+ sym(2).PropertyNameAndValueList->finish ());
+ else
+ node = makeAstNode<AST::ObjectLiteral> (driver->nodePool());
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 86: {
+ AST::ObjectLiteral *node = makeAstNode<AST::ObjectLiteral> (driver->nodePool(),
+ sym(2).PropertyNameAndValueList->finish ());
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 87: {
+ AST::NestedExpression *node = makeAstNode<AST::NestedExpression>(driver->nodePool(), sym(2).Expression);
+ node->lparenToken = loc(1);
+ node->rparenToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 88: {
+ if (AST::ArrayMemberExpression *mem = AST::cast<AST::ArrayMemberExpression *>(sym(1).Expression)) {
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, mem->lbracketToken,
+ QLatin1String("Ignored annotation")));
+
+ sym(1).Expression = mem->base;
+ }
+
+ if (AST::UiQualifiedId *qualifiedId = reparseAsQualifiedId(sym(1).Expression)) {
+ sym(1).UiQualifiedId = qualifiedId;
+ } else {
+ sym(1).UiQualifiedId = 0;
+
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, loc(1),
+ QLatin1String("Expected a qualified name id")));
+
+ return false; // ### recover
+ }
+} break;
+
+case 89: {
+ sym(1).Node = makeAstNode<AST::ElementList> (driver->nodePool(), (AST::Elision *) 0, sym(1).Expression);
+} break;
+
+case 90: {
+ sym(1).Node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).Elision->finish(), sym(2).Expression);
+} break;
+
+case 91: {
+ AST::ElementList *node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).ElementList,
+ (AST::Elision *) 0, sym(3).Expression);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 92: {
+ AST::ElementList *node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).ElementList, sym(3).Elision->finish(),
+ sym(4).Expression);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 93: {
+ AST::Elision *node = makeAstNode<AST::Elision> (driver->nodePool());
+ node->commaToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 94: {
+ AST::Elision *node = makeAstNode<AST::Elision> (driver->nodePool(), sym(1).Elision);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 95: {
+ AST::PropertyNameAndValueList *node = makeAstNode<AST::PropertyNameAndValueList> (driver->nodePool(),
+ sym(1).PropertyName, sym(3).Expression);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 96: {
+ AST::PropertyNameAndValueList *node = makeAstNode<AST::PropertyNameAndValueList> (driver->nodePool(),
+ sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression);
+ node->commaToken = loc(2);
+ node->colonToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 97: {
+ AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
+ node->propertyNameToken = loc(1);
+ sym(1).Node = node;
+} break;
+case 98:
+case 99: {
+ AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount()));
+ node->propertyNameToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 100: {
+ AST::StringLiteralPropertyName *node = makeAstNode<AST::StringLiteralPropertyName> (driver->nodePool(), sym(1).sval);
+ node->propertyNameToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 101: {
+ AST::NumericLiteralPropertyName *node = makeAstNode<AST::NumericLiteralPropertyName> (driver->nodePool(), sym(1).dval);
+ node->propertyNameToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 102: {
+ AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
+ node->propertyNameToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 103:
+
+case 104:
+
+case 105:
+
+case 106:
+
+case 107:
+
+case 108:
+
+case 109:
+
+case 110:
+
+case 111:
+
+case 112:
+
+case 113:
+
+case 114:
+
+case 115:
+
+case 116:
+
+case 117:
+
+case 118:
+
+case 119:
+
+case 120:
+
+case 121:
+
+case 122:
+
+case 123:
+
+case 124:
+
+case 125:
+
+case 126:
+
+case 127:
+
+case 128:
+
+case 129:
+
+case 130:
+
+case 131:
+
+case 132:
+
+case 133:
+{
+ sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount());
+} break;
+
+case 138: {
+ AST::ArrayMemberExpression *node = makeAstNode<AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+ node->lbracketToken = loc(2);
+ node->rbracketToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 139: {
+ AST::FieldMemberExpression *node = makeAstNode<AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval);
+ node->dotToken = loc(2);
+ node->identifierToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 140: {
+ AST::NewMemberExpression *node = makeAstNode<AST::NewMemberExpression> (driver->nodePool(), sym(2).Expression, sym(4).ArgumentList);
+ node->newToken = loc(1);
+ node->lparenToken = loc(3);
+ node->rparenToken = loc(5);
+ sym(1).Node = node;
+} break;
+
+case 142: {
+ AST::NewExpression *node = makeAstNode<AST::NewExpression> (driver->nodePool(), sym(2).Expression);
+ node->newToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 143: {
+ AST::CallExpression *node = makeAstNode<AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 144: {
+ AST::CallExpression *node = makeAstNode<AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 145: {
+ AST::ArrayMemberExpression *node = makeAstNode<AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+ node->lbracketToken = loc(2);
+ node->rbracketToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 146: {
+ AST::FieldMemberExpression *node = makeAstNode<AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval);
+ node->dotToken = loc(2);
+ node->identifierToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 147: {
+ sym(1).Node = 0;
+} break;
+
+case 148: {
+ sym(1).Node = sym(1).ArgumentList->finish();
+} break;
+
+case 149: {
+ sym(1).Node = makeAstNode<AST::ArgumentList> (driver->nodePool(), sym(1).Expression);
+} break;
+
+case 150: {
+ AST::ArgumentList *node = makeAstNode<AST::ArgumentList> (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 154: {
+ AST::PostIncrementExpression *node = makeAstNode<AST::PostIncrementExpression> (driver->nodePool(), sym(1).Expression);
+ node->incrementToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 155: {
+ AST::PostDecrementExpression *node = makeAstNode<AST::PostDecrementExpression> (driver->nodePool(), sym(1).Expression);
+ node->decrementToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 157: {
+ AST::DeleteExpression *node = makeAstNode<AST::DeleteExpression> (driver->nodePool(), sym(2).Expression);
+ node->deleteToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 158: {
+ AST::VoidExpression *node = makeAstNode<AST::VoidExpression> (driver->nodePool(), sym(2).Expression);
+ node->voidToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 159: {
+ AST::TypeOfExpression *node = makeAstNode<AST::TypeOfExpression> (driver->nodePool(), sym(2).Expression);
+ node->typeofToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 160: {
+ AST::PreIncrementExpression *node = makeAstNode<AST::PreIncrementExpression> (driver->nodePool(), sym(2).Expression);
+ node->incrementToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 161: {
+ AST::PreDecrementExpression *node = makeAstNode<AST::PreDecrementExpression> (driver->nodePool(), sym(2).Expression);
+ node->decrementToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 162: {
+ AST::UnaryPlusExpression *node = makeAstNode<AST::UnaryPlusExpression> (driver->nodePool(), sym(2).Expression);
+ node->plusToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 163: {
+ AST::UnaryMinusExpression *node = makeAstNode<AST::UnaryMinusExpression> (driver->nodePool(), sym(2).Expression);
+ node->minusToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 164: {
+ AST::TildeExpression *node = makeAstNode<AST::TildeExpression> (driver->nodePool(), sym(2).Expression);
+ node->tildeToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 165: {
+ AST::NotExpression *node = makeAstNode<AST::NotExpression> (driver->nodePool(), sym(2).Expression);
+ node->notToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 167: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Mul, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 168: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Div, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 169: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Mod, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 171: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Add, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 172: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Sub, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 174: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::LShift, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 175: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::RShift, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 176: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::URShift, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 178: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Lt, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 179: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Gt, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 180: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Le, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 181: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Ge, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 182: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::InstanceOf, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 183: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::In, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 185: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Lt, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 186: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Gt, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 187: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Le, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 188: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Ge, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 189: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::InstanceOf, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 191: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Equal, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 192: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::NotEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 193: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::StrictEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 194: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::StrictNotEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 196: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Equal, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 197: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::NotEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 198: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::StrictEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 199: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::StrictNotEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 201: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitAnd, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 203: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitAnd, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 205: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitXor, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 207: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitXor, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 209: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitOr, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 211: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitOr, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 213: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::And, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 215: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::And, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 217: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Or, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 219: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Or, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 221: {
+ AST::ConditionalExpression *node = makeAstNode<AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression,
+ sym(3).Expression, sym(5).Expression);
+ node->questionToken = loc(2);
+ node->colonToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 223: {
+ AST::ConditionalExpression *node = makeAstNode<AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression,
+ sym(3).Expression, sym(5).Expression);
+ node->questionToken = loc(2);
+ node->colonToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 225: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ sym(2).ival, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 227: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ sym(2).ival, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 228: {
+ sym(1).ival = QSOperator::Assign;
+} break;
+
+case 229: {
+ sym(1).ival = QSOperator::InplaceMul;
+} break;
+
+case 230: {
+ sym(1).ival = QSOperator::InplaceDiv;
+} break;
+
+case 231: {
+ sym(1).ival = QSOperator::InplaceMod;
+} break;
+
+case 232: {
+ sym(1).ival = QSOperator::InplaceAdd;
+} break;
+
+case 233: {
+ sym(1).ival = QSOperator::InplaceSub;
+} break;
+
+case 234: {
+ sym(1).ival = QSOperator::InplaceLeftShift;
+} break;
+
+case 235: {
+ sym(1).ival = QSOperator::InplaceRightShift;
+} break;
+
+case 236: {
+ sym(1).ival = QSOperator::InplaceURightShift;
+} break;
+
+case 237: {
+ sym(1).ival = QSOperator::InplaceAnd;
+} break;
+
+case 238: {
+ sym(1).ival = QSOperator::InplaceXor;
+} break;
+
+case 239: {
+ sym(1).ival = QSOperator::InplaceOr;
+} break;
+
+case 241: {
+ AST::Expression *node = makeAstNode<AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 242: {
+ sym(1).Node = 0;
+} break;
+
+case 245: {
+ AST::Expression *node = makeAstNode<AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 246: {
+ sym(1).Node = 0;
+} break;
+
+case 263: {
+ AST::Block *node = makeAstNode<AST::Block> (driver->nodePool(), sym(2).StatementList);
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 264: {
+ sym(1).Node = makeAstNode<AST::StatementList> (driver->nodePool(), sym(1).Statement);
+} break;
+
+case 265: {
+ sym(1).Node = makeAstNode<AST::StatementList> (driver->nodePool(), sym(1).StatementList, sym(2).Statement);
+} break;
+
+case 266: {
+ sym(1).Node = 0;
+} break;
+
+case 267: {
+ sym(1).Node = sym(1).StatementList->finish ();
+} break;
+
+case 269: {
+ AST::VariableStatement *node = makeAstNode<AST::VariableStatement> (driver->nodePool(),
+ sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST));
+ node->declarationKindToken = loc(1);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 270: {
+ sym(1).ival = T_CONST;
+} break;
+
+case 271: {
+ sym(1).ival = T_VAR;
+} break;
+
+case 272: {
+ sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration);
+} break;
+
+case 273: {
+ AST::VariableDeclarationList *node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(),
+ sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 274: {
+ sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration);
+} break;
+
+case 275: {
+ sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
+} break;
+
+case 276: {
+ AST::VariableDeclaration *node = makeAstNode<AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression);
+ node->identifierToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 277: {
+ AST::VariableDeclaration *node = makeAstNode<AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression);
+ node->identifierToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 278: {
+ // ### TODO: AST for initializer
+ sym(1) = sym(2);
+} break;
+
+case 279: {
+ sym(1).Node = 0;
+} break;
+
+case 281: {
+ // ### TODO: AST for initializer
+ sym(1) = sym(2);
+} break;
+
+case 282: {
+ sym(1).Node = 0;
+} break;
+
+case 284: {
+ AST::EmptyStatement *node = makeAstNode<AST::EmptyStatement> (driver->nodePool());
+ node->semicolonToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 286: {
+ AST::ExpressionStatement *node = makeAstNode<AST::ExpressionStatement> (driver->nodePool(), sym(1).Expression);
+ node->semicolonToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 287: {
+ AST::IfStatement *node = makeAstNode<AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement);
+ node->ifToken = loc(1);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ node->elseToken = loc(5);
+ sym(1).Node = node;
+} break;
+
+case 288: {
+ AST::IfStatement *node = makeAstNode<AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
+ node->ifToken = loc(1);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 290: {
+ AST::DoWhileStatement *node = makeAstNode<AST::DoWhileStatement> (driver->nodePool(), sym(2).Statement, sym(5).Expression);
+ node->doToken = loc(1);
+ node->whileToken = loc(3);
+ node->lparenToken = loc(4);
+ node->rparenToken = loc(6);
+ node->semicolonToken = loc(7);
+ sym(1).Node = node;
+} break;
+
+case 291: {
+ AST::WhileStatement *node = makeAstNode<AST::WhileStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
+ node->whileToken = loc(1);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 292: {
+ AST::ForStatement *node = makeAstNode<AST::ForStatement> (driver->nodePool(), sym(3).Expression,
+ sym(5).Expression, sym(7).Expression, sym(9).Statement);
+ node->forToken = loc(1);
+ node->lparenToken = loc(2);
+ node->firstSemicolonToken = loc(4);
+ node->secondSemicolonToken = loc(6);
+ node->rparenToken = loc(8);
+ sym(1).Node = node;
+} break;
+
+case 293: {
+ AST::LocalForStatement *node = makeAstNode<AST::LocalForStatement> (driver->nodePool(),
+ sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression,
+ sym(8).Expression, sym(10).Statement);
+ node->forToken = loc(1);
+ node->lparenToken = loc(2);
+ node->varToken = loc(3);
+ node->firstSemicolonToken = loc(5);
+ node->secondSemicolonToken = loc(7);
+ node->rparenToken = loc(9);
+ sym(1).Node = node;
+} break;
+
+case 294: {
+ AST:: ForEachStatement *node = makeAstNode<AST::ForEachStatement> (driver->nodePool(), sym(3).Expression,
+ sym(5).Expression, sym(7).Statement);
+ node->forToken = loc(1);
+ node->lparenToken = loc(2);
+ node->inToken = loc(4);
+ node->rparenToken = loc(6);
+ sym(1).Node = node;
+} break;
+
+case 295: {
+ AST::LocalForEachStatement *node = makeAstNode<AST::LocalForEachStatement> (driver->nodePool(),
+ sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement);
+ node->forToken = loc(1);
+ node->lparenToken = loc(2);
+ node->varToken = loc(3);
+ node->inToken = loc(5);
+ node->rparenToken = loc(7);
+ sym(1).Node = node;
+} break;
+
+case 297: {
+ AST::ContinueStatement *node = makeAstNode<AST::ContinueStatement> (driver->nodePool());
+ node->continueToken = loc(1);
+ node->semicolonToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 299: {
+ AST::ContinueStatement *node = makeAstNode<AST::ContinueStatement> (driver->nodePool(), sym(2).sval);
+ node->continueToken = loc(1);
+ node->identifierToken = loc(2);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 301: {
+ AST::BreakStatement *node = makeAstNode<AST::BreakStatement> (driver->nodePool());
+ node->breakToken = loc(1);
+ node->semicolonToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 303: {
+ AST::BreakStatement *node = makeAstNode<AST::BreakStatement> (driver->nodePool(), sym(2).sval);
+ node->breakToken = loc(1);
+ node->identifierToken = loc(2);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 305: {
+ AST::ReturnStatement *node = makeAstNode<AST::ReturnStatement> (driver->nodePool(), sym(2).Expression);
+ node->returnToken = loc(1);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 306: {
+ AST::WithStatement *node = makeAstNode<AST::WithStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
+ node->withToken = loc(1);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 307: {
+ AST::SwitchStatement *node = makeAstNode<AST::SwitchStatement> (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock);
+ node->switchToken = loc(1);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 308: {
+ AST::CaseBlock *node = makeAstNode<AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses);
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 309: {
+ AST::CaseBlock *node = makeAstNode<AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses);
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(5);
+ sym(1).Node = node;
+} break;
+
+case 310: {
+ sym(1).Node = makeAstNode<AST::CaseClauses> (driver->nodePool(), sym(1).CaseClause);
+} break;
+
+case 311: {
+ sym(1).Node = makeAstNode<AST::CaseClauses> (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause);
+} break;
+
+case 312: {
+ sym(1).Node = 0;
+} break;
+
+case 313: {
+ sym(1).Node = sym(1).CaseClauses->finish ();
+} break;
+
+case 314: {
+ AST::CaseClause *node = makeAstNode<AST::CaseClause> (driver->nodePool(), sym(2).Expression, sym(4).StatementList);
+ node->caseToken = loc(1);
+ node->colonToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 315: {
+ AST::DefaultClause *node = makeAstNode<AST::DefaultClause> (driver->nodePool(), sym(3).StatementList);
+ node->defaultToken = loc(1);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+case 316:
+case 317: {
+ AST::LabelledStatement *node = makeAstNode<AST::LabelledStatement> (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount()), sym(3).Statement);
+ node->identifierToken = loc(1);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 318: {
+ AST::LabelledStatement *node = makeAstNode<AST::LabelledStatement> (driver->nodePool(), sym(1).sval, sym(3).Statement);
+ node->identifierToken = loc(1);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 320: {
+ AST::ThrowStatement *node = makeAstNode<AST::ThrowStatement> (driver->nodePool(), sym(2).Expression);
+ node->throwToken = loc(1);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 321: {
+ AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch);
+ node->tryToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 322: {
+ AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Finally);
+ node->tryToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 323: {
+ AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally);
+ node->tryToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 324: {
+ AST::Catch *node = makeAstNode<AST::Catch> (driver->nodePool(), sym(3).sval, sym(5).Block);
+ node->catchToken = loc(1);
+ node->lparenToken = loc(2);
+ node->identifierToken = loc(3);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 325: {
+ AST::Finally *node = makeAstNode<AST::Finally> (driver->nodePool(), sym(2).Block);
+ node->finallyToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 327: {
+ AST::DebuggerStatement *node = makeAstNode<AST::DebuggerStatement> (driver->nodePool());
+ node->debuggerToken = loc(1);
+ node->semicolonToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 328: {
+ AST::FunctionDeclaration *node = makeAstNode<AST::FunctionDeclaration> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody);
+ node->functionToken = loc(1);
+ node->identifierToken = loc(2);
+ node->lparenToken = loc(3);
+ node->rparenToken = loc(5);
+ node->lbraceToken = loc(6);
+ node->rbraceToken = loc(8);
+ sym(1).Node = node;
+} break;
+
+case 329: {
+ AST::FunctionExpression *node = makeAstNode<AST::FunctionExpression> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody);
+ node->functionToken = loc(1);
+ if (sym(2).sval)
+ node->identifierToken = loc(2);
+ node->lparenToken = loc(3);
+ node->rparenToken = loc(5);
+ node->lbraceToken = loc(6);
+ node->rbraceToken = loc(8);
+ sym(1).Node = node;
+} break;
+
+case 330: {
+ AST::FormalParameterList *node = makeAstNode<AST::FormalParameterList> (driver->nodePool(), sym(1).sval);
+ node->identifierToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 331: {
+ AST::FormalParameterList *node = makeAstNode<AST::FormalParameterList> (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval);
+ node->commaToken = loc(2);
+ node->identifierToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 332: {
+ sym(1).Node = 0;
+} break;
+
+case 333: {
+ sym(1).Node = sym(1).FormalParameterList->finish ();
+} break;
+
+case 334: {
+ sym(1).Node = 0;
+} break;
+
+case 336: {
+ sym(1).Node = makeAstNode<AST::FunctionBody> (driver->nodePool(), sym(1).SourceElements->finish ());
+} break;
+
+case 337: {
+ sym(1).Node = makeAstNode<AST::Program> (driver->nodePool(), sym(1).SourceElements->finish ());
+} break;
+
+case 338: {
+ sym(1).Node = makeAstNode<AST::SourceElements> (driver->nodePool(), sym(1).SourceElement);
+} break;
+
+case 339: {
+ sym(1).Node = makeAstNode<AST::SourceElements> (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement);
+} break;
+
+case 340: {
+ sym(1).Node = makeAstNode<AST::StatementSourceElement> (driver->nodePool(), sym(1).Statement);
+} break;
+
+case 341: {
+ sym(1).Node = makeAstNode<AST::FunctionSourceElement> (driver->nodePool(), sym(1).FunctionDeclaration);
+} break;
+
+case 342: {
+ sym(1).sval = 0;
+} break;
+
+case 344: {
+ sym(1).Node = 0;
+} break;
+
+ } // switch
+ action = nt_action(state_stack[tos], lhs[r] - TERMINAL_COUNT);
+ } // if
+ } while (action != 0);
+
+ if (first_token == last_token) {
+ const int errorState = state_stack[tos];
+
+ // automatic insertion of `;'
+ if (yytoken != -1 && t_action(errorState, T_AUTOMATIC_SEMICOLON) && automatic(driver, yytoken)) {
+ SavedToken &tk = token_buffer[0];
+ tk.token = yytoken;
+ tk.dval = yylval;
+ tk.loc = yylloc;
+
+ yylloc = yyprevlloc;
+ yylloc.offset += yylloc.length;
+ yylloc.startColumn += yylloc.length;
+ yylloc.length = 0;
+
+ //const QString msg = qApp->translate("QDeclarativeParser", "Missing `;'");
+ //diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, yylloc, msg));
+
+ first_token = &token_buffer[0];
+ last_token = &token_buffer[1];
+
+ yytoken = T_SEMICOLON;
+ yylval = 0;
+
+ action = errorState;
+
+ goto _Lcheck_token;
+ }
+
+ hadErrors = true;
+
+ token_buffer[0].token = yytoken;
+ token_buffer[0].dval = yylval;
+ token_buffer[0].loc = yylloc;
+
+ token_buffer[1].token = yytoken = lexer->lex();
+ token_buffer[1].dval = yylval = lexer->dval();
+ token_buffer[1].loc = yylloc = location(lexer);
+
+ if (t_action(errorState, yytoken)) {
+ QString msg;
+ int token = token_buffer[0].token;
+ if (token < 0 || token >= TERMINAL_COUNT)
+ msg = qApp->translate("QDeclarativeParser", "Syntax error");
+ else
+ msg = qApp->translate("QDeclarativeParser", "Unexpected token `%1'").arg(QLatin1String(spell[token]));
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
+
+ action = errorState;
+ goto _Lcheck_token;
+ }
+
+ static int tokens[] = {
+ T_PLUS,
+ T_EQ,
+
+ T_COMMA,
+ T_COLON,
+ T_SEMICOLON,
+
+ T_RPAREN, T_RBRACKET, T_RBRACE,
+
+ T_NUMERIC_LITERAL,
+ T_IDENTIFIER,
+
+ T_LPAREN, T_LBRACKET, T_LBRACE,
+
+ EOF_SYMBOL
+ };
+
+ for (int *tk = tokens; *tk != EOF_SYMBOL; ++tk) {
+ int a = t_action(errorState, *tk);
+ if (a > 0 && t_action(a, yytoken)) {
+ const QString msg = qApp->translate("QDeclarativeParser", "Expected token `%1'").arg(QLatin1String(spell[*tk]));
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
+
+ yytoken = *tk;
+ yylval = 0;
+ yylloc = token_buffer[0].loc;
+ yylloc.length = 0;
+
+ first_token = &token_buffer[0];
+ last_token = &token_buffer[2];
+
+ action = errorState;
+ goto _Lcheck_token;
+ }
+ }
+
+ for (int tk = 1; tk < TERMINAL_COUNT; ++tk) {
+ if (tk == T_AUTOMATIC_SEMICOLON || tk == T_FEED_UI_PROGRAM ||
+ tk == T_FEED_JS_STATEMENT || tk == T_FEED_JS_EXPRESSION ||
+ tk == T_FEED_JS_SOURCE_ELEMENT)
+ continue;
+
+ int a = t_action(errorState, tk);
+ if (a > 0 && t_action(a, yytoken)) {
+ const QString msg = qApp->translate("QDeclarativeParser", "Expected token `%1'").arg(QLatin1String(spell[tk]));
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
+
+ yytoken = tk;
+ yylval = 0;
+ yylloc = token_buffer[0].loc;
+ yylloc.length = 0;
+
+ action = errorState;
+ goto _Lcheck_token;
+ }
+ }
+
+ const QString msg = qApp->translate("QDeclarativeParser", "Syntax error");
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
+ }
+
+ return false;
+}
+
+QT_QML_END_NAMESPACE
+
+
diff --git a/tools/qdoc3/declarativeparser/qdeclarativejsparser_p.h b/tools/qdoc3/declarativeparser/qdeclarativejsparser_p.h
new file mode 100644
index 0000000..ad46bff
--- /dev/null
+++ b/tools/qdoc3/declarativeparser/qdeclarativejsparser_p.h
@@ -0,0 +1,246 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative 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$
+**
+****************************************************************************/
+
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+//
+// This file is automatically generated from qmljs.g.
+// Changes will be lost.
+//
+
+#ifndef QDECLARATIVEJSPARSER_P_H
+#define QDECLARATIVEJSPARSER_P_H
+
+#include "private/qdeclarativejsglobal_p.h"
+#include "private/qdeclarativejsgrammar_p.h"
+#include "private/qdeclarativejsast_p.h"
+#include "private/qdeclarativejsengine_p.h"
+
+#include <QtCore/QList>
+#include <QtCore/QString>
+
+QT_QML_BEGIN_NAMESPACE
+
+namespace QDeclarativeJS {
+
+class Engine;
+class NameId;
+
+class QML_PARSER_EXPORT Parser: protected QDeclarativeJSGrammar
+{
+public:
+ union Value {
+ int ival;
+ double dval;
+ NameId *sval;
+ AST::ArgumentList *ArgumentList;
+ AST::CaseBlock *CaseBlock;
+ AST::CaseClause *CaseClause;
+ AST::CaseClauses *CaseClauses;
+ AST::Catch *Catch;
+ AST::DefaultClause *DefaultClause;
+ AST::ElementList *ElementList;
+ AST::Elision *Elision;
+ AST::ExpressionNode *Expression;
+ AST::Finally *Finally;
+ AST::FormalParameterList *FormalParameterList;
+ AST::FunctionBody *FunctionBody;
+ AST::FunctionDeclaration *FunctionDeclaration;
+ AST::Node *Node;
+ AST::PropertyName *PropertyName;
+ AST::PropertyNameAndValueList *PropertyNameAndValueList;
+ AST::SourceElement *SourceElement;
+ AST::SourceElements *SourceElements;
+ AST::Statement *Statement;
+ AST::StatementList *StatementList;
+ AST::Block *Block;
+ AST::VariableDeclaration *VariableDeclaration;
+ AST::VariableDeclarationList *VariableDeclarationList;
+
+ AST::UiProgram *UiProgram;
+ AST::UiImportList *UiImportList;
+ AST::UiImport *UiImport;
+ AST::UiParameterList *UiParameterList;
+ AST::UiPublicMember *UiPublicMember;
+ AST::UiObjectDefinition *UiObjectDefinition;
+ AST::UiObjectInitializer *UiObjectInitializer;
+ AST::UiObjectBinding *UiObjectBinding;
+ AST::UiScriptBinding *UiScriptBinding;
+ AST::UiArrayBinding *UiArrayBinding;
+ AST::UiObjectMember *UiObjectMember;
+ AST::UiObjectMemberList *UiObjectMemberList;
+ AST::UiArrayMemberList *UiArrayMemberList;
+ AST::UiQualifiedId *UiQualifiedId;
+ AST::UiSignature *UiSignature;
+ AST::UiFormalList *UiFormalList;
+ AST::UiFormal *UiFormal;
+ };
+
+public:
+ Parser(Engine *engine);
+ ~Parser();
+
+ // parse a UI program
+ bool parse() { return parse(T_FEED_UI_PROGRAM); }
+ bool parseStatement() { return parse(T_FEED_JS_STATEMENT); }
+ bool parseExpression() { return parse(T_FEED_JS_EXPRESSION); }
+ bool parseSourceElement() { return parse(T_FEED_JS_SOURCE_ELEMENT); }
+ bool parseUiObjectMember() { return parse(T_FEED_UI_OBJECT_MEMBER); }
+ bool parseProgram() { return parse(T_FEED_JS_PROGRAM); }
+
+ AST::UiProgram *ast() const
+ { return AST::cast<AST::UiProgram *>(program); }
+
+ AST::Statement *statement() const
+ {
+ if (! program)
+ return 0;
+
+ return program->statementCast();
+ }
+
+ AST::ExpressionNode *expression() const
+ {
+ if (! program)
+ return 0;
+
+ return program->expressionCast();
+ }
+
+ AST::UiObjectMember *uiObjectMember() const
+ {
+ if (! program)
+ return 0;
+
+ return program->uiObjectMemberCast();
+ }
+
+ AST::Node *rootNode() const
+ { return program; }
+
+ QList<DiagnosticMessage> diagnosticMessages() const
+ { return diagnostic_messages; }
+
+ inline DiagnosticMessage diagnosticMessage() const
+ {
+ foreach (const DiagnosticMessage &d, diagnostic_messages) {
+ if (! d.kind == DiagnosticMessage::Warning)
+ return d;
+ }
+
+ return DiagnosticMessage();
+ }
+
+ inline QString errorMessage() const
+ { return diagnosticMessage().message; }
+
+ inline int errorLineNumber() const
+ { return diagnosticMessage().loc.startLine; }
+
+ inline int errorColumnNumber() const
+ { return diagnosticMessage().loc.startColumn; }
+
+protected:
+ bool parse(int startToken);
+
+ void reallocateStack();
+
+ inline Value &sym(int index)
+ { return sym_stack [tos + index - 1]; }
+
+ inline AST::SourceLocation &loc(int index)
+ { return location_stack [tos + index - 1]; }
+
+ AST::UiQualifiedId *reparseAsQualifiedId(AST::ExpressionNode *expr);
+
+protected:
+ Engine *driver;
+ int tos;
+ int stack_size;
+ Value *sym_stack;
+ int *state_stack;
+ AST::SourceLocation *location_stack;
+
+ AST::Node *program;
+
+ // error recovery
+ enum { TOKEN_BUFFER_SIZE = 3 };
+
+ struct SavedToken {
+ int token;
+ double dval;
+ AST::SourceLocation loc;
+ };
+
+ double yylval;
+ AST::SourceLocation yylloc;
+ AST::SourceLocation yyprevlloc;
+
+ SavedToken token_buffer[TOKEN_BUFFER_SIZE];
+ SavedToken *first_token;
+ SavedToken *last_token;
+
+ QList<DiagnosticMessage> diagnostic_messages;
+};
+
+} // end of namespace QDeclarativeJS
+
+
+
+#define J_SCRIPT_REGEXPLITERAL_RULE1 78
+
+#define J_SCRIPT_REGEXPLITERAL_RULE2 79
+
+QT_QML_END_NAMESPACE
+
+
+
+#endif // QDECLARATIVEJSPARSER_P_H
diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp
index 5d3e34a..018cbc7 100644
--- a/tools/qdoc3/ditaxmlgenerator.cpp
+++ b/tools/qdoc3/ditaxmlgenerator.cpp
@@ -1193,7 +1193,8 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
fileName = QLatin1String("images/") + protectEnc(atom->string());
}
- writeStartTag(DT_fig);
+ if (currentTag() != DT_xref)
+ writeStartTag(DT_fig);
writeStartTag(DT_image);
xmlWriter().writeAttribute("href",protectEnc(fileName));
if (atom->type() == Atom::InlineImage)
@@ -1208,7 +1209,8 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
writeEndTag(); // </alt>
}
writeEndTag(); // </image>
- writeEndTag(); // </fig>
+ if (currentTag() != DT_xref)
+ writeEndTag(); // </fig>
}
break;
case Atom::ImageText:
@@ -5551,13 +5553,74 @@ void DitaXmlGenerator::writeDitaMap()
}
/*!
+ Looks up the tag name for \a t in the map of metadata
+ values for the current topic in \a inner. If a value
+ for the tag is found, the element is written with the
+ found value. Otherwise if \a force is set, an empty
+ element is written using the tag.
+
+ Returns true or false depending on whether it writes
+ an element using the tag \a t.
+
+ \note If \a t is found in the metadata map, it is erased.
+ i.e. Once you call this function for a particular \a t,
+ you consume \a t.
+
+ At the moment, it doesn't chaeck to see if there is a
+ default value for the tag. But it will eventually.
+ */
+bool DitaXmlGenerator::writeMetadataElement(const InnerNode* inner,
+ DitaXmlGenerator::DitaTag t,
+ bool force)
+{
+ QString s;
+ QStringMap& metaTagMap = const_cast<QStringMap&>(inner->doc().metaTagMap());
+ QStringMap::iterator i = metaTagMap.find(ditaTags[t]);
+ if (i == metaTagMap.end()) {
+ // get the default author, if there is one.
+ }
+ else {
+ s = i.value();
+ metaTagMap.erase(i);
+ }
+ if (s.isEmpty() && !force)
+ return false;
+ writeStartTag(t);
+ if (!s.isEmpty())
+ xmlWriter().writeCharacters(s);
+ writeEndTag();
+ return true;
+}
+
+/*!
+ Looks up the tag name for \a t in the map of metadata
+ values for the current topic in \a inner. If a value
+ for the tag is found, the value is returned.
+
+ \note If \a t is found in the metadata map, it is erased.
+ i.e. Once you call this function for a particular \a t,
+ you consume \a t.
+ */
+QString DitaXmlGenerator::getMetadataElement(const InnerNode* inner, DitaXmlGenerator::DitaTag t)
+{
+ QString s;
+ QStringMap& metaTagMap = const_cast<QStringMap&>(inner->doc().metaTagMap());
+ QStringMap::iterator i = metaTagMap.find(ditaTags[t]);
+ if (i != metaTagMap.end()) {
+ s = i.value();
+ metaTagMap.erase(i);
+ }
+ return s;
+}
+
+/*!
Writes the <prolog> element for the \a inner node
using the \a marker. The <prolog> element contains
the <metadata> element, plus some others. This
function writes one or more of these elements:
\list
- \o <audience>
+ \o <audience> *
\o <author> *
\o <brand>
\o <category> *
@@ -5595,64 +5658,76 @@ DitaXmlGenerator::writeProlog(const InnerNode* inner, CodeMarker* marker)
if (!inner)
return;
writeStartTag(DT_prolog);
-
- QString author = inner->author();
- writeStartTag(DT_author);
- if (author.isEmpty())
- author = "Qt Development Frameworks";
- xmlWriter().writeCharacters(author);
- writeEndTag(); // <author>
-
- QString publisher = inner->publisher();
- writeStartTag(DT_publisher);
- if (publisher.isEmpty())
- publisher = "Nokia";
- xmlWriter().writeCharacters(publisher);
- writeEndTag(); // <publisher>
-
- QString permissions = inner->permissions();
+ writeMetadataElement(inner,DT_author);
+ writeMetadataElement(inner,DT_publisher);
+ QString s = getMetadataElement(inner,DT_copyryear);
+ if (s.isEmpty()) {
+ s = "2011"; // zzz
+ }
+ QString t = getMetadataElement(inner,DT_copyrholder);
+ if (t.isEmpty()) {
+ t = "Nokia"; // zzz
+ }
+ writeStartTag(DT_copyright);
+ writeStartTag(DT_copyryear);
+ xmlWriter().writeAttribute("year",s);
+ writeEndTag(); // </copyryear>
+ writeStartTag(DT_copyrholder);
+ xmlWriter().writeCharacters(t);
+ writeEndTag(); // </copyrholder>
+ writeEndTag(); // </copyright>
+ s = getMetadataElement(inner,DT_permissions);
+ if (s.isEmpty())
+ s = "all";
writeStartTag(DT_permissions);
- if (permissions.isEmpty())
- permissions = "all";
- xmlWriter().writeAttribute("view",permissions);
- writeEndTag(); // <permissions>
-
+ xmlWriter().writeAttribute("view",s);
+ writeEndTag(); // </permissions>
writeStartTag(DT_metadata);
- writeStartTag(DT_category);
- QString category = "Page";
- if (inner->type() == Node::Class)
- category = "C++ Class";
- else if (inner->type() == Node::Namespace)
- category = "C++ Namespace";
- else if (inner->type() == Node::Fake) {
- if (inner->subType() == Node::QmlBasicType)
- category = "QML Class";
- else if (inner->subType() == Node::QmlClass)
- category = "QML Basic Type";
- else if (inner->subType() == Node::HeaderFile)
- category = "Header File";
- else if (inner->subType() == Node::Module)
- category = "Module";
- else if (inner->subType() == Node::File)
- category = "Example Source File";
- else if (inner->subType() == Node::Example)
- category = "Example";
- else if (inner->subType() == Node::Image)
- category = "Image";
- else if (inner->subType() == Node::Group)
- category = "Group";
- else if (inner->subType() == Node::Page)
- category = "Page";
- else if (inner->subType() == Node::ExternalPage)
- category = "External Page"; // Is this necessary?
+ s = getMetadataElement(inner,DT_audience);
+ if (!s.isEmpty()) {
+ writeStartTag(DT_audience);
+ xmlWriter().writeAttribute("type",s);
+ writeEndTag(); // </audience>
+ }
+ if (!writeMetadataElement(inner,DT_category,false)) {
+ writeStartTag(DT_category);
+ QString category = "Page";
+ if (inner->type() == Node::Class)
+ category = "Class reference";
+ else if (inner->type() == Node::Namespace)
+ category = "Namespace";
+ else if (inner->type() == Node::Fake) {
+ if (inner->subType() == Node::QmlClass)
+ category = "QML Element Reference";
+ else if (inner->subType() == Node::QmlBasicType)
+ category = "QML Basic Type";
+ else if (inner->subType() == Node::HeaderFile)
+ category = "Header File";
+ else if (inner->subType() == Node::Module)
+ category = "Module";
+ else if (inner->subType() == Node::File)
+ category = "Example Source File";
+ else if (inner->subType() == Node::Example)
+ category = "Example";
+ else if (inner->subType() == Node::Image)
+ category = "Image";
+ else if (inner->subType() == Node::Group)
+ category = "Group";
+ else if (inner->subType() == Node::Page)
+ category = "Page";
+ else if (inner->subType() == Node::ExternalPage)
+ category = "External Page"; // Is this necessary?
+ }
+ xmlWriter().writeCharacters(category);
+ writeEndTag(); // </category>
}
- xmlWriter().writeCharacters(category);
- writeEndTag(); // <category>
if (vrm.size() > 0) {
writeStartTag(DT_prodinfo);
- writeStartTag(DT_prodname);
- xmlWriter().writeCharacters(projectDescription);
- writeEndTag(); // <prodname>
+ if (!writeMetadataElement(inner,DT_prodname,false)) {
+ writeStartTag(DT_prodname);
+ xmlWriter().writeCharacters(projectDescription);
+ writeEndTag(); // </prodname>
+ }
writeStartTag(DT_vrmlist);
writeStartTag(DT_vrm);
if (vrm.size() > 0)
@@ -5663,26 +5738,27 @@ DitaXmlGenerator::writeProlog(const InnerNode* inner, CodeMarker* marker)
xmlWriter().writeAttribute("modification",vrm[2]);
writeEndTag(); // <vrm>
writeEndTag(); // <vrmlist>
- QString component = inner->moduleName();
- if (!component.isEmpty()) {
- writeStartTag(DT_component);
- xmlWriter().writeCharacters(component);
- writeEndTag(); // <component>
- }
- writeEndTag(); // <prodinfo>
- if (inner->hasOtherMetadata()) {
- const QMap<QString, QString>& omd = inner->otherMetadata();
- QMapIterator<QString, QString> i(omd);
- while (i.hasNext()) {
- i.next();
- writeStartTag(DT_othermeta);
- xmlWriter().writeAttribute("name",i.key());
- xmlWriter().writeAttribute("content",i.value());
+ if (!writeMetadataElement(inner,DT_component,false)) {
+ QString component = inner->moduleName();
+ if (!component.isEmpty()) {
+ writeStartTag(DT_component);
+ xmlWriter().writeCharacters(component);
+ writeEndTag(); // </component>
}
}
+ writeEndTag(); // </prodinfo>
+ }
+ const QStringMap& metaTagMap = inner->doc().metaTagMap();
+ QMapIterator<QString, QString> i(metaTagMap);
+ while (i.hasNext()) {
+ i.next();
+ writeStartTag(DT_othermeta);
+ xmlWriter().writeAttribute("name",i.key());
+ xmlWriter().writeAttribute("content",i.value());
+ writeEndTag(); // </othermeta>
}
- writeEndTag(); // <metadata>
- writeEndTag(); // <prolog>
+ writeEndTag(); // </metadata>
+ writeEndTag(); // </prolog>
}
QT_END_NAMESPACE
diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h
index 7793db0..972688a 100644
--- a/tools/qdoc3/ditaxmlgenerator.h
+++ b/tools/qdoc3/ditaxmlgenerator.h
@@ -316,6 +316,10 @@ class DitaXmlGenerator : public PageGenerator
void writeRelatedLinks(const FakeNode* fake, CodeMarker* marker);
void writeLink(const Node* node, const QString& tex, const QString& role);
void writeProlog(const InnerNode* inner, CodeMarker* marker);
+ bool writeMetadataElement(const InnerNode* inner,
+ DitaXmlGenerator::DitaTag t,
+ bool force=true);
+ QString getMetadataElement(const InnerNode* inner, DitaXmlGenerator::DitaTag t);
private:
enum SubTitleSize { SmallSubTitle, LargeSubTitle };
diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp
index 5f563be..945b765 100644
--- a/tools/qdoc3/doc.cpp
+++ b/tools/qdoc3/doc.cpp
@@ -877,7 +877,7 @@ void DocParser::parse(const QString& source,
case CMD_META:
priv->constructExtra();
p1 = getArgument();
- priv->extra->metaMap.insert(p1, getRestOfLine());
+ priv->extra->metaMap.insert(p1, getArgument());
break;
case CMD_NEWCODE:
location().warning(tr("Unexpected '\\%1'").arg(cmdName(CMD_NEWCODE)));
diff --git a/tools/qdoc3/doc/files/qt.qdocconf b/tools/qdoc3/doc/files/qt.qdocconf
index 44cfbc1..377f0f1 100644
--- a/tools/qdoc3/doc/files/qt.qdocconf
+++ b/tools/qdoc3/doc/files/qt.qdocconf
@@ -22,7 +22,7 @@ edition.DesktopLight.groups = -graphicsview-api
qhp.projects = Qt
qhp.Qt.file = qt.qhp
-qhp.Qt.namespace = com.trolltech.qt.472
+qhp.Qt.namespace = com.trolltech.qt.474
qhp.Qt.virtualFolder = qdoc
qhp.Qt.indexTitle = Qt Reference Documentation
qhp.Qt.indexRoot =
@@ -36,9 +36,9 @@ qhp.Qt.extraFiles = classic.css \
images/dynamiclayouts-example.png \
images/stylesheet-coffee-plastique.png
-qhp.Qt.filterAttributes = qt 4.7.2 qtrefdoc
-qhp.Qt.customFilters.Qt.name = Qt 4.7.2
-qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.2
+qhp.Qt.filterAttributes = qt 4.7.4 qtrefdoc
+qhp.Qt.customFilters.Qt.name = Qt 4.7.4
+qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.4
qhp.Qt.subprojects = classes overviews examples
qhp.Qt.subprojects.classes.title = Classes
qhp.Qt.subprojects.classes.indexTitle = Qt's Classes
diff --git a/tools/qdoc3/helpprojectwriter.cpp b/tools/qdoc3/helpprojectwriter.cpp
index 949507f..1c7fcbf 100644
--- a/tools/qdoc3/helpprojectwriter.cpp
+++ b/tools/qdoc3/helpprojectwriter.cpp
@@ -702,6 +702,8 @@ void HelpProjectWriter::generateProject(HelpProject &project)
}
} else {
// Find a contents node and navigate from there, using the NextLink values.
+ QSet<QString> visited;
+
foreach (const Node *node, subproject.nodes) {
QString nextTitle = node->links().value(Node::NextLink).first;
if (!nextTitle.isEmpty() &&
@@ -715,9 +717,10 @@ void HelpProjectWriter::generateProject(HelpProject &project)
while (nextPage) {
writeNode(project, writer, nextPage);
nextTitle = nextPage->links().value(Node::NextLink).first;
- if(nextTitle.isEmpty())
+ if (nextTitle.isEmpty() || visited.contains(nextTitle))
break;
nextPage = const_cast<FakeNode *>(tree->findFakeNodeByTitle(nextTitle));
+ visited.insert(nextTitle);
}
break;
}
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 2019e85..a4300b8 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -1595,75 +1595,125 @@ QString HtmlGenerator::fileExtension(const Node * /* node */) const
/*!
Output breadcrumb list in the html file.
*/
-void HtmlGenerator::generateBreadCrumbs(const QString& title,
+void HtmlGenerator::generateBreadCrumbs(const QString &title,
const Node *node,
CodeMarker *marker)
{
- Text breadcrumb;
+ Text breadcrumbs;
+
if (node->type() == Node::Class) {
- const ClassNode* cn = static_cast<const ClassNode*>(node);
+ const ClassNode *cn = static_cast<const ClassNode *>(node);
QString name = node->moduleName();
- out() << " <li><a href=\"modules.html\">Modules</a></li>";
- if (!name.isEmpty()) {
- out() << " <li>";
- breadcrumb << Atom(Atom::AutoLink,name);
- generateText(breadcrumb, node, marker);
- out() << "</li>\n";
- }
+ breadcrumbs << Atom(Atom::ListItemLeft)
+ << Atom(Atom::Link, QLatin1String("All Modules"))
+ << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
+ << Atom(Atom::String, QLatin1String("Modules"))
+ << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK)
+ << Atom(Atom::ListItemRight);
+ if (!name.isEmpty())
+ breadcrumbs << Atom(Atom::ListItemLeft)
+ << Atom(Atom::AutoLink, name)
+ << Atom(Atom::ListItemRight);
if (!cn->name().isEmpty())
- out() << " <li>" << protectEnc(cn->name()) << "</li>\n";
+ breadcrumbs << Atom(Atom::ListItemLeft)
+ << Atom(Atom::String, protectEnc(cn->name()))
+ << Atom(Atom::ListItemRight);
}
else if (node->type() == Node::Fake) {
const FakeNode* fn = static_cast<const FakeNode*>(node);
if (node->subType() == Node::Module) {
- out() << " <li><a href=\"modules.html\">Modules</a></li>";
+ breadcrumbs << Atom(Atom::ListItemLeft)
+ << Atom(Atom::Link, QLatin1String("All Modules"))
+ << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
+ << Atom(Atom::String, QLatin1String("Modules"))
+ << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK)
+ << Atom(Atom::ListItemRight);
QString name = node->name();
if (!name.isEmpty())
- out() << " <li>" << protectEnc(name) << "</li>\n";
+ breadcrumbs << Atom(Atom::ListItemLeft)
+ << Atom(Atom::String, protectEnc(name))
+ << Atom(Atom::ListItemRight);
}
else if (node->subType() == Node::Group) {
if (fn->name() == QString("modules"))
- out() << " <li>Modules</li>";
- else {
- out() << " <li>" << protectEnc(title) << "</li>";
- }
+ breadcrumbs << Atom(Atom::String, QLatin1String("Modules"));
+ else
+ breadcrumbs << Atom(Atom::ListItemLeft)
+ << Atom(Atom::String, protectEnc(title))
+ << Atom(Atom::ListItemRight);
}
else if (node->subType() == Node::Page) {
if (fn->name() == QString("qdeclarativeexamples.html")) {
- out() << " <li><a href=\"all-examples.html\">Examples</a></li>";
- out() << " <li>QML Examples &amp; Demos</li>";
+ breadcrumbs << Atom(Atom::ListItemLeft)
+ << Atom(Atom::Link, QLatin1String("Qt Examples"))
+ << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
+ << Atom(Atom::String, QLatin1String("Examples"))
+ << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK)
+ << Atom(Atom::ListItemRight);
+ breadcrumbs << Atom(Atom::ListItemLeft)
+ << Atom(Atom::AutoLink, QLatin1String("QML Examples & Demos"))
+ << Atom(Atom::ListItemRight);
}
else if (fn->name().startsWith("examples-")) {
- out() << " <li><a href=\"all-examples.html\">Examples</a></li>";
- out() << " <li>" << protectEnc(title) << "</li>";
- }
- else if (fn->name() == QString("namespaces.html")) {
- out() << " <li>Namespaces</li>";
- }
- else {
- out() << " <li>" << protectEnc(title) << "</li>";
+ breadcrumbs << Atom(Atom::ListItemLeft)
+ << Atom(Atom::Link, QLatin1String("Qt Examples"))
+ << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
+ << Atom(Atom::String, QLatin1String("Examples"))
+ << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK)
+ << Atom(Atom::ListItemRight);
+ breadcrumbs << Atom(Atom::ListItemLeft)
+ << Atom(Atom::String, protectEnc(title))
+ << Atom(Atom::ListItemRight);
}
+ else if (fn->name() == QString("namespaces.html"))
+ breadcrumbs << Atom(Atom::String, QLatin1String("Namespaces"));
+ else
+ breadcrumbs << Atom(Atom::ListItemLeft)
+ << Atom(Atom::String, protectEnc(title))
+ << Atom(Atom::ListItemRight);
}
else if (node->subType() == Node::QmlClass) {
- out() << " <li><a href=\"qdeclarativeelements.html\">QML Elements</a></li>";
- out() << " <li>" << protectEnc(title) << "</li>";
+ breadcrumbs << Atom(Atom::ListItemLeft)
+ << Atom(Atom::AutoLink, QLatin1String("QML Elements"))
+ << Atom(Atom::ListItemRight);
+ breadcrumbs << Atom(Atom::ListItemLeft)
+ << Atom(Atom::String, protectEnc(title))
+ << Atom(Atom::ListItemRight);
}
else if (node->subType() == Node::Example) {
- out() << " <li><a href=\"all-examples.html\">Examples</a></li>";
+ breadcrumbs << Atom(Atom::ListItemLeft)
+ << Atom(Atom::Link, QLatin1String("Qt Examples"))
+ << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
+ << Atom(Atom::String, QLatin1String("Examples"))
+ << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK)
+ << Atom(Atom::ListItemRight);
QStringList sl = fn->name().split('/');
if (sl.contains("declarative"))
- out() << " <li><a href=\"qdeclarativeexamples.html\">QML Examples &amp; Demos</a></li>";
+ breadcrumbs << Atom(Atom::ListItemLeft)
+ << Atom(Atom::AutoLink, QLatin1String("QML Examples & Demos"))
+ << Atom(Atom::ListItemRight);
else {
QString name = protectEnc("examples-" + sl.at(0) + ".html"); // this generates an empty link
QString t = CodeParser::titleFromName(name);
}
- out() << " <li>" << protectEnc(title) << "</li>";
+ breadcrumbs << Atom(Atom::ListItemLeft)
+ << Atom(Atom::String, protectEnc(title))
+ << Atom(Atom::ListItemRight);
}
}
else if (node->type() == Node::Namespace) {
- out() << " <li><a href=\"namespaces.html\">Namespaces</a></li>";
- out() << " <li>" << protectEnc(title) << "</li>";
+ breadcrumbs << Atom(Atom::ListItemLeft)
+ << Atom(Atom::Link, QLatin1String("All Namespaces"))
+ << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
+ << Atom(Atom::String, QLatin1String("Namespaces"))
+ << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK)
+ << Atom(Atom::ListItemRight);
+ breadcrumbs << Atom(Atom::ListItemLeft)
+ << Atom(Atom::String, protectEnc(title))
+ << Atom(Atom::ListItemRight);
}
+
+ generateText(breadcrumbs, node, marker);
}
void HtmlGenerator::generateHeader(const QString& title,
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index 0f85d37..ee050f5 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -771,30 +771,6 @@ void InnerNode::removeChild(Node *child)
}
}
-/*! \fn QString InnerNode::author() const
- Returns the author.
- */
-
-/*! \fn void InnerNode::setAuthor(const QString& author)
- Sets the \a author.
- */
-
-/*! \fn QString InnerNode::publisher() const
- Returns the publisher.
- */
-
-/*! \fn void InnerNode::setPublisher(const QString& publisher)
- Sets the \a publisher.
- */
-
-/*! \fn QString InnerNode::permissions() const
- Returns the permissions.
- */
-
-/*! \fn void InnerNode::setPermissions(const QString& permissions)
- Sets the \a permissions.
- */
-
/*!
Find the module (QtCore, QtGui, etc.) to which the class belongs.
We do this by obtaining the full path to the header file's location
@@ -858,21 +834,6 @@ void InnerNode::removeRelated(Node *pseudoChild)
related.removeAll(pseudoChild);
}
-/*! \fn bool InnerNode::hasOtherMetadata() const
- Returns tru if the other metadata map is not empty.
- */
-
-/*!
- Insert the pair \a name and \a content into the other metadata map.
- */
-void insertOtherMetadata(const QString& name, const QString& content)
-{
-}
-
-/*! \fn const QMap<QString, QString>& InnerNode::otherMetadata() cont
- Returns the map containing pairs for output as \c {<othermetadata>}.
- */
-
/*!
\class LeafNode
*/
diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h
index 2de2b5a..d1123dc 100644
--- a/tools/qdoc3/node.h
+++ b/tools/qdoc3/node.h
@@ -262,21 +262,12 @@ class InnerNode : public Node
NodeList overloads(const QString &funcName) const;
const QStringList& includes() const { return inc; }
- QString author() const { return author_; }
- void setAuthor(const QString& author) { author_ = author; }
- QString publisher() const { return publisher_; }
- void setPublisher(const QString& publisher) { publisher_ = publisher; }
- QString permissions() const { return permissions_; }
- void setPermissions(const QString& permissions) { permissions_ = permissions; }
QStringList primaryKeys();
QStringList secondaryKeys();
const QStringList& pageKeywords() const { return pageKeywds; }
virtual void addPageKeywords(const QString& t) { pageKeywds << t; }
virtual bool isAbstract() const { return false; }
virtual void setAbstract(bool ) { }
- bool hasOtherMetadata() const { return !otherMetadataMap.isEmpty(); }
- void insertOtherMetadata(const QString& name, const QString& content);
- const QMap<QString, QString>& otherMetadata() const { return otherMetadataMap; }
protected:
InnerNode(Type type, InnerNode* parent, const QString& name);
@@ -289,9 +280,6 @@ class InnerNode : public Node
void removeChild(Node* child);
void removeRelated(Node* pseudoChild);
- QString author_;
- QString publisher_;
- QString permissions_;
QStringList pageKeywds;
QStringList inc;
NodeList children;
@@ -300,7 +288,6 @@ class InnerNode : public Node
QMap<QString, Node*> childMap;
QMap<QString, Node*> primaryFunctionMap;
QMap<QString, NodeList> secondaryFunctionMap;
- QMap<QString, QString> otherMetadataMap;
};
class LeafNode : public Node
diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro
index 5b4131f..2b4c6a0 100644
--- a/tools/qdoc3/qdoc3.pro
+++ b/tools/qdoc3/qdoc3.pro
@@ -88,7 +88,7 @@ SOURCES += atom.cpp \
INCLUDEPATH += $$QT_BUILD_TREE/include/QtDeclarative
-include($$QT_SOURCE_TREE/src/declarative/qml/parser/parser.pri)
+include(declarativeparser/parser.pri)
### Documentation for qdoc3 ###
diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf
index 0e9a2a8..4141a03 100644
--- a/tools/qdoc3/test/assistant.qdocconf
+++ b/tools/qdoc3/test/assistant.qdocconf
@@ -13,7 +13,7 @@ indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index
qhp.projects = Assistant
qhp.Assistant.file = assistant.qhp
-qhp.Assistant.namespace = com.trolltech.assistant.472
+qhp.Assistant.namespace = com.trolltech.assistant.474
qhp.Assistant.virtualFolder = qdoc
qhp.Assistant.indexTitle = Qt Assistant Manual
qhp.Assistant.extraFiles = images/bg_l.png \
@@ -50,7 +50,7 @@ qhp.Assistant.extraFiles = images/bg_l.png \
style/style_ie8.css \
style/style.css
-qhp.Assistant.filterAttributes = qt 4.7.2 tools assistant
+qhp.Assistant.filterAttributes = qt 4.7.4 tools assistant
qhp.Assistant.customFilters.Assistant.name = Qt Assistant Manual
qhp.Assistant.customFilters.Assistant.filterAttributes = qt tools assistant
qhp.Assistant.subprojects = manual examples
diff --git a/tools/qdoc3/test/designer.qdocconf b/tools/qdoc3/test/designer.qdocconf
index 637399b..6c98ddf 100644
--- a/tools/qdoc3/test/designer.qdocconf
+++ b/tools/qdoc3/test/designer.qdocconf
@@ -13,7 +13,7 @@ indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index
qhp.projects = Designer
qhp.Designer.file = designer.qhp
-qhp.Designer.namespace = com.trolltech.designer.472
+qhp.Designer.namespace = com.trolltech.designer.474
qhp.Designer.virtualFolder = qdoc
qhp.Designer.indexTitle = Qt Designer Manual
qhp.Designer.extraFiles = images/bg_l.png \
@@ -50,7 +50,7 @@ qhp.Designer.extraFiles = images/bg_l.png \
style/style_ie8.css \
style/style.css
-qhp.Designer.filterAttributes = qt 4.7.2 tools designer
+qhp.Designer.filterAttributes = qt 4.7.4 tools designer
qhp.Designer.customFilters.Designer.name = Qt Designer Manual
qhp.Designer.customFilters.Designer.filterAttributes = qt tools designer
qhp.Designer.subprojects = manual examples
diff --git a/tools/qdoc3/test/linguist.qdocconf b/tools/qdoc3/test/linguist.qdocconf
index 8ee298e..c9d6751 100644
--- a/tools/qdoc3/test/linguist.qdocconf
+++ b/tools/qdoc3/test/linguist.qdocconf
@@ -13,7 +13,7 @@ indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index
qhp.projects = Linguist
qhp.Linguist.file = linguist.qhp
-qhp.Linguist.namespace = com.trolltech.linguist.472
+qhp.Linguist.namespace = com.trolltech.linguist.474
qhp.Linguist.virtualFolder = qdoc
qhp.Linguist.indexTitle = Qt Linguist Manual
qhp.Linguist.extraFiles = images/bg_l.png \
@@ -50,7 +50,7 @@ qhp.Linguist.extraFiles = images/bg_l.png \
style/style_ie8.css \
style/style.css
-qhp.Linguist.filterAttributes = qt 4.7.2 tools linguist
+qhp.Linguist.filterAttributes = qt 4.7.4 tools linguist
qhp.Linguist.customFilters.Linguist.name = Qt Linguist Manual
qhp.Linguist.customFilters.Linguist.filterAttributes = qt tools linguist
qhp.Linguist.subprojects = manual examples
diff --git a/tools/qdoc3/test/macros.qdocconf b/tools/qdoc3/test/macros.qdocconf
index 2262daa..87e442d 100644
--- a/tools/qdoc3/test/macros.qdocconf
+++ b/tools/qdoc3/test/macros.qdocconf
@@ -29,6 +29,7 @@ macro.begincomment = "\\c{/*}"
macro.endcomment = "\\c{*/}"
macro.uuml.HTML = "&uuml;"
macro.mdash.HTML = "&mdash;"
+macro.pi.HTML = "&Pi;"
macro.beginfloatleft.HTML = "<div style=\"float: left; margin-right: 2em\">"
macro.beginfloatright.HTML = "<div style=\"float: right; margin-left: 2em\">"
diff --git a/tools/qdoc3/test/qdeclarative.qdocconf b/tools/qdoc3/test/qdeclarative.qdocconf
index e68a935..8fe9034 100644
--- a/tools/qdoc3/test/qdeclarative.qdocconf
+++ b/tools/qdoc3/test/qdeclarative.qdocconf
@@ -21,7 +21,7 @@ edition.DesktopLight.groups = -graphicsview-api
qhp.projects = Qml
qhp.Qml.file = qml.qhp
-qhp.Qml.namespace = com.trolltech.qml.472
+qhp.Qml.namespace = com.trolltech.qml.474
qhp.Qml.virtualFolder = qdoc
qhp.Qml.indexTitle = Qml Reference
@@ -61,9 +61,9 @@ qhp.Qml.extraFiles = images/bg_l.png \
style/style_ie8.css \
style/style.css
-qhp.Qml.filterAttributes = qt 4.7.2 qtrefdoc
-qhp.Qml.customFilters.Qt.name = Qt 4.7.2
-qhp.Qml.customFilters.Qt.filterAttributes = qt 4.7.2
+qhp.Qml.filterAttributes = qt 4.7.4 qtrefdoc
+qhp.Qml.customFilters.Qt.name = Qt 4.7.4
+qhp.Qml.customFilters.Qt.filterAttributes = qt 4.7.4
qhp.Qml.subprojects = classes
qhp.Qml.subprojects.classes.title = Elements
qhp.Qml.subprojects.classes.indexTitle = Qml Elements
diff --git a/tools/qdoc3/test/qmake.qdocconf b/tools/qdoc3/test/qmake.qdocconf
index b5bc96c..c5a0f40 100644
--- a/tools/qdoc3/test/qmake.qdocconf
+++ b/tools/qdoc3/test/qmake.qdocconf
@@ -13,7 +13,7 @@ indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index
qhp.projects = qmake
qhp.qmake.file = qmake.qhp
-qhp.qmake.namespace = com.trolltech.qmake.472
+qhp.qmake.namespace = com.trolltech.qmake.474
qhp.qmake.virtualFolder = qdoc
qhp.qmake.indexTitle = QMake Manual
qhp.qmake.extraFiles = images/bg_l.png \
@@ -50,7 +50,7 @@ qhp.qmake.extraFiles = images/bg_l.png \
style/style_ie8.css \
style/style.css
-qhp.qmake.filterAttributes = qt 4.7.2 tools qmake
+qhp.qmake.filterAttributes = qt 4.7.4 tools qmake
qhp.qmake.customFilters.qmake.name = qmake Manual
qhp.qmake.customFilters.qmake.filterAttributes = qt tools qmake
qhp.qmake.subprojects = manual
diff --git a/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf b/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf
index 24696d5..a14054c 100644
--- a/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf
@@ -17,15 +17,15 @@ indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index
qhp.projects = Qt
qhp.Qt.file = qt.qhp
-qhp.Qt.namespace = com.trolltech.qt.472
+qhp.Qt.namespace = com.trolltech.qt.474
qhp.Qt.virtualFolder = qdoc
qhp.Qt.title = Qt
qhp.Qt.indexTitle = Qt
qhp.Qt.selectors = fake:example
-qhp.Qt.filterAttributes = qt 4.7.2 qtrefdoc ja_JP
-qhp.Qt.customFilters.Qt.name = Qt 4.7.2
-qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.2
+qhp.Qt.filterAttributes = qt 4.7.4 qtrefdoc ja_JP
+qhp.Qt.customFilters.Qt.name = Qt 4.7.4
+qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.4
# Files not referenced in any qdoc file (last four are needed by qtdemo)
# See also extraimages.HTML
@@ -96,7 +96,7 @@ excludedirs = $QT_SOURCE_TREE/src/3rdparty/clucene \
$QT_SOURCE_TREE/src/3rdparty/phonon/waveout
sources.fileextensions = "*.cpp *.qdoc *.mm"
-examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp"
+examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.css"
examples.imageextensions = "*.png"
exampledirs = $QT_SOURCE_TREE/doc/src \
diff --git a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf
index 7789bf7..d4d43b8 100644
--- a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf
@@ -17,15 +17,15 @@ indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index
qhp.projects = Qt
qhp.Qt.file = qt.qhp
-qhp.Qt.namespace = com.trolltech.qt.472
+qhp.Qt.namespace = com.trolltech.qt.474
qhp.Qt.virtualFolder = qdoc
qhp.Qt.title = 教程
qhp.Qt.indexTitle = 教程
qhp.Qt.selectors = fake:example
-qhp.Qt.filterAttributes = qt 4.7.2 qtrefdoc zh_CN
-qhp.Qt.customFilters.Qt.name = Qt 4.7.2
-qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.2
+qhp.Qt.filterAttributes = qt 4.7.4 qtrefdoc zh_CN
+qhp.Qt.customFilters.Qt.name = Qt 4.7.4
+qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.4
# Files not referenced in any qdoc file (last four are needed by qtdemo)
# See also extraimages.HTML
@@ -96,7 +96,7 @@ excludedirs = $QT_SOURCE_TREE/src/3rdparty/clucene \
$QT_SOURCE_TREE/src/3rdparty/phonon/waveout
sources.fileextensions = "*.cpp *.qdoc *.mm"
-examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp"
+examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.css"
examples.imageextensions = "*.png"
exampledirs = $QT_SOURCE_TREE/doc/src \
diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf
index 6f756da..8a70f3b 100644
--- a/tools/qdoc3/test/qt-html-templates.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates.qdocconf
@@ -52,3 +52,259 @@ qhp.Qt.extraFiles = index.html \
images/horBar.png \
images/sprites-combined.png \
style/offline.css
+
+#QtWebKit Guide files
+qhp.Qt.extraFiles += webkit-guide/anim_accord.htm \
+webkit-guide/anim_demo-rotate.htm \
+webkit-guide/anim_demo-scale.htm \
+webkit-guide/anim_demo-skew.htm \
+webkit-guide/anim_gallery.htm \
+webkit-guide/anim_panel.htm \
+webkit-guide/anim_pulse.htm \
+webkit-guide/anim_skew.htm \
+webkit-guide/anim_slide1.htm \
+webkit-guide/anim_slide2.htm \
+webkit-guide/anim_slide3.htm \
+webkit-guide/anim_tabbedSkew.htm \
+webkit-guide/_copyright.txt \
+webkit-guide/css3_backgrounds.htm \
+webkit-guide/css3_border-img.htm \
+webkit-guide/css3_gradientBack.htm \
+webkit-guide/css3_gradientBackStop.htm \
+webkit-guide/css3_gradientButton.htm \
+webkit-guide/css3_grad-radial.htm \
+webkit-guide/css3_mask-grad.htm \
+webkit-guide/css3_mask-img.htm \
+webkit-guide/css3_multicol.htm \
+webkit-guide/css3_reflect.htm \
+webkit-guide/css3_scroll.htm \
+webkit-guide/css3_sel-nth.htm \
+webkit-guide/css3_shadow.htm \
+webkit-guide/css3_text-overflow.htm \
+webkit-guide/css3_text-shadow.htm \
+webkit-guide/css3_text-stroke.htm \
+webkit-guide/form_tapper.htm \
+webkit-guide/form_toggler.htm \
+webkit-guide/_image_assets.htm \
+webkit-guide/_index.html \
+webkit-guide/layout_link-fmt.htm \
+webkit-guide/layout_tbl-keyhole.htm \
+webkit-guide/mob_condjs.htm \
+webkit-guide/mob_layout.htm \
+webkit-guide/mob_mediaquery.htm \
+webkit-guide/storage.htm \
+webkit-guide/css/anim_accord.css \
+webkit-guide/css/anim_demo-rotate.css \
+webkit-guide/css/anim_demo-scale.css \
+webkit-guide/css/anim_demo-skew.css \
+webkit-guide/css/anim_gallery.css \
+webkit-guide/css/anim_panel.css \
+webkit-guide/css/anim_pulse.css \
+webkit-guide/css/anim_skew.css \
+webkit-guide/css/anim_slide.css \
+webkit-guide/css/anim_tabbedSkew.css \
+webkit-guide/css/css3_backgrounds.css \
+webkit-guide/css/css3_border-img.css \
+webkit-guide/css/css3_gradientBack.css \
+webkit-guide/css/css3_gradientBackStop.css \
+webkit-guide/css/css3_gradientButton.css \
+webkit-guide/css/css3_grad-radial.css \
+webkit-guide/css/css3_mask-grad.css \
+webkit-guide/css/css3_mask-img.css \
+webkit-guide/css/css3_multicol.css \
+webkit-guide/css/css3_reflect.css \
+webkit-guide/css/css3_scroll.css \
+webkit-guide/css/css3_sel-nth.css \
+webkit-guide/css/css3_shadowBlur.css \
+webkit-guide/css/css3_shadow.css \
+webkit-guide/css/css3_text-overflow.css \
+webkit-guide/css/css3_text-shadow.css \
+webkit-guide/css/css3_text-stroke.css \
+webkit-guide/css/form_tapper.css \
+webkit-guide/css/form_toggler.css \
+webkit-guide/css/layout_link-fmt.css \
+webkit-guide/css/layout_tbl-keyhole.css \
+webkit-guide/css/mob_condjs.css \
+webkit-guide/css/mobile.css \
+webkit-guide/css/mob_mediaquery.css \
+webkit-guide/css/mq_desktop.css \
+webkit-guide/css/mqlayout_desktop.css \
+webkit-guide/css/mqlayout_mobile.css \
+webkit-guide/css/mqlayout_touch.css \
+webkit-guide/css/mq_mobile.css \
+webkit-guide/css/mq_touch.css \
+webkit-guide/css/storage.css \
+webkit-guide/img/border-frame.png \
+webkit-guide/img/gal0.png \
+webkit-guide/img/gal1.png \
+webkit-guide/img/gal2.png \
+webkit-guide/img/gal3.png \
+webkit-guide/img/gal4.png \
+webkit-guide/img/gal5.png \
+webkit-guide/img/gal6.png \
+webkit-guide/img/gal7.png \
+webkit-guide/img/gal8.png \
+webkit-guide/img/gradient.jpg \
+webkit-guide/img/gray_icon_close.png \
+webkit-guide/img/ic_ag_016.png \
+webkit-guide/img/ic_ag_032.png \
+webkit-guide/img/ic_ag_036.png \
+webkit-guide/img/ic_ag_048.png \
+webkit-guide/img/ic_al_016.png \
+webkit-guide/img/ic_al_032.png \
+webkit-guide/img/ic_al_036.png \
+webkit-guide/img/ic_al_048.png \
+webkit-guide/img/ic_ar_016.png \
+webkit-guide/img/ic_ar_032.png \
+webkit-guide/img/ic_ar_036.png \
+webkit-guide/img/ic_ar_048.png \
+webkit-guide/img/ic_b_016.png \
+webkit-guide/img/ic_b_032.png \
+webkit-guide/img/ic_b_036.png \
+webkit-guide/img/ic_b_048.png \
+webkit-guide/img/ic_be_016.png \
+webkit-guide/img/ic_be_032.png \
+webkit-guide/img/ic_be_036.png \
+webkit-guide/img/ic_be_048.png \
+webkit-guide/img/ic_c_016.png \
+webkit-guide/img/ic_c_032.png \
+webkit-guide/img/ic_c_036.png \
+webkit-guide/img/ic_c_048.png \
+webkit-guide/img/ic_ca_016.png \
+webkit-guide/img/ic_ca_032.png \
+webkit-guide/img/ic_ca_036.png \
+webkit-guide/img/ic_ca_048.png \
+webkit-guide/img/ic_cl_016.png \
+webkit-guide/img/ic_cl_032.png \
+webkit-guide/img/ic_cl_036.png \
+webkit-guide/img/ic_cl_048.png \
+webkit-guide/img/ic_cu_016.png \
+webkit-guide/img/ic_cu_032.png \
+webkit-guide/img/ic_cu_036.png \
+webkit-guide/img/ic_cu_048.png \
+webkit-guide/img/ic_f_016.png \
+webkit-guide/img/ic_f_032.png \
+webkit-guide/img/ic_f_036.png \
+webkit-guide/img/ic_f_048.png \
+webkit-guide/img/ic_fe_016.png \
+webkit-guide/img/ic_fe_032.png \
+webkit-guide/img/ic_fe_036.png \
+webkit-guide/img/ic_fe_048.png \
+webkit-guide/img/ic_h_016.png \
+webkit-guide/img/ic_h_032.png \
+webkit-guide/img/ic_h_036.png \
+webkit-guide/img/ic_h_048.png \
+webkit-guide/img/ic_he_016.png \
+webkit-guide/img/ic_he_032.png \
+webkit-guide/img/ic_he_036.png \
+webkit-guide/img/ic_he_048.png \
+webkit-guide/img/ic_k_016.png \
+webkit-guide/img/ic_k_032.png \
+webkit-guide/img/ic_k_036.png \
+webkit-guide/img/ic_k_048.png \
+webkit-guide/img/ic_li_016.png \
+webkit-guide/img/ic_li_032.png \
+webkit-guide/img/ic_li_036.png \
+webkit-guide/img/ic_li_048.png \
+webkit-guide/img/ic_mg_016.png \
+webkit-guide/img/ic_mg_032.png \
+webkit-guide/img/ic_mg_036.png \
+webkit-guide/img/ic_mg_048.png \
+webkit-guide/img/ic_n_016.png \
+webkit-guide/img/ic_n_032.png \
+webkit-guide/img/ic_n_036.png \
+webkit-guide/img/ic_n_048.png \
+webkit-guide/img/ic_na_016.png \
+webkit-guide/img/ic_na_032.png \
+webkit-guide/img/ic_na_036.png \
+webkit-guide/img/ic_na_048.png \
+webkit-guide/img/ic_ne_016.png \
+webkit-guide/img/ic_ne_032.png \
+webkit-guide/img/ic_ne_036.png \
+webkit-guide/img/ic_ne_048.png \
+webkit-guide/img/ic_ni_016.png \
+webkit-guide/img/ic_ni_032.png \
+webkit-guide/img/ic_ni_036.png \
+webkit-guide/img/ic_ni_048.png \
+webkit-guide/img/ic_o_016.png \
+webkit-guide/img/ic_o_032.png \
+webkit-guide/img/ic_o_036.png \
+webkit-guide/img/ic_o_048.png \
+webkit-guide/img/icon_check.png \
+webkit-guide/img/icon_check_x24green.png \
+webkit-guide/img/icon_dismiss.png \
+webkit-guide/img/icon_dismiss_x22.png \
+webkit-guide/img/icon_drill-down.png \
+webkit-guide/img/icon_drill-down_x32.png \
+webkit-guide/img/icon_drill-up.png \
+webkit-guide/img/icon_drill-up_x32.png \
+webkit-guide/img/icon_expand-nav.png \
+webkit-guide/img/icon_head-collapsed.png \
+webkit-guide/img/icon_head-collapsed_x13.png \
+webkit-guide/img/icon_head-expanded.png \
+webkit-guide/img/icon_head-expanded_x13.png \
+webkit-guide/img/icon_info.png \
+webkit-guide/img/icon_info_x24.png \
+webkit-guide/img/icon_link-doc.png \
+webkit-guide/img/icon_link-email.png \
+webkit-guide/img/icon_link-external.png \
+webkit-guide/img/icon_link-pdf.png \
+webkit-guide/img/icon_link-ppt.png \
+webkit-guide/img/icon_link-rss.png \
+webkit-guide/img/icon_link-sms.png \
+webkit-guide/img/icon_link-tel.png \
+webkit-guide/img/icon_link-xls.png \
+webkit-guide/img/icon_list-all_circ.png \
+webkit-guide/img/icon_list-all.png \
+webkit-guide/img/icon_nav_end.png \
+webkit-guide/img/icon_nav-start.png \
+webkit-guide/img/icon_nav-top.png \
+webkit-guide/img/icon_nav-up.png \
+webkit-guide/img/icon_question.png \
+webkit-guide/img/icon_scroll-left.png \
+webkit-guide/img/icon_scroll-right.png \
+webkit-guide/img/icon_trash.png \
+webkit-guide/img/ic_pt_016.png \
+webkit-guide/img/ic_pt_032.png \
+webkit-guide/img/ic_pt_036.png \
+webkit-guide/img/ic_pt_048.png \
+webkit-guide/img/ic_si_016.png \
+webkit-guide/img/ic_si_032.png \
+webkit-guide/img/ic_si_036.png \
+webkit-guide/img/ic_si_048.png \
+webkit-guide/img/ic_zn_016.png \
+webkit-guide/img/ic_zn_032.png \
+webkit-guide/img/ic_zn_036.png \
+webkit-guide/img/ic_zn_048.png \
+webkit-guide/img/land1.png \
+webkit-guide/img/land2.png \
+webkit-guide/img/land3.png \
+webkit-guide/img/land4.png \
+webkit-guide/img/land5.png \
+webkit-guide/img/land6.png \
+webkit-guide/img/land7.png \
+webkit-guide/img/land8.png \
+webkit-guide/img/mask.png \
+webkit-guide/img/tnail_gal1.png \
+webkit-guide/img/tnail_gal2.png \
+webkit-guide/img/tnail_gal3.png \
+webkit-guide/img/tnail_gal4.png \
+webkit-guide/img/tnail_gal5.png \
+webkit-guide/img/tnail_gal6.png \
+webkit-guide/img/tnail_gal7.png \
+webkit-guide/img/tnail_gal8.png \
+webkit-guide/js/anim_accord.js \
+webkit-guide/js/anim_gallery.js \
+webkit-guide/js/anim_panel.js \
+webkit-guide/js/anim_skew.js \
+webkit-guide/js/css3_backgrounds.js \
+webkit-guide/js/css3_border-img.js \
+webkit-guide/js/css3_grad-radial.js \
+webkit-guide/js/css3_mask-grad.js \
+webkit-guide/js/css3_mask-img.js \
+webkit-guide/js/css3_text-overflow.js \
+webkit-guide/js/form_tapper.js \
+webkit-guide/js/mob_condjs.js \
+webkit-guide/js/mobile.js \
+webkit-guide/js/storage.js \
+
diff --git a/tools/qdoc3/test/qt-project.qdocconf b/tools/qdoc3/test/qt-project.qdocconf
index 3ed7cff..2f6ab9d 100644
--- a/tools/qdoc3/test/qt-project.qdocconf
+++ b/tools/qdoc3/test/qt-project.qdocconf
@@ -6,7 +6,7 @@ include(qt-defines.qdocconf)
project = Qt
description = Qt Reference Documentation
url = http://qt.nokia.com/doc/4.7
-version = 4.7.2
+version = 4.7.3
sourceencoding = UTF-8
outputencoding = UTF-8
@@ -15,14 +15,14 @@ naturallanguage = en_US
qhp.projects = Qt
qhp.Qt.file = qt.qhp
-qhp.Qt.namespace = com.trolltech.qt.472
+qhp.Qt.namespace = com.trolltech.qt.474
qhp.Qt.virtualFolder = qdoc
qhp.Qt.indexTitle = Qt Reference Documentation
qhp.Qt.indexRoot =
-qhp.Qt.filterAttributes = qt 4.7.2 qtrefdoc
-qhp.Qt.customFilters.Qt.name = Qt 4.7.2
-qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.2
+qhp.Qt.filterAttributes = qt 4.7.4 qtrefdoc
+qhp.Qt.customFilters.Qt.name = Qt 4.7.4
+qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.4
qhp.Qt.subprojects = classes overviews examples
qhp.Qt.subprojects.classes.title = Classes
qhp.Qt.subprojects.classes.indexTitle = Qt's Classes
@@ -90,7 +90,7 @@ excludedirs = $QT_SOURCE_TREE/src/3rdparty/clucene \
sources.fileextensions = "*.c++ *.cc *.cpp *.cxx *.mm *.qml *.qdoc"
headers.fileextensions = "*.ch *.h *.h++ *.hh *.hpp *.hxx"
-examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml"
+examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml *.css"
examples.imageextensions = "*.png"
exampledirs = $QT_SOURCE_TREE/doc/src \
diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp
index e1c0460..6778bd5 100644
--- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp
+++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp
@@ -47,7 +47,6 @@
#include <private/qpixmap_raster_p.h>
#include <private/qwindowsurface_gl_p.h>
#include "qmeegoruntime.h"
-#include "qmeegoswitchevent.h"
QString QMeeGoGraphicsSystemHelper::runningGraphicsSystemName()
{
@@ -77,44 +76,12 @@ bool QMeeGoGraphicsSystemHelper::isRunningRuntime()
void QMeeGoGraphicsSystemHelper::switchToMeeGo()
{
- if (isRunningMeeGo())
- return;
-
- if (QApplicationPrivate::instance()->graphics_system_name != QLatin1String("runtime"))
- qWarning("Can't switch to meego - switching only supported with 'runtime' graphics system.");
- else {
- QMeeGoSwitchEvent willSwitchEvent(QLatin1String("meego"), QMeeGoSwitchEvent::WillSwitch);
- foreach (QWidget *widget, QApplication::topLevelWidgets())
- QCoreApplication::sendEvent(widget, &willSwitchEvent);
-
- QApplication *app = static_cast<QApplication *>(QCoreApplication::instance());
- app->setGraphicsSystem(QLatin1String("meego"));
-
- QMeeGoSwitchEvent didSwitchEvent(QLatin1String("meego"), QMeeGoSwitchEvent::DidSwitch);
- foreach (QWidget *widget, QApplication::topLevelWidgets())
- QCoreApplication::sendEvent(widget, &didSwitchEvent);
- }
+ QMeeGoRuntime::switchToMeeGo();
}
void QMeeGoGraphicsSystemHelper::switchToRaster()
{
- if (runningGraphicsSystemName() == QLatin1String("raster"))
- return;
-
- if (QApplicationPrivate::instance()->graphics_system_name != QLatin1String("runtime"))
- qWarning("Can't switch to raster - switching only supported with 'runtime' graphics system.");
- else {
- QMeeGoSwitchEvent willSwitchEvent(QLatin1String("raster"), QMeeGoSwitchEvent::WillSwitch);
- foreach (QWidget *widget, QApplication::topLevelWidgets())
- QCoreApplication::sendEvent(widget, &willSwitchEvent);
-
- QApplication *app = static_cast<QApplication *>(QCoreApplication::instance());
- app->setGraphicsSystem(QLatin1String("raster"));
-
- QMeeGoSwitchEvent didSwitchEvent(QLatin1String("raster"), QMeeGoSwitchEvent::DidSwitch);
- foreach (QWidget *widget, QApplication::topLevelWidgets())
- QCoreApplication::sendEvent(widget, &didSwitchEvent);
- }
+ QMeeGoRuntime::switchToRaster();
}
Qt::HANDLE QMeeGoGraphicsSystemHelper::imageToEGLSharedImage(const QImage &image)
@@ -168,3 +135,13 @@ void QMeeGoGraphicsSystemHelper::setSwapBehavior(SwapMode mode)
else if (mode == KillSwap)
QGLWindowSurface::swapBehavior = QGLWindowSurface::KillSwap;
}
+
+void QMeeGoGraphicsSystemHelper::setSwitchPolicy(SwitchPolicy policy)
+{
+ QMeeGoRuntime::setSwitchPolicy(policy);
+}
+
+void QMeeGoGraphicsSystemHelper::enableSwitchEvents()
+{
+ QMeeGoRuntime::enableSwitchEvents();
+}
diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h
index 5a3b57e..4612190 100644
--- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h
+++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h
@@ -97,14 +97,22 @@ public:
*/
static bool isRunningRuntime();
+ //! Enables the sending of QMeeGoSwitchEvent's when the graphicssystem switches.
+ /*!
+ An application that wishes to start receive QMeegoSwitchEvents must call this function.
+ */
+ static void enableSwitchEvents();
+
//! Switches to meego graphics system.
/*!
When running with the 'runtime' graphics system, sets the currently active
system to 'meego'. The window surface and all the resources are automatically
migrated to OpenGL. Will fail if the active graphics system is not 'runtime'.
Calling this function will emit QMeeGoSwitchEvent to the top level widgets.
- Two events will be emitted for each switch -- one before the switch (QMeeGoSwitchEvent::WillSwitch)
- and one after the switch (QMeeGoSwitchEvent::DidSwitch).
+ If switch events are enabled, two events will be emitted for each switch --
+ one before the switch (QMeeGoSwitchEvent::WillSwitch) and one after the
+ switch (QMeeGoSwitchEvent::DidSwitch).
+ If the switch policy is set to NoSwitch, this function has no effect.
*/
static void switchToMeeGo();
@@ -114,12 +122,30 @@ public:
system to 'raster'. The window surface and the graphics resources (including the
EGL shared image resources) are automatically migrated back to the CPU. All OpenGL
resources (surface, context, cache, font cache) are automaticall anihilated.
- Calling this function will emit QMeeGoSwitchEvent to the top level widgets.
- Two events will be emitted for each switch -- one before the switch (QMeeGoSwitchEvent::WillSwitch)
- and one after the switch (QMeeGoSwitchEvent::DidSwitch).
+ Calling this function will emit QMeeGoSwitchEvent to the top level widgets. If switch
+ events are enabled, two events will be emitted for each switch -- one before the
+ switch (QMeeGoSwitchEvent::WillSwitch) and one after the switch (QMeeGoSwitchEvent::DidSwitch).
+ If the switch policy is set to NoSwitch, this function has no effect.
*/
static void switchToRaster();
+ //! Used to specify the policy for graphics system switching.
+ enum SwitchPolicy {
+ AutomaticSwitch, /**< Automatic switching */
+ ManualSwitch, /**< Switching is controleld by the application */
+ NoSwitch /**< Switching is disabled completely */
+ };
+
+ //! Sets the policy of graphicssystem switching
+ /*!
+ By default, the switch to raster happens automatically when all windows are either
+ minimized or when the last window is destroyed. This function lets the application
+ change the graphicssystem switching policy to prevent the switching from happening
+ automatically (that is if the application doesn't want switching at all or wishes
+ to control the switching manually).
+ */
+ static void setSwitchPolicy(SwitchPolicy policy);
+
//! Returns the name of the active graphics system
/*!
Returns the name of the currently active system. If running with 'runtime' graphics
diff --git a/tools/qmeegographicssystemhelper/qmeegoruntime.cpp b/tools/qmeegographicssystemhelper/qmeegoruntime.cpp
index c32b654..928d01a 100644
--- a/tools/qmeegographicssystemhelper/qmeegoruntime.cpp
+++ b/tools/qmeegographicssystemhelper/qmeegoruntime.cpp
@@ -41,6 +41,11 @@
#include "qmeegoruntime.h"
+#include "qmeegoswitchevent.h"
+
+#include <QtGui/QApplication>
+#include <QtGui/QWidget>
+
#include <private/qlibrary_p.h>
#include <private/qfactoryloader_p.h>
#include <private/qgraphicssystemplugin_p.h>
@@ -49,6 +54,7 @@
#define ENSURE_INITIALIZED {if (!initialized) initialize();}
bool QMeeGoRuntime::initialized = false;
+bool QMeeGoRuntime::switchEventsEnabled = false;
typedef int (*QMeeGoImageToEglSharedImageFunc) (const QImage&);
typedef QPixmapData* (*QMeeGoPixmapDataFromEglSharedImageFunc) (Qt::HANDLE handle, const QImage&);
@@ -65,6 +71,11 @@ typedef bool (*QMeeGoLiveTextureReleaseFunc) (QPixmap*, QImage *i);
typedef Qt::HANDLE (*QMeeGoLiveTextureGetHandleFunc) (QPixmap*);
typedef void* (*QMeeGoCreateFenceSyncFunc) (void);
typedef void (*QMeeGoDestroyFenceSyncFunc) (void *fs);
+typedef void (*QMeeGoInvalidateLiveSurfacesFunc) (void);
+typedef void (*QMeeGoSwitchToRasterFunc) (void);
+typedef void (*QMeeGoSwitchToMeeGoFunc) (void);
+typedef void (*QMeeGoRegisterSwitchCallbackFunc) (void (*callback)(int type, const char *name));
+typedef void (*QMeeGoSetSwitchPolicyFunc) (int policy);
static QMeeGoImageToEglSharedImageFunc qt_meego_image_to_egl_shared_image = NULL;
static QMeeGoPixmapDataFromEglSharedImageFunc qt_meego_pixmapdata_from_egl_shared_image = NULL;
@@ -81,6 +92,18 @@ static QMeeGoLiveTextureReleaseFunc qt_meego_live_texture_release = NULL;
static QMeeGoLiveTextureGetHandleFunc qt_meego_live_texture_get_handle = NULL;
static QMeeGoCreateFenceSyncFunc qt_meego_create_fence_sync = NULL;
static QMeeGoDestroyFenceSyncFunc qt_meego_destroy_fence_sync = NULL;
+static QMeeGoInvalidateLiveSurfacesFunc qt_meego_invalidate_live_surfaces = NULL;
+static QMeeGoSwitchToRasterFunc qt_meego_switch_to_raster = NULL;
+static QMeeGoSwitchToMeeGoFunc qt_meego_switch_to_meego = NULL;
+static QMeeGoRegisterSwitchCallbackFunc qt_meego_register_switch_callback = NULL;
+static QMeeGoSetSwitchPolicyFunc qt_meego_set_switch_policy = NULL;
+
+extern "C" void handleSwitch(int type, const char *name)
+{
+ QMeeGoSwitchEvent switchEvent((QLatin1String(name)), QMeeGoSwitchEvent::State(type));
+ foreach (QWidget *widget, QApplication::topLevelWidgets())
+ QCoreApplication::sendEvent(widget, &switchEvent);
+}
void QMeeGoRuntime::initialize()
{
@@ -109,13 +132,20 @@ void QMeeGoRuntime::initialize()
qt_meego_live_texture_get_handle = (QMeeGoLiveTextureGetHandleFunc) library.resolve("qt_meego_live_texture_get_handle");
qt_meego_create_fence_sync = (QMeeGoCreateFenceSyncFunc) library.resolve("qt_meego_create_fence_sync");
qt_meego_destroy_fence_sync = (QMeeGoDestroyFenceSyncFunc) library.resolve("qt_meego_destroy_fence_sync");
+ qt_meego_invalidate_live_surfaces = (QMeeGoInvalidateLiveSurfacesFunc) library.resolve("qt_meego_invalidate_live_surfaces");
+ qt_meego_switch_to_raster = (QMeeGoSwitchToRasterFunc) library.resolve("qt_meego_switch_to_raster");
+ qt_meego_switch_to_meego = (QMeeGoSwitchToMeeGoFunc) library.resolve("qt_meego_switch_to_meego");
+ qt_meego_register_switch_callback = (QMeeGoRegisterSwitchCallbackFunc) library.resolve("qt_meego_register_switch_callback");
+ qt_meego_set_switch_policy = (QMeeGoSetSwitchPolicyFunc) library.resolve("qt_meego_set_switch_policy");
if (qt_meego_image_to_egl_shared_image && qt_meego_pixmapdata_from_egl_shared_image &&
qt_meego_pixmapdata_with_gl_texture && qt_meego_destroy_egl_shared_image && qt_meego_update_egl_shared_image_pixmap &&
qt_meego_set_surface_fixed_size && qt_meego_set_surface_scaling && qt_meego_set_translucent &&
qt_meego_pixmapdata_with_new_live_texture && qt_meego_pixmapdata_from_live_texture_handle &&
qt_meego_live_texture_lock && qt_meego_live_texture_release && qt_meego_live_texture_get_handle &&
- qt_meego_create_fence_sync && qt_meego_destroy_fence_sync)
+ qt_meego_create_fence_sync && qt_meego_destroy_fence_sync && qt_meego_invalidate_live_surfaces &&
+ qt_meego_switch_to_raster && qt_meego_switch_to_meego && qt_meego_register_switch_callback &&
+ qt_meego_set_switch_policy)
{
qDebug("Successfully resolved MeeGo graphics system: %s %s\n", qPrintable(libraryPrivate->fileName), qPrintable(libraryPrivate->fullVersion));
} else {
@@ -232,3 +262,41 @@ void QMeeGoRuntime::destroyFenceSync(void *fs)
Q_ASSERT(qt_meego_destroy_fence_sync);
qt_meego_destroy_fence_sync(fs);
}
+
+void QMeeGoRuntime::invalidateLiveSurfaces()
+{
+ ENSURE_INITIALIZED;
+ Q_ASSERT(qt_meego_invalidate_live_surfaces);
+ qt_meego_invalidate_live_surfaces();
+}
+
+void QMeeGoRuntime::switchToRaster()
+{
+ ENSURE_INITIALIZED;
+ Q_ASSERT(qt_meego_switch_to_raster);
+ qt_meego_switch_to_raster();
+}
+
+void QMeeGoRuntime::switchToMeeGo()
+{
+ ENSURE_INITIALIZED;
+ Q_ASSERT(qt_meego_switch_to_meego);
+ qt_meego_switch_to_meego();
+}
+
+void QMeeGoRuntime::enableSwitchEvents()
+{
+ ENSURE_INITIALIZED;
+ if (!switchEventsEnabled) {
+ Q_ASSERT(qt_meego_register_switch_callback);
+ qt_meego_register_switch_callback(handleSwitch);
+ switchEventsEnabled = true;
+ }
+}
+
+void QMeeGoRuntime::setSwitchPolicy(QMeeGoGraphicsSystemHelper::SwitchPolicy policy)
+{
+ ENSURE_INITIALIZED;
+ Q_ASSERT(qt_meego_set_switch_policy);
+ qt_meego_set_switch_policy(int(policy));
+}
diff --git a/tools/qmeegographicssystemhelper/qmeegoruntime.h b/tools/qmeegographicssystemhelper/qmeegoruntime.h
index bdc4eef..b898699 100644
--- a/tools/qmeegographicssystemhelper/qmeegoruntime.h
+++ b/tools/qmeegographicssystemhelper/qmeegoruntime.h
@@ -42,6 +42,8 @@
#include <QPixmap>
#include <QImage>
+#include "qmeegographicssystemhelper.h"
+
class QMeeGoRuntime
{
public:
@@ -62,7 +64,13 @@ public:
static Qt::HANDLE getLiveTextureHandle(QPixmap *pixmap);
static void* createFenceSync();
static void destroyFenceSync(void *fs);
+ static void invalidateLiveSurfaces();
+ static void switchToRaster();
+ static void switchToMeeGo();
+ static void enableSwitchEvents();
+ static void setSwitchPolicy(QMeeGoGraphicsSystemHelper::SwitchPolicy policy);
private:
static bool initialized;
+ static bool switchEventsEnabled;
};
diff --git a/tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp b/tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp
index 0ab272f..b833e31 100644
--- a/tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp
+++ b/tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp
@@ -65,4 +65,4 @@ QEvent::Type QMeeGoSwitchEvent::eventNumber()
switchEventNumber = QEvent::registerEventType();
return (QEvent::Type) switchEventNumber;
-} \ No newline at end of file
+}
diff --git a/tools/qml/qml.pri b/tools/qml/qml.pri
index 2010cc1..cfc74af 100644
--- a/tools/qml/qml.pri
+++ b/tools/qml/qml.pri
@@ -26,6 +26,8 @@ symbian {
!contains(S60_VERSION, 3.1):!contains(S60_VERSION, 3.2) {
LIBS += -lsensrvclient -lsensrvutil
SOURCES += $$PWD/deviceorientation_symbian.cpp
+ } else {
+ SOURCES += $$PWD/deviceorientation.cpp
}
FORMS = $$PWD/recopts.ui \
$$PWD/proxysettings.ui